Scripts / Help with animation script please.

Author
Message
Emrys
10
Years of Service
User Offline
Joined: 4th Nov 2013
Location: UK
Posted: 28th Mar 2015 14:33
I'm trying to run different animation one after an other and maybe each animation would last for 20 seconds. I have all the animations set up in the fpe and all work when I call them separately. I've been playing with this script for ages and getting nowhere fast.

Any help would be gratefully received.



PC - Windows 7 64bit, Intel i5, 12Gb Ram, 1TB WD Black, Evga Gefore 760gtx 2GB

Laptop - Windows 8.1 64 Bit, Core i7-3632QM processor, 8GB of RAM, 1Tb Hdd, Nvidia Geforce GT 740m
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 28th Mar 2015 14:43
Hello E30Legend, Would it be possible to show us your animation section from the FPE file for this?

It will assist in helping to determine how your script is set up and what animation calls are there.

I think that some kind of stop animation command might be needed. Another thing is that everything must be in between the If and end statements. Not a LUA wiz by any means, but that just stands out to me the most.

the second animation section, may not call, because the animation state of the first section is still 1, and has not been reset.

I modified a door script, as it had multiple animations in it as an example for a different model I was working on. Maybe compare the way that one works, with what you are trying to do. might yield better results for you, till one of the scripting wiz's can look at this.

Thank you.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

Emrys
10
Years of Service
User Offline
Joined: 4th Nov 2013
Location: UK
Posted: 28th Mar 2015 15:31
Hi Myke, thanks for the quick reply, do you ever sleep, lol?

FPE ani section


Quote: "the second animation section, may not call, because the animation state of the first section is still 1, and has not been reset."


Yeah I changed this part to 1 as it's already animating but I was still lost what to do after that. I've tried StopAnimation, taking the loop away, destroy but that doesn't work either, well it would if I knew what I was doing lol.


Got a link to your door script?

Cheers


PC - Windows 7 64bit, Intel i5, 12Gb Ram, 1TB WD Black, Evga Gefore 760gtx 2GB

Laptop - Windows 8.1 64 Bit, Core i7-3632QM processor, 8GB of RAM, 1Tb Hdd, Nvidia Geforce GT 740m
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 28th Mar 2015 16:56
It is the door.lua script in the scriptbank folder, I was referring to.

Yes I get sleep enough, I will catch up on that when I am dead. lol.

Yes I mottle my way thru them right now also.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 28th Mar 2015 17:21 Edited at: 28th Mar 2015 17:29
E30Legend - this may give you a staring point...



Hope this helps someone...
PM
Emrys
10
Years of Service
User Offline
Joined: 4th Nov 2013
Location: UK
Posted: 28th Mar 2015 18:42 Edited at: 28th Mar 2015 18:43
It does help someone, me ! Even better with the code expaination as well.

Many thanks for the help J_C and Myke


PC - Windows 7 64bit, Intel i5, 12Gb Ram, 1TB WD Black, Evga Gefore 760gtx 2GB

Laptop - Windows 8.1 64 Bit, Core i7-3632QM processor, 8GB of RAM, 1Tb Hdd, Nvidia Geforce GT 740m
PM
Emrys
10
Years of Service
User Offline
Joined: 4th Nov 2013
Location: UK
Posted: 28th Mar 2015 19:30 Edited at: 28th Mar 2015 19:31
The script works a treat J_C

Could I do this if I wanted to assign movement when a certain animation is called?



PC - Windows 7 64bit, Intel i5, 12Gb Ram, 1TB WD Black, Evga Gefore 760gtx 2GB

Laptop - Windows 8.1 64 Bit, Core i7-3632QM processor, 8GB of RAM, 1Tb Hdd, Nvidia Geforce GT 740m
PM
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 29th Mar 2015 13:02 Edited at: 29th Mar 2015 13:54
Ignore this I was rushing to get my dinner... see my next post ( she who must be obeyed - called )

Yes that should work....(but even I am not 100% sure until I try it)
but you must ask yourself the question do you want it to move Once at this animation (number)
or if you want it to move continually for the 20 second period...
This is the fun of code... the same as your models... do I put the tower at the end or in the middle...
There is really only one way to know... lets try it and see what it looks like.. what happens..
Just little changes at a time.. that's how we learn..

oh.. and don't forget to rem your code..
( think of it like a good texture on your model )
it can only help you and others and me.
PM
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 29th Mar 2015 14:14
My answer should have been no... sorry for my word blindness...
some times I read what's in my head .. not what's on the page..

You only need to test ( if anim[e] == 2 then )

Here is my version if you want to check..



The model moves towards me then tells me I am too close.. so have to move back...

You can also attach this to the soldier model and change the st_anim and max_anim values
to see what each animation does.. that's what I am using to test this code..
PM
Emrys
10
Years of Service
User Offline
Joined: 4th Nov 2013
Location: UK
Posted: 30th Mar 2015 12:49
Quote: " ( she who must be obeyed - called )"


lol, I have the same problem, they always have other things for you to do !

The version above is exactly what I was looking for. Many thanks for helping me out with this, I'm going to try and see if I can tweak it a bit more, now I getting more of an idea how this black magic (sorry I meant Lua) works

If you ever need help with modeling, give me a shout.





PC - Windows 7 64bit, Intel i5, 12Gb Ram, 1TB WD Black, Evga Gefore 760gtx 2GB

Laptop - Windows 8.1 64 Bit, Core i7-3632QM processor, 8GB of RAM, 1Tb Hdd, Nvidia Geforce GT 740m
PM
GoDevils
9
Years of Service
User Offline
Joined: 24th Sep 2014
Location: Arizona USA
Posted: 30th Mar 2015 19:43
@ E30Legend

I had a devil of time getting a series of animations to run. I was trying to make a character walk to a point, stop and wait for a specific time, then move forward again. However, switching from one animation to another did not work as intended.

What I ultimately found (with the help of smallg) that when I set the specific animation frames (as below) everything worked as I intended. Maybe something to try.

StopAnimation(e)
SetAnimationFrames(3000,3100)
LoopAnimation(e)
MoveForward(e,44)

Good Luck
"THERE IS NO SPOON"

AMD 6300 6 core 3.5 ghz, Windows 8.1, 8GB ram, GTX 650 2GB ram

Login to post a reply

Server time is: 2024-05-23 22:48:18
Your offset time is: 2024-05-23 22:48:18