• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger event at powerup use

Status
Not open for further replies.
Level 2
Joined
Aug 6, 2022
Messages
9
Hi,

Is there a way to detect if a powerup has been picked up (like Tome of Strength)? I would like to respawn it after a few seconds, but my triggers can't seem to detect the correct event...
In my triggers I've tried the "A unit acquires an item" and "A unit uses an item" events, but none of them seem to start the trigger (I refer to the item as "Item being manipulated" in the conditions and actions).
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
Something like this?
 
Level 2
Joined
Aug 6, 2022
Messages
9
Still no for me, maybe the problem is in the condition? I use it to check which item it is, since I don't want it to apply to all powerups. But maybe the condition doesn't work since the item is not in the region anymore after the event?
  • Respawn tome 1
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Item being manipulated) is in Revive Strength tome <gen>) Equal to True
    • Actions
      • Set loc_Tome = (Center of Revive Strength tome <gen>)
      • Wait 5.00 seconds
      • Item - Create (Item-type of (Item being manipulated)) at loc_Tome
      • Custom script: call RemoveLocation(udg_loc_Tome)
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
Pretty sure the item isn't in the location anymore, since a unit acquired it.

Maybe it would be enough to check if your triggering unit is in the region?
 
Pretty sure the item isn't in the location anymore, since a unit acquired it.

Maybe it would be enough to check if your triggering unit is in the region?
I'm pretty sure that power-ups linger after being picked up (unsure if they "leak", I.E. linger forever or just a while) but getting the location should be fine as far as I know...
 
Level 2
Joined
Aug 6, 2022
Messages
9
Pretty sure the item isn't in the location anymore, since a unit acquired it.

Maybe it would be enough to check if your triggering unit is in the region?
Thanks, I'll try that. Need to make the region bigger, to make sure the unit will be in it :)
 
Level 2
Joined
Aug 6, 2022
Messages
9
It worked! I replaced the condition with "Region contains triggering unit" and the trigger executed normally. Thanks all for your help!
 
Status
Not open for further replies.
Top