script.StopBuilding() Is called constantly... What the hell? Why?

script.StopBuilding() Is called constantly... What the hell? Why?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

script.StopBuilding() Is called constantly... What the hell? Why?

Post by Forboding Angel »

So this is the script: http://pastebin.com/nDQZRYsc

The problem is that I set an echo on stopbuilding to figure out when it is called, and it is called constantly! That doesn't make any sense, because that is what I'm supposed to use to know when the unit is done building. I can't restore the unit's position properly if I have no idea when it is done building.

You would think that the if statement around building = false would do the trick, but no building must be getting triggered on and off constantly.

This is dumb... how the heck am I supposed to know when the unit is finished building and then reset the animation? This is directly from the wiki.

https://springrts.com/wiki/Animation:LuaExamples
and
https://springrts.com/wiki/Animation-LuaCallins

Interestingly enough, buildfx works properly. I was desperate and so I even tried a while false loop on resetting the animation which of course didn't work, but I would be remiss if I didn't try absolutely everything.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: script.StopBuilding() Is called constantly... What the hell? Why?

Post by FLOZi »

Weird, was it resource-stalling?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: script.StopBuilding() Is called constantly... What the hell? Why?

Post by Forboding Angel »

No, and it was constantly getting called while it wasn't even building. I had it echoing the string twice per second about. That's another weird shit... Twice? Why twice?
Post Reply

Return to “Lua Scripts”