Trouble with limiting unit build from unitdef lists

Trouble with limiting unit build from unitdef lists

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

Moderator: Moderators

Post Reply
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Trouble with limiting unit build from unitdef lists

Post by bobthedinosaur »

Gadget is skystar's

http://pastebin.com/Jiac7Jhm

I've tweaked to my hearts content. Well till my patience ran out. I can't seem to get this working.
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Trouble with limiting unit build from unitdef lists

Post by Niobium »

For some reason the gadget mentions, but doesn't make use of, the :AllowUnitCreation callin. I'd say using that would greatly shorten and simplify the gadget, it really depends what you want to have happen in the edge cases, i.e. should units sit at 0% done when you are at limit, or should builders just skip it in their queue.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Trouble with limiting unit build from unitdef lists

Post by smoth »

unit limit is built into spring. For group unit limits there are other gadgets.

have fun dealing with morph.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Trouble with limiting unit build from unitdef lists

Post by bobthedinosaur »

Smoth, what other gadgets use a group limiter? That is kind of what I am going for. Well something I can set with a mod option.

Niob, if it was just commented in there that was me, and not skystar's original gadget. I was looking for a way to put that in there, but I didn't change any of the original code.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Trouble with limiting unit build from unitdef lists

Post by smoth »

Gundam has one it should be in the 1.21 files if not I can give you my version. I have a few bugs left to quash but I should be done soonish. If you need it tonight I should be on around about 7/8pm cst
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Trouble with limiting unit build from unitdef lists

Post by zwzsg »

There:
Attachments
Squad_Limiter.lua
(3.25 KiB) Downloaded 15 times
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Trouble with limiting unit build from unitdef lists

Post by bobthedinosaur »

Wow. That work's wonderfully Z! Now I just have to find out how you did it. :P
Post Reply

Return to “Lua Scripts”