Scripts / Chained character animations

Author
Message
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 13th Apr 2017 23:13
I'd like to chain a series of character animations together into a sequence, playing one after another, perhaps loop one in the middle a couple of times, all while a dialogue track is playing. So far, all I've been able to do is successfully get one animation to loop or play once. Whenever I try to add my own condition like "keyframe [e] =", that doesn't work. I've tried using the "g_Entity[e]['animating'] == 0" flag to detect when the character finishes an animation but that appears to be broken. I've had some success with "g_Entity[e]['frame'] = " but only in so far as I got a prompt to work, I can't seem to call more animation frames. However, I'd rather not use "g_Entity[e]['frame'] = " as a condition as I know it won't work if I chose to loop some of these animations.

Here's what I got so far, but it's a bit messy because I've tried so many different variations.



This will call the animation once and then the prompt, but not the second animation.

AE
Gtox
3D Media Maker
10
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 14th Apr 2017 06:20 Edited at: 14th Apr 2017 07:39
Try this


edit : the animation frames in the script are for the model I used for testing - just replace them with your own.
i5 2500k 3GB GTX1060 8GB RAM Windows 10
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 14th Apr 2017 19:16
Thanks, Gtox! I tried to use your script as the basis for my own one that would call animations based on keyframes but it wasn't working so I gave up and have used yours to great effect...even if it's taken me all day to manually edit in all the right animations and speeds (my version now calls a sequence of 31 anims ). The biggest problem was calling the sound file at the right point, but I finally figured it out.

The next problem is to do with camera overrides. I want to freeze the player, drop their height a bit, tilt and roll the camera a bit to simulate the player lying on the floor/having been knocked out, and trigger a fade in. I've got as far as teleporting the player to an object that sits inside a small zone, and that zone runs this script:


Adding TriggerFadeIn seems to result in a black screen but I guess that's because the player is frozen in the zone so it's always true and therefore never starts or finishes the fade. I see there are camera override commands but they are giving me...interested results. Has anybody got any experience in using these commands, how do they work?

AE
Gtox
3D Media Maker
10
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 14th Apr 2017 20:04
31 animations? That must have been fun. Can't help with camera overrides, sorry.
i5 2500k 3GB GTX1060 8GB RAM Windows 10
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th Apr 2017 10:29
Use
SetFreezeAngle(x,y,z)
SetFreezePosition(x,y,z)
TransportToFreezePosition()
To simulate the getting up part.... Its going to be a bit of fun getting it right I'm sure but there's not really an easy way.

Position works based on position in the map (y is up or down).
Angle works in the view cone so y is left of right and x is up or down but they aren't 0-360.
Best way is to prompt them onscreen (using g_PlayerAngY etc) while you act out the scene and write down any key numbers
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 15th Apr 2017 17:36 Edited at: 15th Apr 2017 17:36
A little experimentation later and everything is working as it should - thanks for all your help!



AE

Login to post a reply

Server time is: 2024-12-23 04:42:29
Your offset time is: 2024-12-23 04:42:29