• 🏆 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!

Destructible Respawn Issue

Status
Not open for further replies.
Level 30
Joined
Jul 31, 2010
Messages
5,246
I've been making a trigger that resurrects a destructible + a custom item table attached, but the problem is that when the said destructible has resurrected the custom item table is gone, what do I do in such case?

here's the destructible resurrection trigger:
  • Respawn Destructible
    • Events
      • Destructible - A destructible within Destructible <gen> dies
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • Destructible - Resurrect (Dying destructible) with (Max life of (Last created destructible)) life and Show birth animation
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
I've been making a trigger that resurrects a destructible + a custom item table attached, but the problem is that when the said destructible has resurrected the custom item table is gone, what do I do in such case?

here's the destructible resurrection trigger:
  • Respawn Destructible
    • Events
      • Destructible - A destructible within Destructible <gen> dies
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • Destructible - Resurrect (Dying destructible) with (Max life of (Last created destructible)) life and Show birth animation

And what do you mean by custom item table?
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
@ Hell_Master
This

222907-albums6224-picture69320.jpg


@Orcnet

maybe set those items in an item variable then create them once the destructible dies.

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set item_var[1] = Claws of Attack +15
      • Set item_var[2] = Crown of Kings +5
      • Set item_var[3] = Kelen's Dagger of Escape
  • Destructible
    • Events
      • Destructible - Summer Tree Wall 0000 <gen> dies
    • Conditions
    • Actions
      • Item - Create item_var[(Random integer number between 1 and 3)] at (Position of (Dying destructible))
      • Set destruc = (Dying destructible)
      • Wait 2.00 seconds
      • Destructible - Resurrect destruc with (Max life of destruc) life and Show birth animation
better set the destructible in a variable coz it might get overwritten in the wait part..
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Orcnet, we all know that when we used a respawn system, Item Table wont drop when they are to be revived so I suggest make a triggers for the drop like what we do when we trigger a unit's drop.

Triggers are more efficient to use in item drops when it comes to units or destructible that are revivable because item drop table cannot be recycled and will not anymore work on the next time a destrcutible is to be revived again.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
that way will not work as the variable will be overwritten if a destructible dies b4 the wait is over. Instead try this.

  • Destructible
    • Events
      • Destructible - A destructible within Destructible <gen> dies
    • Conditions
    • Actions
      • Custom script: local destructible udg_destruct = GetTriggerDestructable()
      • Set tempPoint = (Position of (Dying destructible))
      • Item - Create item_var[(Random integer number between 1 and 3)] at tempPoint
      • Wait 2.00 seconds
      • Destructible - Resurrect destruc with (Max life of destruc) life and Show birth animation
      • Custom script: call RemoveLocation( udg_tempPoint)
      • Custom script: set udg_tempPoint = null
      • Custom script: set udg_destruct = null
For the item table u should use an item drop system. the table only works for preplaced units.
If ur only making one item drop table through triggers tho use hell masters option.
 
Last edited:
Level 30
Joined
Nov 29, 2012
Messages
6,637
that way will not work as the variable will be overwritten if a destructible dies b4 the wait is over. Instead try this.

  • Destructible
    • Events
      • Destructible - Summer Tree Wall 0000 <gen> dies
    • Conditions
    • Actions
      • Custom script: local destructible udg_destruct = GetTriggerDestructable()
      • Set tempPoint = (Position of (Dying destructible))
      • Item - Create item_var[(Random integer number between 1 and 3)] at tempPoint
      • Wait 2.00 seconds
      • Destructible - Resurrect destruc with (Max life of destruc) life and Show birth animation
      • Custom script: call RemoveLocation( udg_tempPoint)
      • Custom script: set udg_tempPoint = null
      • Custom script: set udg_destruct = null
For the item table u should use an item drop system. the table only works for preplaced units.
If ur only making one item drop table through triggers tho use hell masters option.

But does a Summer Tree Wall 000 only points ON A SPECIFIC destructible and not all types of destructible? So, I think it is better to scan each destructible within the playable map area. And also why did you use an Item Var raandom integer from 1 to 3 if there is nothing set from those numbers?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
look up at the map init trigger. the item array is set there. This is how he wanted to create an item. its not a good idea to scan for every destructible in map area. This event runs when a destructible dies. So i then store the destructible into a local variable and use that after a wait.
Yes it was unneeded to do it this way. I didnt notice it was only for one specific destructible lol. But if he wants this to resurrect all destructibles in one simple trigger.
 
Status
Not open for further replies.
Top