Help please! Gadget is interfering with stealth=true,

Help please! Gadget is interfering with stealth=true,

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

Help please! Gadget is interfering with stealth=true,

Post by Forboding Angel »

This gadget:
https://code.google.com/p/evolutionrts/ ... _cover.lua

For whatever reason, renders stealth=true, in unitdefs to be completely not working, however, the gadget itself works perfectly. Units scurry under trees and get stealth + cloak.

Can someone please help me fix it (or fix it for me?)? Thank you!
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Help please! Gadget is interfering with stealth=true,

Post by Niobium »

Replace:

Code: Select all

function unhideUnit (uID)
    Spring.SetUnitCloak (uID, false ,2)
    Spring.SetUnitStealth (uID, false)
end
With:

Code: Select all

function unhideUnit (uID)
    Spring.SetUnitCloak (uID, false ,2)
    if not UnitDefs[Spring.GetUnitDefID(uID)].stealth then
        Spring.SetUnitStealth (uID, false)
    end
end
Note: Untested
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Help please! Gadget is interfering with stealth=true,

Post by Forboding Angel »

Yep, that did the trick. Thanks nio :-)

I'm not sure if I every thanked you for the little gadget I was working on for destroying trees under buildings etc, but, thanks for that too

:mrgreen:
Post Reply

Return to “Lua Scripts”