Onoffable LUPS effects?

Onoffable LUPS effects?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
tyran_nick
Posts: 47
Joined: 07 Mar 2010, 12:42

Onoffable LUPS effects?

Post 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?
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: Onoffable LUPS effects?

Post 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!
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Onoffable LUPS effects?

Post 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.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Onoffable LUPS effects?

Post 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?
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Onoffable LUPS effects?

Post 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)
User avatar
tyran_nick
Posts: 47
Joined: 07 Mar 2010, 12:42

Re: Onoffable LUPS effects?

Post by tyran_nick »

That worked perfectly! Thanks

Image
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Onoffable LUPS effects?

Post by Pressure Line »

Nicely done :)
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Onoffable LUPS effects?

Post by Pressure Line »

Double-post! An 'offActive' switch might be nice, probably not that hard to do either now that I think about it.
User avatar
tyran_nick
Posts: 47
Joined: 07 Mar 2010, 12:42

Re: Onoffable LUPS effects?

Post 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
...
...
Post Reply

Return to “Game Development”