Scripts / Animation don't start

Author
Message
Mouaa
User Banned
Posted: 23rd Jan 2017 22:38 Edited at: 23rd Jan 2017 22:40
hi,

I am trying a custom script, in properties object i put this script for a model (DirectX 3D format) that have armature and animation.
But i the animation doesn't play ?



Is this correct how to start and loop an animation ?
Mouaa
User Banned
Posted: 24th Jan 2017 16:07
I am on my own lol
Bugsy
15
Years of Service
User Offline
Joined: 24th Nov 2008
Location: Savannah
Posted: 24th Jan 2017 17:12


SmallG wrote me this for Kshatriya Origins. Make sure that the entity has 2 animations defined in his fpe file. first is spawn anim, second is looping idle anim.

BE CAREFUL. fpsc was a dream with entity characters, but it seems to KILL gg's frame rate.
Mouaa
User Banned
Posted: 24th Jan 2017 22:08
Quote: "BE CAREFUL. fpsc was a dream with entity characters, but it seems to KILL gg's frame rate."

Thanks Bugsy.
Can't we skip the spawn animation ? my entitie is a loot box like Borderlands, there is only open animation playing when you get close and open it.
Bugsy
15
Years of Service
User Offline
Joined: 24th Nov 2008
Location: Savannah
Posted: 24th Jan 2017 22:55
you can set the frame ranges in the .fpe file to anything you like
Mouaa
User Banned
Posted: 26th Jan 2017 19:06 Edited at: 26th Jan 2017 19:08
I don't understand why this code doesn't work as it is correctly coded


This is my FPE file


Why should it not play when we tell what are the animations frames range and call LoopAnimation ?
Why should it be more complicated than that ?
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 26th Jan 2017 19:37
Quote: "defaultstatic = 1"

Try, defaultstatic = 0

Quote: ";anim
animmax = 2
animOpen = 1,70"


Assume you've 2 anims :

;Animationinfo
animmax = 2
anim0 = 0,30
anim1 = 31,70
playanimineditor = 0

You can run anim using "PlayAnimation(e,0)" Or "PlayAnimation(e,1)" Or loop your anim using, "LoopAnimation(e,0)" Or "LoopAnimation(e,1)"

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

PM
Mouaa
User Banned
Posted: 26th Jan 2017 20:03 Edited at: 26th Jan 2017 20:05
@3com

;Animationinfo
animmax = 2
anim0 = 0,30
anim1 = 31,70
playanimineditor = 0

You can run anim using "PlayAnimation(e,0)" Or "PlayAnimation(e,1)" Or loop your anim using, "LoopAnimation(e,0)" Or "LoopAnimation(e,1)"




Thanks , i understand better how animations must defined and called.
Mouaa
User Banned
Posted: 26th Jan 2017 20:30
I changed thes lines in FPE


;ai
aimain = lootbox.lua


;Animationinfo
animmax = 1
anim0 = 1,70
playanimineditor = 0


And this is my new LUA code , but pressing key E nothing happens ?



Why editing the properties in the editor and specifying a LUA file like lootbox.lua , doesn't get written to FPE file ?
FPE file contained Default.lua parameter
;ai
aimain = default.lua


Or are they two different things ?
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 26th Jan 2017 20:37
The fpe is read only, the properties are for if you want to change it without effecting other copies that may be placed.

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 26th Jan 2017 21:20
Quote: "And this is my new LUA code , but pressing key E nothing happens ? "

If above is the complete code, then I don't see nothing about "g_KeyPressE " there.
Something like:

If g_KeyPressE == 1 then
your code here
end

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

PM
Mouaa
User Banned
Posted: 26th Jan 2017 21:32 Edited at: 26th Jan 2017 21:46
Quote: "The fpe is read only, the properties are for if you want to change it without effecting other copies that may be placed."

I didn't know, it can be confusing indeed. But my model doesn't loop animation lol

Is there a way in GG to chek animations are imported right and working ? (outside of running the game)

I put everything (FPE, Lua, Dbo, icon) on Zip if someone want to try.
https://ufile.io/6f471
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 26th Jan 2017 22:34
(1) The model has to be dynamic to run a script, so as 3com says set defaultstatic = 0 in fpe (or select model in editor and press 'y' this toggles selected entity from static/dynamic).
(2) The animation of the bones appears to be working but the vertices of the lid and sides of the mesh aren't assigned/weighted to the bones.

Cheers.
Mouaa
User Banned
Posted: 26th Jan 2017 22:59
(1) The model has to be dynamic to run a script, so as 3com says set defaultstatic = 0 in fpe (or select model in editor and press 'y' this toggles selected entity from static/dynamic).

There is no Dynamic in properties ?


I put defaultstatic = 0 in FPE , but animation doesn't loop ?
;orientation
model = lootbox.dbo
offx = 0
offy = 0
offz = 0
rotx = 0
roty = 0
rotz = 0
scale = 1215
collisionmode = 0
defaultstatic = 0
materialindex = 0
matrixmode = 0
cullmode = 0


Quote: "(2) The animation of the bones appears to be working but the vertices of the lid and sides of the mesh aren't assigned/weighted to the bones."

Under Blender each model part is fully assigned to a bone. I checked export options in Blender , perhaps something is missing.
Is there some Blender 2.78 export to GG guide ?
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 27th Jan 2017 00:37
The animation isn't working properly in the x model so it won't work in GG. I don't use blender so can't help with that aspect.

I've attached your fixed model with fpe and example lua script.

Cheers.


Attachments

Login to view attachments
Mouaa
User Banned
Posted: 27th Jan 2017 10:30
@cybernescence
Than you.
But the model does not animate and the script doesn't work, when the player get near there is no message, something must be missing.
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 27th Jan 2017 14:19
It works - double check the advice above. Try on a new map. Make sure the model is dynamic. Make sure the script is in scriptbank folder.

Cheers.
Mouaa
User Banned
Posted: 27th Jan 2017 19:43
Thanks cybernescence.
It worked when i put the script in the folder scriptBank.
But why scripts can't be placed in any folder we want ? that's strange.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 27th Jan 2017 19:47
My scripts are put in a subdirectory and work just fine, even in standalones. The only problems I find are with sprites which don't get copied over properly in standalone creation if they are not in the correct place.
Been there, done that, got all the T-Shirts!
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 27th Jan 2017 20:38
Yes can be in sub folders of scriptbank or scriptbank but doesn't appear to work elsewhere. Not a problem as long as it's known. I just keep scripts that pertain to a level in a sub folder of the same name.

Cheers.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 27th Jan 2017 21:25
Quote: "@cybernescence
Than you.
But the model does not animate and the script doesn't work, when the player get near there is no message, something must be missing."


It's because the FPE file is telling gameguru it's just in the scriptbank (scriptbank is the default base directory), you can put it in any subfolder you like, but if you don't change it in the FPE you will have to use the properties to browse to it in your file structure to get it to work, alternatively you can change it in the FPE, so for example if you wanted to put it in a folder in scriptbank called "stuff" you would have to change:

aimain = lootbox.lua

to

aimain = stuff\lootbox.lua

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.

Login to post a reply

Server time is: 2024-04-24 16:38:48
Your offset time is: 2024-04-24 16:38:48