Page 1 of 1
/luarules reload not working
Posted: 24 Jul 2013, 21:27
by aiphee
Hi,
im trying to make LUA animation for this:
http://zero-k.info/Forum/Thread/3510
but info on this
http://springrts.com/wiki/Animation-LuaScripting
page seems depreceated. When i add
Code: Select all
return include("LuaGadgets/Gadgets/unit_script.lua")
into that file, it generetes error.
So how do i debug my animation?
Also, im working only with text editor, are there any LUA animation help tools?
Re: /luarules reload not working
Posted: 24 Jul 2013, 21:58
by knorke
I think you confused something maybe?
The page says: "To enable Lua unit scripts, create a file LuaRules/Gadgets/unit_script.lua, and paste the following into it: ..."
That is just something the game has to do once, so that lua unit scripts work. Kind of including/loading/setting up the "framework", which zeroK already has done.
So it is not anything that goes into your new unit's script or not something that you will have to think about when scripting your new unit.
So how do i debug my animation?
/cheat
/luarules reload
to reload it after editing, then try until it works.
Also, im working only with text editor, are there any LUA animation help tools?
Some tools, but more like "helpers" not full editors or anything like that:
http://springrts.com/phpbb/viewtopic.php?t=27268
I also like this:
http://springrts.com/phpbb/viewtopic.php?f=23&t=25847
because I always forgett the name of pieces and how they attach to each other.
Re: /luarules reload not working
Posted: 25 Jul 2013, 00:12
by aiphee
Thanks for help.
But no matter how many times i try
/luarules reload
The same animation goes again. When i exit and start game again, it works.
Im writing directly to zip (sdz) and cheats got on.
Re: /luarules reload not working
Posted: 25 Jul 2013, 00:25
by knorke
might just be that spring does not reload .zip (sdz) files because usally they do not change.
unpack the mod, rename the folder to blabla.sdd and try again.
(dont forget to change modname in modinfo.lua so it is an unique thingy)
Re: /luarules reload not working
Posted: 25 Jul 2013, 01:09
by aiphee
Hm, i didnt know that i can have folder also with sdz extension taken as mod, ty will try toomorow.
Re: /luarules reload not working
Posted: 25 Jul 2013, 08:17
by yuritch
Unpacked folder extension should be .sdd, not .sdz
Re: /luarules reload not working
Posted: 25 Jul 2013, 15:06
by smoth
I don't see it here but did you do /cheat
Re: /luarules reload not working
Posted: 28 Jul 2013, 15:16
by aiphee
Alredy working, it does work with folder.sdd, not with archives. Some admin should ater this page:
http://springrts.com/wiki/Animation-LuaScripting
(and thanks again :)
Re: /luarules reload not working
Posted: 28 Jul 2013, 15:44
by FLOZi
Alter how?
also note that you can login to wiki using your forum account and change it yourself

Re: /luarules reload not working
Posted: 30 Jul 2013, 21:15
by aiphee
edited, can you check it after me?
Re: /luarules reload not working
Posted: 30 Jul 2013, 22:06
by FLOZi
All is good apart from the last part - sdd is not required for reload to work.

Re: /luarules reload not working
Posted: 04 Oct 2015, 10:48
by prandipadaro
So sorry if i reopen this topic but i have a similar problem and dont want to open new question.
I try to understand something about games, i use the springtutorialgame for test.
Just rewrite a weapon and try to test some field like: reloadtime, weapontype, etc.
In order to change ingame the parameters i give the following commands:
/cheat
/editdefs
and try many times
/luarules reload
all work fine for reload unitscripts
but the weapondefs not reloaded
what i wrong?
Re: /luarules reload not working
Posted: 04 Oct 2015, 11:01
by hokomoko
defs can't be reloaded.
Re: /luarules reload not working
Posted: 04 Oct 2015, 11:03
by prandipadaro
ok but /editdefs what is?
Re: /luarules reload not working
Posted: 04 Oct 2015, 12:30
by gajop
You can edit the UnitDef object directly. I'm not sure what's restricted there, but you could change the max hp which would be reflected if you created a new unit.
Re: /luarules reload not working
Posted: 04 Oct 2015, 12:52
by FLOZi
Editdefs has never been reliable, I even thought it had been removed.
Re: /luarules reload not working
Posted: 04 Oct 2015, 18:00
by Silentwings
/editdefs is still listed on the wiki but I don't know of any situation where it works. Imo at this point best to just remove it.