When a condition isn't met.
In this case, we have techlost() and techgranted()
I tried
set Activation to 1; (and 0, and true/false)
but it had no effect on this unit.
The unit in particular makes energy, and I would like to reduce it's energy output to 0 while techlost.
I'm thinking this should be easy but for some reason I can't figure it out.
How to turn a unit off with bos?
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: How to turn a unit off with bos?
I think you actually have to have the unit 'use' -ve energy. IIRC thats how *A solars do it.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: How to turn a unit off with bos?
Here is the script as it is.
http://pastebin.com/XuduyYuA
I switched it to energyuse -number, that caused the button added by onoffable = true to work correctly.
http://pastebin.com/XuduyYuA
I switched it to energyuse -number, that caused the button added by onoffable = true to work correctly.
Amidoinitrong?TechGadget wrote:------------------------------------------------------------
The COB functions TechLost and TechGranted will be called
by the gadget if a unit requiring a tech has them.
------------------------------------------------------------
- Deadnight Warrior
- Posts: 183
- Joined: 08 Jun 2009, 17:59
Re: How to turn a unit off with bos?
Edit the unitdef to have onoffable=0; actvatewhenbuild=1; and it will be fine, no extra buttons, and the ACTIVATION will be set according to TechLost and TechGranted calls.
The unit script is OK, but I'd remove some redundant code.
It could be that the gadget doesn't call those functions when a unit is built, but only when the tech status changes.
The unit script is OK, but I'd remove some redundant code.
It could be that the gadget doesn't call those functions when a unit is built, but only when the tech status changes.
Re: How to turn a unit off with bos?
lol i derail with lua:
Spring.SetUnitResourcing
Spring.SetUnitResourcing
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: How to turn a unit off with bos?
Thanks deadknight 
@knorke, get me a 1:1 bos:lua converter and we'll talk ;p

@knorke, get me a 1:1 bos:lua converter and we'll talk ;p
Re: How to turn a unit off with bos?
maybe you could call it from within the tech-gadget?
then it wont matter if unitscript is bos or lua.
then it wont matter if unitscript is bos or lua.