So I'm trying to get the caster of a periodic effect that's in a buff behavior using triggers. The triggering part is no problem, ofc. But it seems like the caster/origin/source unit doesn't get all the way through the effect chain or something. I use the periodic search effect to create an auto-pickup item system without delay that auto-cast abilities have.
I deleted most of the stuff in my map and attached it to this post. Do you know what the problem is? Search for "Pickup" stuff in data and trigger editor. I added debugging triggers already. Use WASD to go to the pickups.
The unit is being removed before the triggers have time to find it. Test this by removing the Pickup Remove effect from the Pickup (Set).
Two options: (A) Add a delay between the effects. Instead of Pickup (Set), make it an Apply Behavior that adds a behavior to the Caster from the unit picking up the pickup, and this behavior has a duration of 0.5 seconds. Triggers detect this effect and can glean both the pickup and the picking up unit. The behavior disables the Pickup behavior, and destroys the pickup when it expires.
(B) (my preferred method) make a unique pickup behavior for each kind of pickup, which allows triggers to differentiate them. In this case, Pickup (Set) should refer to a unique effect for this kind of pickup, or just get rid of pickup (set) and have a unique Pickup Remove effect for each kind of pickup.
Np. It's pretty annoying when that kind of thing happens. I've run into it a few times, e.g. when triggers refer to items being sold. I don't know about the most recent updates, but at one time when I wanted to add a trigger response to item selling, I had to make a trigger that recorded when a unit was ordered to sell an item, and then another that actually fired when the item was sold. Only the first one could tell which item was sold, but only the second trigger knew whether the item was actually sold, and not just ordered to be sold.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey guys :)
So I'm trying to get the caster of a periodic effect that's in a buff behavior using triggers. The triggering part is no problem, ofc. But it seems like the caster/origin/source unit doesn't get all the way through the effect chain or something. I use the periodic search effect to create an auto-pickup item system without delay that auto-cast abilities have.
I deleted most of the stuff in my map and attached it to this post. Do you know what the problem is? Search for "Pickup" stuff in data and trigger editor. I added debugging triggers already. Use WASD to go to the pickups.
Regards,
Ousnius
The unit is being removed before the triggers have time to find it. Test this by removing the Pickup Remove effect from the Pickup (Set).
Two options: (A) Add a delay between the effects. Instead of Pickup (Set), make it an Apply Behavior that adds a behavior to the Caster from the unit picking up the pickup, and this behavior has a duration of 0.5 seconds. Triggers detect this effect and can glean both the pickup and the picking up unit. The behavior disables the Pickup behavior, and destroys the pickup when it expires.
(B) (my preferred method) make a unique pickup behavior for each kind of pickup, which allows triggers to differentiate them. In this case, Pickup (Set) should refer to a unique effect for this kind of pickup, or just get rid of pickup (set) and have a unique Pickup Remove effect for each kind of pickup.
Oh man, thank you. I think I'd never have thought of this...
Np. It's pretty annoying when that kind of thing happens. I've run into it a few times, e.g. when triggers refer to items being sold. I don't know about the most recent updates, but at one time when I wanted to add a trigger response to item selling, I had to make a trigger that recorded when a unit was ordered to sell an item, and then another that actually fired when the item was sold. Only the first one could tell which item was sold, but only the second trigger knew whether the item was actually sold, and not just ordered to be sold.