May 23, 2012, 02:44:36 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Run animaton  (Read 862 times)
mrbdrm
Newbie
*
Posts: 22


View Profile
« on: September 16, 2009, 11:38:33 PM »

Hi
i have a problem in adding a run animation to my char , i can't get it in the simple character script .
i used it on my char , he have walk and run animation .
another question : i dont understand MotionSelectMin & MotionSelectMax , could someone explain them ?
thank you in advance
Logged
mrbdrm
Newbie
*
Posts: 22


View Profile
« Reply #1 on: September 18, 2009, 11:00:23 AM »

i guess no one know  Sad
guy's im stuck here & i tryed playing with them that didn't help to.
Logged
Ransom
Full Member
***
Posts: 132



View Profile
« Reply #2 on: September 18, 2009, 04:25:19 PM »

Can you post your script?  There would be a lot to cover for someone to tell you how to do this from scratch.
Logged
mrbdrm
Newbie
*
Posts: 22


View Profile
« Reply #3 on: September 18, 2009, 09:44:48 PM »

thank you for the replay
well im using the same script simplecharacter.opr
i only change it to fit my char (the model to load and the animation's range).
explain this to me :
Code:
AddMotion WalkMotion
MotionAnim Walk
MotionSelectVar Velocity
MotionFadeInTime 0.1
MotionChannel 0
what i under stand is this is the walk animation
but down i see
Code:
AddMotion Move
MotionChild IdleMotion
MotionChild WalkMotion
MotionChannel 0
so this is the moving motion then ? how does the engine know whitch to plend in the animation for example if i have a walking animation i want only the lower body to play and another one for  the uperbody , how do i do that ?

i have more question's but later  Smiley
« Last Edit: September 18, 2009, 10:09:52 PM by mrbdrm » Logged
mrbdrm
Newbie
*
Posts: 22


View Profile
« Reply #4 on: September 22, 2009, 02:10:41 PM »

engine creator
some help please
your "lego" doesn't help at all
Logged
gekido
Guest
« Reply #5 on: September 22, 2009, 02:38:01 PM »

I'm working on a big 'all things animation & character setup' document / tutorial & example characters, but here's a bit of extra info:

MotionSelectMin & MotionSelectMax are how you tell the engine which animation to play when the character is moving.

Basically you can define animation variables in your OPR file that the script can then modify at runtime.

You'll see a line like so with each of the idle, walk, run motion definitions:

MotionSelectVar Velocity

What this does is says that this animation will be affected by the select parameters that are specified, which are basically min & max values for the variable.

So if you do something like this:

Quote
AddMotion IdleMotion
MotionAnim Idle
MotionSelectVar Velocity
MotionSelectMax 0.2

what this means is that the motion called 'IdleMotion' will play the actual animation (either defined by LoadAnimation or AnimRange defines).  Idle will be selected if the variable Velocity is below 0.2.

Then if you add the walk & run motions:

Quote
AddMotion WalkMotion
MotionAnim Walk
MotionScalarVar Velocity
MotionSelectVar Velocity
MotionSelectMin 0.2
MotionSelectMax 3.15

AddMotion RunMotion
MotionAnim Run
MotionScalarVar Velocity
MotionSelectVar Velocity
MotionSelectMin 3.15

You will see that the Walk motion has both SelectMin & SelectMax values - so basically if Velocity is greater than 0.2, but less than 3.15, the walk motion will be played.  If it's less than 0.2, then Idle will be played, and if it's greater than 3.15, then the Run will be played.

In this way you can setup the motion definitions in your character and the game will automatically switch between idle, walk, run based on the value of the Velocity variable.

----------

Finally, you will also see that the Walk & Run motions have a MotionScalarVar as well - what this means is that the motion will be scaled (played back at different speeds) based on the value of the Velocity variable.  By adjusting the Velocity, you can do things like Splinter Cell style 'creeping' or more sophisticated movement speed controls and the engine will automatically scale the animation (and pick the proper animation) automatically.

Finally the Move motion, which is pretty simple:

Quote
AddMotion Move
MotionChild IdleMotion
MotionChild WalkMotion
MotionChild RunMotion

Is what combines all of these motions into a single 'bundle' that can be played from the engine.

In the script, you call 'object.PlayAnim("Move");' and the game will automatically update the character's animations and how fast they are being played simply by updating the motion variable Velocity.

Adding the second layer of upper body animations is a bit more complex and will be covered in the full doc (which is coming soon).

Hope this helps clarify a bit of how the system works.

Logged
mrbdrm
Newbie
*
Posts: 22


View Profile
« Reply #6 on: September 23, 2009, 06:44:57 AM »

thank you very mutch  Grin
that indeed help me alot
one question tho : what is Velocity i mean is it defined in the engine or we set it up or it's automaticly setup ?
so i sould leave my character impoting to later, tell the doc is finished then .
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #7 on: September 23, 2009, 06:53:46 AM »

The character has a character.gsl attached to it. There the velocity is defined:

// constants
float walkSpeed = 3f;
float runSpeed = 10.0f;
float turnSpeed = 1.0f;
float targetOffset = 1.5f;
Logged
gekido
Guest
« Reply #8 on: October 13, 2009, 02:33:45 PM »

The velocities that are specified in the player script are only the default values that are used if you don't have corresponding ControllerSetting's for them in the character's OPR file.
Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!