Page 1 of 1

Onoffable LUPS effects?

Posted: 15 Aug 2010, 12:18
by tyran_nick
I ve been working on a reactor. I want to be able to deactivate it to increase its resistance to damage using the armored tag. I have managed to make onoffable lups for when the reactor is on, but I can't find how to make a second lups effect on, to use when the reactor is deactived. To give you a better idea of what I m talking about:

Activated reactor
Image

Deactived reactor
Image

All I want to do is a shield effect (no real shield - I take care of it using the damage modifier) around the unit when its deactivated, however this corresponds to the off state of the unit and the onactive=true tag doesn't help here.

Any ideas?

Re: Onoffable LUPS effects?

Posted: 15 Aug 2010, 17:58
by SanadaUjiosan
I don't know how to do it, but I will say really awesome reactor model and idea. I hope someone gives you a hand!

Re: Onoffable LUPS effects?

Posted: 16 Aug 2010, 06:16
by Pressure Line
Attach an always-on shield effect to an invisible point object, and have that point do a "move to y-axis -10000 now" when the reactor is 'on' and a corresponding "move to y-axis 0 now" when the reactor is 'off' and shielded.

Re: Onoffable LUPS effects?

Posted: 16 Aug 2010, 06:53
by jK
tyran_nick wrote:however this corresponds to the off state of the unit and the onactive=true tag doesn't help here.
Works fine here.
You know that Lua is case sensitive?

Re: Onoffable LUPS effects?

Posted: 16 Aug 2010, 07:47
by Pressure Line
What he means jK is that onActive doesnt help, because he wants the opposite functionality (the effect is turned on when the unit is off)

Re: Onoffable LUPS effects?

Posted: 16 Aug 2010, 08:09
by tyran_nick
That worked perfectly! Thanks

Image

Re: Onoffable LUPS effects?

Posted: 16 Aug 2010, 08:17
by Pressure Line
Nicely done :)

Re: Onoffable LUPS effects?

Posted: 16 Aug 2010, 12:48
by Pressure Line
Double-post! An 'offActive' switch might be nice, probably not that hard to do either now that I think about it.

Re: Onoffable LUPS effects?

Posted: 16 Aug 2010, 13:01
by tyran_nick
Would that need to be coded in the lups.lua file?

This is what I found for the onActive tag:
if (fx.onActive and (unitActive == -1)) then
unitActive = spGetUnitIsActive(unitID)
end

if (fx.under_construction == 1) then
underConstruction = spGetUnitRulesParam(unitID, "under_construction")
end

if ((not fx.onActive)or(unitActive)) and (underConstruction ~= 1) then
if (fx.Visible) then
fx.visible = fx:Visible()
else
...
...