For a weapon I want an effect that just flying dirt if the ground is hit and flying sparks when a unit is hit.
So I did this:
http://pastebin.ca/2024146
Notice the
unit = false,
nounit = true,
etc.
The "flying sparks" (first effect part) only shows when a unit is hit - that is correct.
But the second part that should only show when the ground is hit shows up even if a target unit is hit.
Somewhere on wiki it says "if the impact point is not further than 15 elmo from ground it will be considered a ground hit" so I made air units shot each other - and the groundhit effect still shows.
http://springrts.com/wiki/CEG-Format
So any ideas or maybe a ceg effect (.lua prefered) that works as described or similiar?
ceg effects: only show effect when unit is hit
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: ceg effects: only show effect when unit is hit
texture = [[dirt]], is defined in both areas. Might want use a different texture for the non groundhit one and see if maybe they were just hard to tell apart or something.
Re: ceg effects: only show effect when unit is hit
nah, they have different colors because of colormap tag.
groundhit effect is brown, the other one white.
groundhit effect is brown, the other one white.
Re: ceg effects: only show effect when unit is hit
Using air=1 for the unit hit and ground=1 for the ground hit tends to work.
Re: ceg effects: only show effect when unit is hit
think:
When you define ground=true & air=true, the effect still shows. So how will those flags be used? With bit-and or with bit-or? (bit-and would mean that all conditions must be meet and bit-or means that just minimum one must be meet)
And now think how the unit/nounit flags cooperate with those other flags.
When you define ground=true & air=true, the effect still shows. So how will those flags be used? With bit-and or with bit-or? (bit-and would mean that all conditions must be meet and bit-or means that just minimum one must be meet)
And now think how the unit/nounit flags cooperate with those other flags.
Re: ceg effects: only show effect when unit is hit
http://pastebin.ca/2024665
i think air=false for the groundhit did it in the end, thanks...
http://pastebin.ca/2024681
this version with all conditions but nounit=true removed works too. Not sure about shooting at air if one wanted flak-effects, my projectiles just fly on "forever" if they miss so its fine with me...
It was not clear what conditions are checked for in what cases.
Also it was/is not really clear if ie unit=false means it does not check for units at all or if it means that the effect will trigger if no unit is hit.
nounit=true
unit=false
What is the difference?
i think air=false for the groundhit did it in the end, thanks...
http://pastebin.ca/2024681
this version with all conditions but nounit=true removed works too. Not sure about shooting at air if one wanted flak-effects, my projectiles just fly on "forever" if they miss so its fine with me...
Found it now, wiki says: "If you set more than one condition, the spawner will run if any of them are true."So how will those flags be used?
It was not clear what conditions are checked for in what cases.
Also it was/is not really clear if ie unit=false means it does not check for units at all or if it means that the effect will trigger if no unit is hit.
nounit=true
unit=false
What is the difference?
Re: ceg effects: only show effect when unit is hit
The statements never exclude any cases. Unit=false means it won't be specifically triggered on hitting a unit but it can still be triggered by virtue of being in the air or on the ground. Nounit=true only covers the case when no unit is hit, it does not state anything about what happens when a unit is hit.