Questions, Questions, Questions

Added by Adrian Shepherd almost 4 years ago

We have been receiving a lot of questions via email. We like receiving emails from our community and having questions is great, but everyone can benefit from questions posted in our forums.
So I'm going to kick this forum into gear by posting a question that we received from a user and answer that here.

Q: I'm very new at scripting and have just started to pick it up. Would like some information/ resources/ examples on how to animate objects placed in the scene in the vastpark creator. I've been studying the imml code for the startpark but it doesn't give me more details as to how the bipbot animates... Do I rig the animation in 3D Max? If so, how do I map keyboard keys/ mouse movements to my animated assets?

A: The first thing to look at here is animation. Any animated characters need to rigged and animated in an external 3D application like 3DS Max or Maya. Currently we only support.X animated files and all animation needs to be done on the one timeline and then exported to .X.

The next step is publishing the animated character. The first stage is where you put in model information, the second author information, and then you will get to a third stage. Here is where you need to name the animation ranges.

To match up with the current avatar controller in the creator you need to name your ranges as follows.

walkforward
walkbackward
walkright
walkleft
runforward
runbackward
runleft
runright
jump
idle

Then once in the creator you need to make a script by going up to insert > inline script.
Inside the script paste the following:

function main(obj, args)
a = avatarcontroller()
a.entity = scene:getcontent('name of character here')
a.enabled = true

cc = chasecontroller(scene:getcontent('name of character here'))
cc.lookatoffset = vector3(0, 2, 0)
cc.entity = scene.usercamera
cc.enabled = true
end

The look at offset may need to be changed depending on how big you plan to make your character.
Units in VastPark are measured in metres.

Then all you need to do is assign a trigger to the character applying the script you just made. Loaded is generally a good one as it will occur as soon as the park has loaded. Hit the interactive preview button to check it out in the creator.

If you have any further questions related to animation post them here.