Page 1 of 1

No working lua anim scripts

Posted: 14 Jun 2014, 20:30
by code_man
I want to convert some of the old cob/bos scripts of simbase to lua due to bugs in them.
But after a while i noticed it doesnt work at all, some dude on #moddev mentioned i need a special gadget for the engine to recognize lua scripts.

Now the strange thing is, in a game a made almost from scratch, the only lua i have is the flowing one:

Code: Select all

VFS.Include("LuaGadgets/gadgets.lua",nil, VFS.BASE)
inside "/LuaRules/main.lua" and lua scripts work there.
But in simbase they just dont work, despite this file being there too and i have removed also all possible other lua files that might have caused a conflict but to no effect.

I already asked this on #moddev but i got a in a bit of stress and forgot.
But seriously whats the deal here, shouldnt this be just part of the engine?
Just whats going on?

Re: No working lua anim scripts

Posted: 14 Jun 2014, 20:57
by gajop
What's simbase? link code.
"Lua scripts" is too broad, you have LuaUI (widgets), LuaRules (gadgets), and so on.

Re: No working lua anim scripts

Posted: 14 Jun 2014, 21:09
by code_man
gajop wrote:What's simbase? link code.
See http://springrts.com/phpbb/viewtopic.php?f=79&t=32118 to know whats going on, tough il have to upload all of the /LuaRules/ stuff since i changed things and im not sure if things available in that thread are the same ones as i have right now.
I dont think il manage to squeeze this in today, il see if i can tomorrow.
"Lua scripts" is too broad, you have LuaUI (widgets), LuaRules (gadgets), and so on.
Well i mean stuff in /LuaRules, but since there is LuaRules/gadgets i wasnt sure if i should have called it gadgets, but i mean all Stuff under LuaRules.

I did forgot to mention that there is no infolog error of any kind with this, it just doenst even start.

Re: No working lua anim scripts

Posted: 14 Jun 2014, 22:31
by FLOZi
code_man wrote: Now the strange thing is, in a game a made almost from scratch, the only lua i have is the flowing one:

Code: Select all

VFS.Include("LuaGadgets/gadgets.lua",nil, VFS.BASE)
inside "/LuaRules/main.lua" and lua scripts work there.
You are incorrect.

LUS will not function without the unit_script gadget. <-- full stop

https://github.com/FLOZi/SpringABC/blob ... script.lua

Re: No working lua anim scripts

Posted: 17 Jun 2014, 13:49
by code_man
You were right, it really was in my other game.
So i got things working now.

Tough still, why is this even needed?

Re: No working lua anim scripts

Posted: 17 Jun 2014, 16:57
by FLOZi
Because Lua Unit Scripts are an extension of the gadget API.

It could go in LuaRules/ in base content so it was always available, but that runs counter to all other gadget code.

(Should still be done imo but what do I know)