2 registered members (TipmyPip, 1 invisible),
18,758
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Animation FPS speed
[Re: tompo]
#125936
04/25/07 04:55
04/25/07 04:55
|
Joined: Jul 2006
Posts: 91 Florida, USA
Knuckles
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2006
Posts: 91
Florida, USA
|
Actually, I found out that it uses vertex animation. thanks for directing me! The code is very easy to implement and I was able to edit it a bit to make it more fluent! However it still did a blur animation when it stopped, and I think I found out what was causing it. It's this line of code: Code:
trace_mode=IGNORE_ME+IGNORE_MODELS+ignore_passable+ USE_BOX;
When I commented it out, it didn't do the blur animation and actually worked right, however the model is halfway through the floor, so I need to figure out why the collision detection makes the animation all crazy, or what about the collision detection is connected with the animation schema of the code??
|
|
|
Re: Animation FPS speed
[Re: Knuckles]
#125937
04/25/07 10:27
04/25/07 10:27
|
Joined: Mar 2007
Posts: 776 Poor village - Poland ;)
tompo
User
|
User
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
|
1. blur animation when stopped?!?! what you mean?!?! 2. this code you've wrote is a "how to see" setting from me to target (floor under my feet, wall fron of me... etc). If you cut this out (don't do this) your colision detection doesn't work and it is your answer why model is halfway the floor I see that you are really Newbie... so best way to learn will be reading help, function by function you can see in click & go script or enother simple wdl with moving, tracing, targeting, animating... etc.  Even the longest way starts with first step - old China's proverb.
Last edited by tompo; 04/25/07 10:36.
Never say never.
|
|
|
Re: Animation FPS speed
[Re: Knuckles]
#125941
04/26/07 00:27
04/26/07 00:27
|
Joined: Jul 2000
Posts: 8,973 Bay Area
Doug
Senior Expert
|
Senior Expert
Joined: Jul 2000
Posts: 8,973
Bay Area
|
Quote:
I don't understand how the animate_walk function is an endless loop since it has a wait(1) at the end? Usually if I leave out the wait(1) I get a message saying that it's an endless loop.
Do I need to add a return function after the wait(1)?
It's an endless loop because it never exits. It's just a "polite" endless loop, it only runs once per frame. 
This is what I think you are doing:
Code:
function animate_walk() { while(1) ///< this never exits { ... do stuff wait(1); ///< this waits one frame, then it starts over } }
action my_cool_guy() { ... stuff while(1) ///< this also never exits { ... do stuff animate_walk(); ///< call a new animate_walk function wait(1); } }
In the first frame: 1) my_cool_guy runs until it calls animate_walk(). 2) animate_walk runs until it gets to the wait(1) when it returns control to the my_cool_guy action. 3) my_cool_guy continues running until it reaches its wait(1).
BUT (and this is key to understanding lite-c) wait(1) only stops the function it is in for one frame.
In the next frame: 1) The animate_walk function created in the first frame continues running its loop until it reaches its wait(1) again. 2) Then my_cool_guy runs until it calls animate_walk() again, which will create a second instance of that function (with its own loop). 3) The second animate_walk() runs until it reaches wait(1)...
This might not make sense right away so, if you want the short answer, remove the "while(1)...wait(1)" loop from animate_walk() if you are calling it once per frame.
|
|
|
Re: Animation FPS speed
[Re: tompo]
#125944
05/01/07 04:33
05/01/07 04:33
|
Joined: Jul 2006
Posts: 91 Florida, USA
Knuckles
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2006
Posts: 91
Florida, USA
|
ok here's what I was talking about (because the problem is still there, and I thought it got fixed). I hope the video helps: http://www.youtube.com/watch?v=nmIdHZKmveQ(thank you Tompo for telling me how to upload it!  )
Last edited by Knuckles; 05/01/07 04:34.
|
|
|
|