Product Chat / How to control third-person player animations?

Author
Message
World Class Multimedia
16
Years of Service
User Offline
Joined: 15th Aug 2008
Playing: Game Development
Posted: 30th May 2017 18:11
I have custom characters with custom animations - all exported from FBX2GG as a directx file.

When I plop a custom character on the player marker, it works, but the feet don't move. The animation for walking is 1,31.

So, which script controls this? I looked at the gameloop and gameplayercontrol and just could not find where I would adjust this.

Someone is helping me and he created a lua script for these characters and when I set that to the characters outside the player, the
walk animation works just fine (very creepy having a bunch of characters follow me everywhere - lol - like lemmings - reminds me of a new game idea).

Anyway, any help on how to get the custom walk animation frames working for the player would be great!

There will be around 9 to 12 animations eventually.

Thank you.

Mike
YOU DREAM IT - WE CREATE IT!

www.world-class-multimedia.com

For world-class virtual instruments - www.supersynths.com
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 30th May 2017 19:55 Edited at: 31st May 2017 00:26
Hi World Class Multimedia, if you look at the fpe file in the link below it show you how to setup animations.

https://forum.game-guru.com/thread/218085#msg2579443

;anim
animmax = 6 ; change to include the max animations you are using remembering it starts at 0
playanimineditor = 1
anim0 = 100,205 ;idle
anim1 = 685,707 ;move
anim2 = 5511,5553 ;kick
anim3 = 4812,4850 ;hurt
anim4 = 515,605 ;reload
anim5 = *,* ;Your extra animations, etc.

anim* = *,* ;For extra animations change anim* to the next animation number. Then change *,* to your key-frames, etc.

Just add your animations like in the above fpe file area.

If your using custom script for these animations you would call the animations as needed. Look at the example at line 419 in the module_combatcore.lua located here:

Steam\steamapps\common\Game Guru\Files\scriptbank\ai\

This is the command to move your character MoveWithAnimation(e,1)
In a custom script this would be MoveWithAnimation(e,*) ; you would change the star for the animation needed in this case it would be 1. You also have GetAnimationFrame(e), GetEntityAnimationStart(e,*), GetEntityAnimationFinish(e,*), etc. Just look through the above module_combatcore.lua file. Also your global.lua file for extra commands located here :

Steam\steamapps\common\Game Guru\Files\scriptbank\

I hope this help a little.

gd - Ed.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3
PM
World Class Multimedia
16
Years of Service
User Offline
Joined: 15th Aug 2008
Playing: Game Development
Posted: 30th May 2017 21:46
But how do you do this for the PLAYER (3rd person character attached to the Player object)?

I have this working for other characters other than the main Player.

I need the 3rd person player character's (which you can see all the time) feet moving (namely: walk, run, jump, swim, etc animation working).

How do I do this?

Mike
YOU DREAM IT - WE CREATE IT!

www.world-class-multimedia.com

For world-class virtual instruments - www.supersynths.com
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 30th May 2017 22:13 Edited at: 30th May 2017 22:15
exactly how he just told you

you have to set the animation frames in the ;anim section, they should then automatically translate to the third person set up when you place the character on the start marker.

If you want to zip up your character and its files and put it on dropbox or something, then message me a link, i'll take a look for you.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
World Class Multimedia
16
Years of Service
User Offline
Joined: 15th Aug 2008
Playing: Game Development
Posted: 30th May 2017 22:19
I had to reboot GG and then it worked - kind of. The legs move, but then he floats for a bit and then the walk animation starts over.

It's 31 frames long and seems to be set correct in the .fpe. Not sure why it's not working 100%.

The other characters work 100%.

Mike
YOU DREAM IT - WE CREATE IT!

www.world-class-multimedia.com

For world-class virtual instruments - www.supersynths.com
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 30th May 2017 22:54
For third person control the animations are tagged from the 'csi' references in the fpe.

They are then executed using the runcharloop function after being set within the gameplayercontrol.lua.

It's not immediately obvious which animation indexes relate to which animations or to which csi reference without a bit of trial and error.

I've just started looking at this for custom TPV and swimming.

Overriding the runcharloop even by preventing it running and playing animations the usual way doesn't seem possible but repointing the existing indexed animation references to new existing csi references does.

Might not make a lot of sense until you or your helper checks the player control lua.

I'm not at dev machine to be able to state explicitly but start off by placing your appropriate animation ranges in the csi references relating to walk, run, vault. There are also fpe overrides for jump - how long to hold 'air' frames etc.

For control of animations not currently used, expect a fair bit of scripting and testing work. If your goal is to have game come out of AGK after using GG to create environments is it worth it?

Also - MoveWithAnimation is a special command for 'spine tracked' characters that have motion away from entity origin (not for animations that run on the spot).

Cheers.
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 30th May 2017 23:23
Quote: "For third person control the animations are tagged from the 'csi' references in the fpe."


Are you sure? I thought it was the opposite, normal AI was CSI and TP was anim0 etc, then when Lee updated the AI he made it all done via the anim0 etc.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
World Class Multimedia
16
Years of Service
User Offline
Joined: 15th Aug 2008
Playing: Game Development
Posted: 30th May 2017 23:58 Edited at: 30th May 2017 23:59
I apologize cyber, but it does not make sense to me at all. LOL.

Anyone care to confirm and then translate it into something I can understand?

Mike
YOU DREAM IT - WE CREATE IT!

www.world-class-multimedia.com

For world-class virtual instruments - www.supersynths.com
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 31st May 2017 01:08
Belidos: fairly sure, but early days for me with the new gameplayercontrol.lua

WCM: try this in fpe (with x,y being start and end animation range) :

;anim
animmax = 1
playanimineditor = 1
anim0 = x,y ;idle (editor)

csi_stoodmovefore = x,y ;walk animation (TPV)
csi_stoodmoverun = x,y ;run animation (TPV)
csi_stoodvault = x,y ;jump animation (TPV)

There still must be some default hard coding of animation ranges as a back stop (stock character animation ranges), because if you remove these csi references from fpe then animations still play, but if you include them they override the defaults.

If you want to add many more Third Person animations (special moves, swimming, spell attacks etc), it seems possible now that player control has been opened up by Lee but I think it will take a fair bit of scripting and testing effort and re-purposing of existing csi ranges that are indexed for character control within gameplayercontrol.lua. It seems on first look a maximum of 15 ranges can be used.

If anyone else has further insight it would be great to hear as I'm moving further into this area this week . For instance I can see no way to switch TPV to FPV - well actually it can be done to a point but the weapon control system seems stubbornly set to third person - appears to be no lua control to set this even though it can be read.

Cheers.


World Class Multimedia
16
Years of Service
User Offline
Joined: 15th Aug 2008
Playing: Game Development
Posted: 31st May 2017 01:26
Got it working, so now I understand.

Thank you for your help.

Mike
YOU DREAM IT - WE CREATE IT!

www.world-class-multimedia.com

For world-class virtual instruments - www.supersynths.com
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 31st May 2017 14:40
Guys I was a bit time out of GG world working for customer; the question is I back and found new LUA updates talking about 500+ LUA commands added to the last release (2017.05.12).

Quote: "Over 500 new LUA commands added for scripters"


The question is: where those 500 Lua commads are?
I've checked global.lua file, it has many new commented commands at the bottom, but does not in the global body, just as commented lines, am I missing something here?

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 31st May 2017 15:54
They are briefly documented in global.lua as comments and are 'direct call' commands so will work even if they don't look like they should (they aren't wrapping sendmessage calls like the original approach in the top part of global.lua).

Hope I'm answering the question

Cheers.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 31st May 2017 17:47
Quote: "(they aren't wrapping sendmessage calls like the original approach in the top part of global.lua)"

Yes, this make me thing about. So wow! there are a lot of new commands to try.

Ty cybernescence for the tip.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 31st May 2017 19:38
also check out gameplayercontrol.lua if you wish to edit the default camera / thirdperson script (which was added along with the update).
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-11-24 13:01:43
Your offset time is: 2024-11-24 13:01:43