Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / animation script problem

Author
Message
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 2nd Feb 2011 17:08 Edited at: 2nd Feb 2011 18:36
***This is not a problem with EAI's TF341 pack - it's only about scripting***
I am trying to script one of EAI's characters with sitting animations. Basically the character is sitting, stands up, stands idle, sits down again.

I had 2 approches to script this which both don't work

This one gets the character stuck in state 51, repeating animation 137 endlessly


This one doesn't play the animations to their full length, instead one is "jumping" into the other:


Any help is appreciated

In case you find my grammar and spelling weird ---> native German speaker ^^
gendestroier
14
Years of Service
User Offline
Joined: 5th Jun 2010
Location: Brazil
Posted: 2nd Feb 2011 17:34 Edited at: 2nd Feb 2011 17:35
Quote: ":state=0:'',''state=1"


wops what's that here ?

get it of.

shoudn't you have a framestart before a frameatend ?




about the second one, you gotta have a inerval betwen the animations, otherwise they'll just jump animations or execute them imediately(non visible effect)

mods for creating a inteligent game,at least
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 2nd Feb 2011 18:35
Quote: "Quote: ":state=0:'',''state=1""
That was just a copying error

I'll try your script, thanks!

In case you find my grammar and spelling weird ---> native German speaker ^^
gendestroier
14
Years of Service
User Offline
Joined: 5th Jun 2010
Location: Brazil
Posted: 2nd Feb 2011 18:49
ok i'm glad i can help

mods for creating a inteligent game,at least
Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 2nd Feb 2011 18:51
You probably want to use setframe,incframe and frameatend calls for transition animations. They seem to play a bit faster than animate but they are less error prone because if the user FPS drops the timer system allows frames of animation to be skipped and that can cause your animation to loop again.
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 2nd Feb 2011 19:17 Edited at: 2nd Feb 2011 19:20
@ErrantAI, you saved my day

This script works like a charm

I never thought of using INCFRAME since the description in the CommunityGuide says "INCFRAME Increment another frame in animation X" which gave me the impression that this Action only moves the animation a single frame forward. Never thought that it plays the whole animation smoothly.

Guys, you can expect a big bunch of cool scripts over the next few weeks

In case you find my grammar and spelling weird ---> native German speaker ^^
Errant AI
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 2nd Feb 2011 19:29 Edited at: 2nd Feb 2011 19:33
Quote: " which gave me the impression that this Action only moves the animation a single frame forward"


It does... but it does that each time the script is looped through the FPI system (which is every couple milliseconds or something like that). And so it increments every pass (like a flip-book animation) until the condition for it to do that are no longer true or it reaches the end and theres nothing more to increment.

Quote: "Guys, you can expect a big bunch of cool scripts over the next few weeks"


Awesome

edit- I'm actually sort of supprised that doesnt reset the animation every time. I'll have to try that structure because usually I do it like:

gendestroier
14
Years of Service
User Offline
Joined: 5th Jun 2010
Location: Brazil
Posted: 2nd Feb 2011 20:34
owww the incframe !! yeahh i forgot one command, doh!


hummm... nice!

i better get back to my scripting studies i shoudn't have missed that, it wasn't so hard !

i think i'm a little bit out of pratice.

mods for creating a inteligent game,at least

Login to post a reply

Server time is: 2024-11-24 12:27:23
Your offset time is: 2024-11-24 12:27:23