Scripts / [SOLVED] Custom animation to standard GG animation

Author
Message
SOLO DESIGN
15
Years of Service
User Offline
Joined: 30th Jul 2008
Location: Kent, England
Posted: 15th Apr 2020 12:55 Edited at: 17th Apr 2020 11:28
Hi,
I have followed Lee's broadcast to create custom animation in GG and all works well but instead of controlling the character via the script I want at the end of the script to move to normal GG control of the character for run, walk, attack etc . Is this possible?

So attached to the character is a script that initiates with -

The author of this post has marked a post as an answer.

Go to answer
PM
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 15th Apr 2020 13:13
which broadcast are you talking about? any link?
PC 2 Specs:
AMD RYZEN 2600 SIX CORE @3,70, 64GB RAM DDR4 2400, M/B GIGABYTE AX370
SVGA NVDIA 1660GTX 6GB , SSD M.2 TRANSCEND S110 1TB, 1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB


PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM
SOLO DESIGN
15
Years of Service
User Offline
Joined: 30th Jul 2008
Location: Kent, England
Posted: 15th Apr 2020 13:29
Hi JC LEON,

Broadcast #56
https://www.youtube.com/watch?v=6B6lefpnVN8&index=58&list=PLHBl2h7kfw7CkUOap0I5y57oaf8LP35VM&t=0s

PM
JC LEON
13
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 15th Apr 2020 15:42
ah ..ok thanks
PC 2 Specs:
AMD RYZEN 2600 SIX CORE @3,70, 64GB RAM DDR4 2400, M/B GIGABYTE AX370
SVGA NVDIA 1660GTX 6GB , SSD M.2 TRANSCEND S110 1TB, 1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB


PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM
SOLO DESIGN
15
Years of Service
User Offline
Joined: 30th Jul 2008
Location: Kent, England
Posted: 15th Apr 2020 15:56
Pleasure JC LEON,

I got all this to work on a custom character in GG, apart from usual, WALK, RUN, ATTACK, DIE etc etc. which I was hoping to select anim frames using normal GG animation in FPE file rather than codeing everything custom, has anyone done this?? if it is possible then we can have custom start animations that flow into normal move and combat animations....

Thanks all.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th Apr 2020 19:56
not sure i follow the question, if you have the animations in your model you can play them like your own animations... the animations still need to be in the model though (i believe you can add the .fbx animations now?)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
SOLO DESIGN
15
Years of Service
User Offline
Joined: 30th Jul 2008
Location: Kent, England
Posted: 16th Apr 2020 00:01
Hi Smallg,

Yes I have all animations in the model, I used the manual method that Lee mentioned to animate them (see example), but was wondering if I could then move over to the FPE file after direct animation to animate for normal purposes like WALK, ATTACK, DEATH etc.????

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Apr 2020 10:33
Move over to the fpe?
The stock AI still uses code to call the animations, you set them in the fpe like
anim0 = 1,100
anim1 = 101,200
Etc
You can add as many as you need (just remember to also change animmax = ?)

The number you call in lua is the number in the "name" - i.e. anim0 is SetAnimation(0).

If you are asking how to swap to core AI logic after doing your script you use
Require "scriptpath"
SwitchScript() --found in global
When the code has finished running your animations
(Assuming you don't need to return to your animations).

lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
SOLO DESIGN
15
Years of Service
User Offline
Joined: 30th Jul 2008
Location: Kent, England
Posted: 17th Apr 2020 11:54 Edited at: 17th Apr 2020 11:54
Hi smallg,
That sounds just the ticket, so I have one script called ai_skeletonsoldier.lua (script1 , manual control) and then another called ai_fantasycharacter_skeletonsoldier.lua (script2 , auto control)

So at the end of script 1, i would use

PM
SOLO DESIGN
15
Years of Service
User Offline
Joined: 30th Jul 2008
Location: Kent, England
Posted: 17th Apr 2020 12:43 Edited at: 17th Apr 2020 12:45
Sorry smallg should show you the scripts hehehehe

script1 - ai_skeletonsoldier.lua


script 2 - ai_fantasycharacter_skeletonsoldier.lua
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 17th Apr 2020 12:46
Quote: "So at the end of script 1, i would use"


As far as i know you need to use require in the header above the _init of the script, and switchscript in the _main.

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.

Primary Laptop:
i5, NV1050 4GB, 8GB memory, 1x 1TB HDD, Win10.

Secondary Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
SOLO DESIGN
15
Years of Service
User Offline
Joined: 30th Jul 2008
Location: Kent, England
Posted: 17th Apr 2020 13:47
Thanks Belidos,

I have now tried this but it does not switch to the other script for some reason...... no errors on LUA scripts reported, but I may have syntax of the switch code wrong......
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Apr 2020 13:56
This post has been marked by the post author as the answer.
like this.
*note that you need to be sure the function names match the script name* <- your init(e) doesn't
my script is named ai_skeleton_soldier.lua
also made it an array so it'll work with multiple skeletons
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
SOLO DESIGN
15
Years of Service
User Offline
Joined: 30th Jul 2008
Location: Kent, England
Posted: 17th Apr 2020 14:17
smallg many thanks, that works like a charm!



Now on to Sounds.........and soundsets...
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 17th Apr 2020 15:02
d'oah yeah it's not required, it's include!

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.

Primary Laptop:
i5, NV1050 4GB, 8GB memory, 1x 1TB HDD, Win10.

Secondary Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
SOLO DESIGN
15
Years of Service
User Offline
Joined: 30th Jul 2008
Location: Kent, England
Posted: 17th Apr 2020 18:30
Many thanks to smallg for the scripting help, here is the test outcome using Manual control and then Auto Control via 2 scripts. -


PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Apr 2020 18:51
looks good, i wasn't sure which animations were which so i just left them all in - you might want to reduce state 4 a bit (or a lot) so he attacks faster after getting up

Quote: "d'oah yeah it's not required, it's include!"

pretty sure you can use either, just the path naming that can be a bit weird
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 17th Apr 2020 20:13
No, it is require!

Include() is a GG function and all it does is mark a script for copying to the standalone.
Been there, done that, got all the T-Shirts!
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 17th Apr 2020 22:48

Ah cool, then probably best to use both just incase

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.

Primary Laptop:
i5, NV1050 4GB, 8GB memory, 1x 1TB HDD, Win10.

Secondary Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 18th Apr 2020 10:29
Quote: "No, it is require!

Include() is a GG function and all it does is mark a script for copying to the standalone."

Definitely works with include, I think Lee originally wrote it to work with the switchscript function as it's what he used to use at the time it was added (I didn't actually notice that include is a GG command but I guess he didn't know about require).
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
SOLO DESIGN
15
Years of Service
User Offline
Joined: 30th Jul 2008
Location: Kent, England
Posted: 18th Apr 2020 10:51
Thanks again smallg, now I start on the Army of Undead, with different style skeletons, I was wondering has anyone done a good archer? with a bow and you can see the arrows coming towards the player?

I have looked but cannot find one done in GG...... mmmmmmm a challenge!
PM

Login to post a reply

Server time is: 2024-03-29 10:02:19
Your offset time is: 2024-03-29 10:02:19