Require( "animob/animob.ts" ) function rgb8Color( r, g, b ) return ( r*65536 + g*256 + b ) end return AnimobAconf({ version = 1, -- All aconf files have a version number. default = "hc/hovercraft.aconf", object = { productName = "Hovercraft", gameKitVehicleControls = { class = "Hoverbike", }, appearance = { modelName = "m000bacio_retro.model", modelSettings = { main = { colormap = "bacio/t000bacio004a_green.jpg", lit = 1, }, }, }, animationTriggers = { default = { -- Normal "idle" animation type = "emotion", -- only type currently supported is "emotion" emotionName = "em000bacioo01_riding", axes = { { axisName = "UiAxis", direction = "FB", prevValueBlend = 0.7 }, { axisName = "UiAxis", direction = "LR", valueScalar = 2.0, prevValueBlend = 0.7 } }, }, NoseGrabBoard = { type = "emotion", emotionName = "em000bacioo00_idle", }, RightGrabBoard = { type = "emotion", emotionName = "em000bacioo00_idle", }, TailGrabBoard = { type = "emotion", emotionName = "em000bacioo00_idle", }, LeftGrabBoard = { type = "emotion", emotionName = "em000bacio00_idle", }, }, }, appKeys = { -- All hovercrafts have a type associated with their facts, saying what type of hovercraft this is. -- Default type is hoverboard, type 0. -- This is a hoverbike, type 1 - since it is a non-default we need to spell it out. hovercraftFactType = 1, -- levitation physics variables -- these variables affect hugging of ground + elevation of object levitationSpringCompressionConstant = 840.0, -- play with all of them my documentation may be incorrect. levitationSpringCompressionExponent = 0.8, levitationSpringExtensionConstant = 2000.0, levitationSpringExtensionExponent = 1.0, levitationSpringLength = 1.9, -- distance to ground or below ground. larger number hugs ground better, this may also help drop the whole thing down. levitationDamperConstant = 120.0, -- force for the above variable? play with both to tune ground hugging. rootVerticalStabilizerSpringExtensionConstant = 300.0, rootVerticalStabilizerSpringLength = 1.0, disableVerticalStabilizersWhenNotRidden = 0, -- avatar animation avAnimSpeedMax = 17.0, -- doesn't have to be same as maxVelocity avAnimSpeedInfluence = 0.7, -- if the influences don't sum to 1, their sum will be clamped. Allowed. avAnimLeanInfluence = 0.0, -- the effect of centripetal force on avatar's LR axis avAnimPitchDownInfluence = 1.3, -- the effect of pitching down the board on avatar's FB axis. avAnimLeanCentripetalFactorMax = 0.75, -- 1.0 means sideways; 0.0 means vertical avAnimPitchDownMax = 0.32, -- 1.0 means pitching straight down, 0.0 means horizontal avAnimForwardBackOffset = 0.0, -- added to forward/back factors to allow you to set the center -- drive physics maxVelocity = 24.0, maxAcceleration = 30.0, maxDeceleration = 20.0, lateralStaticFrictionForce = 100000.0, lateralDynamicFrictionForce = 0.3, conformToGround = 1, pendulumMass = 10.0, -- motion forces brakeRotationForce = -900.0, brakeRotationSpeed = 0.15, internalFrictionDamperConstant = 1000.0, inAirInternalFrictionDamperConstant = 1000.0, -- root offset rootHeightOffset = 1.0, -- sensitivity goalOriSensitivity = 1.0, goalOriHeadingLimit = 70, goalOriPitchLimit = 40, keySensitivity = 3.0, -- heading control headingStableKp = 100.0, headingStableKd = 100.0, headingUnstableKp = 7.0, headingUnstableKd = 100.0, headingAerialKp = 100.0, headingAerialKd = 100.0, -- camera section smoothFactor = 0.055, headingSpeedLimit = 14.0, pitchSpeedLimit = 1.0, inAirPitchSpeedLimit = 0.6, focusUpOffset = 1.85, -- nitro parameters nitroConsumptionRate = 0.05, -- range(0-1) how fast nitro is consumed. nitroRefillRate = 0.01, -- range(0-1) how fast nitro is re-filled. nitroVelocity = 35.0, -- in meters per second nitroAcceleration = 2000.0, -- in meters per second squared useNitro = 1, -- 1 enables nitro, 0 disables it nitroRotationForce = 2500.0, -- jump parameters jumpConsumptionRate = 0.8, -- range(0-1) how fast jump energy is consumed. jumpRefillRate = 0.04, -- range(0-1) how fast jump energy is regerated. maxJumpForce = 500.0, minJumpForce = 250.0, jumpAndTuckVelocity = 2.0, -- Mouse Rotation Parameters -- ************************************************************** -- mouseMomentMagnitude - scalar used to convert normalized mouse deltas -- into a trick moment magnitude. -- mouseMomentDecay - scalar used to decay the current trick moment axis( 0 - 1.0 ) -- mouseMomentMaximum - the maximum magnitude of the trick moment. -- mouseDeltaXMax, mouseDeltaYMax - we normalize the mouse deltas these values. -- mouseDeltaXExponent, mouseDeltaYExponent - mouse delta normalization curves. 1.0 is linear. mouseMomentMagnitude = 5000.0, mouseMomentDecay = 0.95, mouseMomentMaximum = 5000.0, mouseDeltaXMax = 400.0, mouseDeltaYMax = 700.0, mouseDeltaXExponent = 1.2, mouseDeltaYExponent = 1.2, -- height rigidity rigidHeight = 0.91, rigidHeightStiffness = 500.0, -- trick tuning variables trickModeTimeBufferAfterKeyRelease = 15, -- in steps trickModePitchBendOffset = 0.05, -- sound parameters masterSoundAmpScalar = 1.0, runningSoundRadius = 40.0, idleSoundRadius = 20.0, coolDownSoundScalar = 0.9, engineIdleSoundAmp = 0.085, engineIdleSoundPitch = -0.85, engineSoundPhaserOn = 1, engineSoundPhaserRandomPitchMin = 0.009, engineSoundPhaserRandomPitchMax = 0.012, engineSoundAmpMin = 0.05, engineSoundAmpMax = 0.25, engineSoundPitchMin = -0.75, engineSoundPitchMax = 0.1, engineSoundHPitchMin = -0.1, engineSoundHPitchMax = 0.3, pitchSoundAmpMin = 0.0, pitchSoundAmpMax = 0.65, pitchSoundPitchMin = -1.0, pitchSoundPitchMax = 1.0, yawSoundAmpMin = 0.0, yawSoundAmpMax = 0.5, yawSoundPitchMin = -0.35, yawSoundPitchMax = 0.35, whooshSoundAmpMin = 0.05, whooshSoundAmpMax = 0.4, whooshSoundHeadingDiffMin = 9.0, whooshSoundHeadingDiffMax = 50.0, whooshSoundMaxVel = 24.0, whooshSoundMinVel = 10.0, brakeSoundAmpMin = 0.04, brakeSoundAmpMax = 0.25, brakeSoundPitchMin = -1.0, brakeSoundPitchMax = 1.0, nitroSoundAmp = 0.55, startStopSoundAmp = 0.28, -- default In-Air emotion, used to be jump pose. inAirEmotionName = "HcJump", riderEmotionAttributeName = "UiAxis", readyEmotionAttributeName = "HcReady", -- default idle and crouching drag coefficients, air resistance along -- the x,y, and z axis of the hoverboard. idleDragCoefficients = { 0.1, 0.6, 0.09 }, crouchDragCoefficients = { 0.1, 0.6, 0.01 }, -- Kicking rider off -- 2 parameters affect kicking riders off. Note that kick off detection -- only occurs when the hovercraft has contact with the ground. Both -- of the following values are evaluated during surface contact only. -- -- 1. kickOffHcToSurfaceSensitivity - dotproduct between the surface -- normal and the hovercraft up vector. If the value is less then this -- sensitivity then detection is true. Value is -1 to 1, where -1 means -- the hovercraft has to be perfectly inverted with respect to the -- surface and 1 means at any orientation. -- -- 2. kickOffHcToGlobalUpSensitivity - dotProduct between the global -- up and the hovercraft up vector. If this value is less than the -- sensitivity then detection is true. Value is -1 to 1, where -1 means -- the hovercraft has to be perfectly inverted with respect to the global -- u pand 1 means any orientation. -- kickOffHcToSurfaceSensitivity = -0.7, kickOffHcToGlobalUpSensitivity = -0.4, trickDefs = { FrontsideGrab = { key = {"HbLeftKey"}, riderTriggerName = "HcJump", objectTriggerName = "LeftGrabBoard", leanInfluence = {5.0, 0.0, 0.0}, canLand = 1, forces = { { type = "HbRotate", direction = "HbYAxis", magnitude = -2200, }, }, }, BacksideGrab = { key = {"HbRightKey"}, riderTriggerName = "HcJump", objectTriggerName = "RightGrabBoard", leanInfluence = {-5.0, 0.0, 0.0}, dragCoefficients = { 0.1, 1.0, 0.01 }, canLand = 1, forces = { { type = "HbRotate", direction = "HbYAxis", magnitude = 2200, }, }, }, NoseGrab = { key = {"HbForwardKey"}, riderTriggerName = "HcJump", objectTriggerName = "NoseGrabBoard", leanInfluence = {0.0, 0.0, -10.0}, canLand = 1, forces = { { type = "HbRotate", direction = "HbXAxis", magnitude = 1800, }, }, }, TailGrab = { key = {"HbBackwardKey"}, riderTriggerName = "HcJump", objectTriggerName = "TailGrabBoard", leanInfluence = {0.0, 0.0, -5.0}, canLand = 1, forces = { { type = "HbRotate", direction = "HbXAxis", magnitude = -1800, }, }, }, Rocket = { key = {"HbForwardKey","HbBackwardKey"}, riderTriggerName = "HcJump", leanInfluence = {0.0, 0.0, -5.0}, canLand = 1, forces = { { type = "HbRotate", direction = "HbXAxis", magnitude = 100, }, { type = "HbTranslate", direction = "HbZAxis", magnitude = -150, }, }, }, RocketRoll = { key = {"HbLeftKey","HbRightKey"}, riderTriggerName = "HcJump", leanInfluence = {0.0, 0.0, -5.0}, canLand = 1, forces = { { type = "HbRotate", direction = "HbXAxis", magnitude = 500, }, { type = "HbRotate", direction = "HbZAxis", magnitude = 1300, }, { type = "HbTranslate", direction = "HbZAxis", magnitude = -50, }, }, }, }, tricks = { "NoseGrab", "BacksideGrab", "TailGrab", "FrontsideGrab", "Rocket", "RocketRoll", }, --*************************************************************** -- Effects -- Each effect has common properties and unique properties. -- The common properties are available to all effects. -- -- Common properties -- type: Flame, TerrainKickUp, SmokeTrail2 -- -- joint: A named joint obtained from the model skeleton. -- Note that this value overrides the offset if both -- are defined. -- -- offset: A specified point relative to the root of the animob. -- -- velSource: the particles velocity diphy ball reference. Use the -- diphy ball names defined in the diphy section. -- -- velSourceInfluence - a (0-1) ranged value that scales the -- velocity source. Setting this to zero effectively disables -- the velSource. Currently, this value only applies to flame -- effects. -- -- direction - emitter direction in local animob coordinates. -- The direction is specified as x,y,z. -- -- -- Unique properties -- -- for Flame, -- flameAngle -- particleStartWidth -- flameHeight -- flameSpeed -- ParticlePerFrame -- -- for TerrainKickUp, -- kickUpCone -- particlePerSecond -- speed -- -- for SmokeTrail2, -- puffInitialRadius -- puffRadiusRate -- color ( use rgb8Color( ) function ) -- density -- puffLifespan -- trailRandomSpeed -- puffTexture -- streakTexture --*************************************************************** fxDefs = { trickFx = { type = "Flame", flameAngle = 0.0, particleStartWidth = 0.06, flameHeight = 0.4, flameSpeed = 0.3, particlePerFrame = 1.0, joint = "Exhaust00", direction = { 0, 1, 0 }, velSource = "root", }, dirtKick = { type = "TerrainKickUp", kickUpCone = 80.0, particlePerSecond = 100.0, speed = 0.2, offset = { 0, -.18, -1.5 }, velSource = "root", }, thrustSmokeLeft = { type = "Flame", joint = "Exhaust00", flameAngle = 20.0, particleStartWidth = 0.10, flameHeight = .2, flameSpeed = 2.0, particlePerFrame = 3.5, direction = { 0.0, 0.25, 1.0 }, velSource = "root", velSourceInfluence = 0.95, flameTexture = "fx/t0000fx2_hpxawstred.png", }, brakeSmokeFront = { type = "Flame", joint = "Exhaust01", flameAngle = 20.0, particleStartWidth = 0.10, flameHeight = .3, flameSpeed = 1.0, particlePerFrame = 1.0, direction = { 0, -.1, -.9 }, velSource = "root", velSourceInfluence = 0.95, flameTexture = "fx/t0000fx8_hbkairbrake.png", }, nitroSmokeLeft = { type = "SmokeTrail2", joint = "Exhaust00", puffInitialRadius = 0.10, puffRadiusGrowthRate = -0.6, color = rgb8Color( 255, 71, 27 ), density = 1.2, puffLifespan = 0.3, trailRandomSeed = 1.0, direction = { 0, -0, 1 }, puffTexture = "fx/smokeTrailPuff1.png", streakTexture = "fx/smokeTrailStreak1.png", }, }, -- *************************************************************** -- Effects Controls -- -- input: HbNitro, HbThrust, HbDirtKick, HbEngine -- -- each input can have a set of effect outputs -- -- fx: named effect defined in fxDefs. -- -- onOff: two state channel. subscribing to this channel -- means the entire effect will be either on or off. -- Eventually, we will stream continuous data to the -- effect. -- *************************************************************** fxCtrls = { nitro = { input = "HbNitro", output = { { fx = "nitroSmokeLeft", onOff = 1, }, { fx = "nitroSmokeRight", onOff = 0, }, }, }, engine = { input = "HbThrust", output = { { fx = "thrustSmokeLeft", onOff = 1, }, { fx = "thrustSmokeRight", onOff = 0, }, }, }, brake = { input = "HbBrakeThrust", output = { { fx = "brakeSmokeLeft", onOff = 1, }, { fx = "brakeSmokeRight", onOff = 1, }, }, }, kick = { input = "HbDirtKick", output = { { fx = "dirtKick", onOff = 0, }, }, }, }, }, balls = { root = { joint = "m000hbk_sportbike", radius = 0.5, mass = 40.0, restitution = 0.01, staticFriction = 0.1, dynamicFriction = 0.05, nearbyCollisionRadius = 1.7, collisionRadius = 1.35, airFriction = 0.05, waterFriction = 0.8, density = 1.06, volumeInWaterScaleFactor = 1.0, }, rearBall = { joint = "rearBall", offset = {0.0, 0.0, 0.0}, radius = 0.9, mass = 60.0, restitution = 0.01, staticFriction = 0.001, dynamicFriction = 0.05, nearbyCollisionRadius = 2.7, airFriction = 0.05, density = 0.87, waterFriction = 4.0, volumeInWaterScaleFactor = 1.0, }, frontBall = { joint = "frontBall", offset = {0.0, 0.0, 0.0}, radius = 0.9, mass = 50.0, restitution = 0.01, staticFriction = 0.001, dynamicFriction = 0.05, nearbyCollisionRadius = 2.7, airFriction = 0.05, density = 0.87, waterFriction = 4.0, volumeInWaterScaleFactor = 1.0, }, }, springs = { { ball1 = "root", ball2 = "rearBall", idealLength = 1.488, contractionForce = 9000.0, expansionForce = 9000.0, dampingCoefficient = 50.0, }, { ball1 = "root", ball2 = "frontBall", idealLength = 1.473, contractionForce = 9000.0, expansionForce = 9000.0, dampingCoefficient = 50.0, }, { ball1 = "frontBall", ball2 = "rearBall", idealLength = 2.093, contractionForce = 6000.0, expansionForce = 6000.0, dampingCoefficient = 50.0, }, }, seats = { driver = { joint = "driver", offset = {0.0, 0.055, 0.01}, getOnTitle = "Hop On", getOffTitle = "Hop Off", teleblurDuration = 0, driver = 1, autoKickOff = 1, getOnActionModeChange = AnimobActionModeChangeNone, cameras = { driver = { upDistance = 0.65, backDistance = 7.2, focusPullTightness = 1.0, pitchFocusTightness = 1.0, userControlledPitchFocus = 0, positionPullTightness = 0.32, fovTightness = 0.9, tightnessTightness = 1.0, desiredFov = 60.0, desiredOrthographicWidth = 2.0, minNearDistance = 0.5, subjectNonclipRadius = 1.0, automaticTeleportDistance = 100.0, desiredProjectionType = AnimobCameraProjectionTypePerspective, cameraMode = AnimobCameraModeVehicle, visibilityEnsurerMode = AnimobVisibilityEnsurerModeTightenToFocus, pitchThreshold = 7.0, pitchMax = 20.0, pitchSlope = 2.0, pitchSensitivity = 1.5, upThreshold = 0.2, upMax = 1.0, upSlope = 1.0, upSensitivity = 1.5, }, }, animationTriggers = { default = { type = "emotion", emotionName = "em000bacio01_riding", -- rider emotion for avatar, name must be the same for both. axes = { { axisName = "UiAxis", direction = "FB", prevValueBlend = 0.7 }, { axisName = "UiAxis", direction = "LR", valueScalar = 2.0, prevValueBlend = 0.7 }, }, }, HcJump = { name = "HcJump", type = "emotion", emotionName = "em000bacio02_fall", -- rider fall emotion. }, HcReady = { name = "HcReady", type = "emotion", emotionName = "em000bacio01_riding", }, }, getOn = { -- Optional get on animation section userAnim = "a000bacio00_neutral", objectAnim = "a000bacioo00_neutral" -- optional }, getOff = { userAnim = "a000bacio00_neutral", objectAnim = "a000bacioo00_neutral" }, }, }, Sounds3d = { nitro = { soundName = "hoverbike_nitro", ballSource = "rearBall", }, engine = { soundName = "hoverbike_engine", looping = 1, ballSource = "frontBall", }, -- same asset, different pitch (set in the code) enginePhaser = { soundName = "hoverbike_engine", looping = 1, ballSource = "frontBall", }, engineStartUp = { soundName = "hoverbike_start_up", ballSource = "frontBall", }, engineShutDown = { soundName = "hoverbike_shut_down", ballSource = "frontBall", }, pitch = { soundName = "hoverbike_pitch", looping = 1, ballSource = "frontBall", }, yaw = { soundName = "hoverbike_yaw", looping = 1, ballSource = "frontBall", }, whooshPos = { soundName = "hoverbike_whoosh_pos", ballSource = "frontBall", }, whooshNeg = { soundName = "hoverbike_whoosh_neg", ballSource = "frontBall", }, brake = { soundName = "hoverbike_brake", looping = 1, ballSource = "frontBall", }, }, carriable = { icon = "ico_hoverbike01.png", }, })