Scripts / lua , fpe question

Author
Message
cryptweaver
9
Years of Service
User Offline
Joined: 22nd Dec 2015
Playing:
Posted: 14th May 2016 02:39
hello all, hope this is in the right post. I have this character that with the help of some kind folks from the forums was able to get it in gameguru. I have the animations set in the fpe and the lua and they appear to be correct but when a go to testplay, the character does not show any animations. He kinda just floats around and hits you but with no animations at all. I was just wondering if any one may have had this issue and has some advice? The animations are not stock animations of gamegure. They came with the character along with an animation frame doc and they do match up in the lua and fpe. Thanks guys
Wishing you all the best.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th May 2016 10:31
Can you post the fpe and the script so we can see?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
cryptweaver
9
Years of Service
User Offline
Joined: 22nd Dec 2015
Playing:
Posted: 14th May 2016 23:49
yes smallg, thank you. Attachments below.
Wishing you all the best.

Attachments

Login to view attachments
cryptweaver
9
Years of Service
User Offline
Joined: 22nd Dec 2015
Playing:
Posted: 14th May 2016 23:50
oops I posted the files lol thought it would be the images. Not sure how to do that i guess. Im such a newb/
Wishing you all the best.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th May 2016 10:51 Edited at: 15th May 2016 13:26
Main is run very frame so if you have PlayAnimation being called every frame then the animation is re-started every time.

You need to monitor the animation frame number and only call PlayAnimation when the previous animation has completed.

If using LoopAnimation you only need to call it once so have it inside an 'if not animating' check.

Hope that all makes sense.

Edited to add:
Now I've had a closer look at the Lua script it appears there are enough checks to avoid the problems I highlighted above (they are the traps I usually fall into), it appears the SetCharacterToWalk(e) bit is only triggering the animation once rather than repeatedly, not sure why that should be the case.
Been there, done that, got all the T-Shirts!
PM
cryptweaver
9
Years of Service
User Offline
Joined: 22nd Dec 2015
Playing:
Posted: 15th May 2016 15:54
Thank you kindly amen moses for the reply. I have been reading up on lua and trying to figure it out but just cant seem to get it I will keep at it tho. I thank you
Wishing you all the best.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th May 2016 18:09
script seems to work fine so i would check you definitely exported the animations along with the model.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 15th May 2016 22:33 Edited at: 15th May 2016 22:42
how did you export the model? I had similar issue where if I didn't export groups the animations didn't play but just floats around, not sure if this is same problem but thought I should mention it just in case
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, SQL, PL-SQL, JavaScript, HTML, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; LG TFT monitor (widescreen). Wanting a new PC at some point.
Interests: Drumming, Saxophone, Art, Theatre, Music.
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 15th May 2016 22:44
animmax is set to 1? I always set to number of total animations + 1
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, SQL, PL-SQL, JavaScript, HTML, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; LG TFT monitor (widescreen). Wanting a new PC at some point.
Interests: Drumming, Saxophone, Art, Theatre, Music.
cryptweaver
9
Years of Service
User Offline
Joined: 22nd Dec 2015
Playing:
Posted: 15th May 2016 22:53
Thanx smallg and bored. I ran it through fragmotion to check the frame numbers and they are correct as far as the animation doc. I messed around and attached the murkscreamer script to him and he actually did a couple animation like move left and swung an arm but there was nothing else. How do u check to see, or export animations with the model? Sorry is all kinda new to me but am learning thanks to you guys.
Wishing you all the best.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 16th May 2016 18:47
I've attached my version of Lees ai_vewanimations script , with it you can see and test all the animations but I think there might be some subtle bug surrounding the CharacterControlLimbo(e) command, i.e. when you then use CharacterControlUnarmed(e) later in the script is doesn't seem to re-enable the animations correctly.
Been there, done that, got all the T-Shirts!
PM
cryptweaver
9
Years of Service
User Offline
Joined: 22nd Dec 2015
Playing:
Posted: 17th May 2016 03:34
thank you very much amenmoses
Wishing you all the best.
cryptweaver
9
Years of Service
User Offline
Joined: 22nd Dec 2015
Playing:
Posted: 20th May 2016 17:15
Hey guys, the character works and moves and animates and all is well. New problem tho. He does not deal any damage when he attacks you. I can put another script on him and he deals damage to you. but if i take that same script and make changes to the right attack animations and such, he deals no damage. Anyone know why this may be?
Wishing you all the best.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th May 2016 18:45
your script uses 4 conditions before it will apply damage
Quote: " if ai_soldier_state[e]=="attack" then
if GetAnimationFrame(e)>damageframestart[e] and GetAnimationFrame(e)<damageframeend[e] then
if GetPlayerDistance(e)<90 then
if GetTimer(e) > lastswipe[e] then
"


now if you apply a sound at slot 1 then does it play when you see him attack? if so then all conditions are being met, if not then one or more are not true.

most likely 'if GetPlayerDistance(e) < 90 then' is fine because that is already checked once to trigger the attack animation beforehand.
also again the 'ai_soldier_state[e]' should equal "attack" as this is set when the attack animation is called.
the timer might be an issue as it is set to 1s delay each time but only gets reset once the damage has applied so it should apply at least some of the time (if the animation is short/fast).
and finally the animation frames for 'damageframestart[e]' and 'damageframeend[e]' must be inside the 'attackstart[e]' and 'attackend[e]' range (which they are in the script posted above, so shouldnt be an issue but is the most likely issue, double check for mistakes).

1 more thing to consider is that the player is temporarily immune to damage on respawn.

other than that, can't see any obvious issues with the script
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
cryptweaver
9
Years of Service
User Offline
Joined: 22nd Dec 2015
Playing:
Posted: 20th May 2016 19:20
great smallg, that worked. He now beats me down lol but now it seems he cant be killed no matter how many time i hit him he wont die. Last problem i think, i hope
Wishing you all the best.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st May 2016 00:48
turn always active off or set a condition in the script to handle him dying when health goes below 1.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
cryptweaver
9
Years of Service
User Offline
Joined: 22nd Dec 2015
Playing:
Posted: 21st May 2016 02:38
funny thing is if i use the rpg or grenades, he dies how he is supposed to. But i tried the shotgun with 200 rounds and the uzzi but those dont seem to kill him. always active is set to no. the set a condition part confuses me lol
Wishing you all the best.

Attachments

Login to view attachments
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st May 2016 11:41
ah you're using a new script and this one has a command to reset the health at line 24 which is being called every frame
Quote: "SetEntityHealth(e,100)"

you should remove this and it will be fine.

for future reference to check an entity is dead you can do this (only needed if you set something always active)

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: 21st May 2016 11:43 Edited at: 21st May 2016 12:14
Looking at the ai_soldier script it has a bit you are missing:

if string.find(string.lower(g_Entity[e]['limbhit']), "head") ~= nil then
ai_soldier_state[e] = "deathanim"
PlayCharacterSound(e,"onDeath")
... etc ...
ResetLimbHit(e)
end
end

Presumably you need something similar with cases of 'limb' and 'body' assuming of course the ai is setting those for your model (it must have to know where the limbs etc are!).

btw, this bit:

rndx=math.random(1,360)
rndz=math.random(1,360)
rndx2=math.sin(rndx)*30
rndz2=math.cos(rndz)*30
AIEntityGoToPosition(EntObjNo,g_PlayerPosX+rndx2,g_PlayerPosZ+rndz2)

Would be better as:
local angle = math.random() * 2 * math.pi
AIEntityGoToPosition(EntbjNo, g_PlayerPosX+ math.sin (angle) * 30, g_PlayerPosZ + math.cos(angle) * 30)
Been there, done that, got all the T-Shirts!
PM
cryptweaver
9
Years of Service
User Offline
Joined: 22nd Dec 2015
Playing:
Posted: 21st May 2016 21:01
Hey all, Want to thank you amenmoses and smallg, you guys have been a great help. He is working just fine now. Thank you again.
Wishing you all the best.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st May 2016 23:29
No problem,.

You could help me back actually, from the model I assume you are developing some sort of fantasy style game, well I posted on the product chat forum about the radar pack I am developing and was wondering about how to have a sort of fantasy radar system, maybe some sort of crystal ball looking device or a magical lens or something.

If you have any ideas I'd be interested as the standard radar system doesn't really lend itself to the fantasy genre does it.

Maybe a magical map like in Harry Potter? Could have the ai script for each character type set an array item identifying what they are then have a small sprite appear on the map indicating their position in real time.

I wouldn't be able to get it in the first release unless it was relatively simple, the real time killer is developing the sprites as I'm not very artistic.
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-12-22 17:25:51
Your offset time is: 2024-12-22 17:25:51