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

Respawn trigger not working properly

Status
Not open for further replies.
Level 3
Joined
May 24, 2008
Messages
53
Well i have a trigger for a certain unit to respawn in a region after gets killed...
the thing is, i have more than one unit in 2 regions..
the unit gets respawned, but a few seconds later, a second unit respawns..
so if i kill 1 unit, i get 2 respawned
this is the trigger, i hope somebody can tell me how to fix it..
  • Respawn de Medu Dmara01
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Medusa
      • Or - Any (Conditions) are true
        • Conditions
          • (MeduDMara01 <gen> contains (Dying unit)) Equal to True
          • (MeduDMara02 <gen> contains (Dying unit)) Equal to True
    • Actions
      • Set drop = (Random integer number between 1 and 1000)
      • If ((drop Greater than or equal to 1) and (drop Less than or equal to 33)) then do (Item - Create Amulet of the Wild at (Position of (Dying unit))) else do (If ((drop Greater than or equal to 34) and (drop Less than or equal to 60)) then do (Item - Create Demonic Figurine at (Position of (Dying unit))) else do (If ((drop Greater than or equal to 105) and (drop Less than or equal to 200)) then do (Item - Create I
      • Wait until (((Picked unit) is dead) Equal to True), checking every 1.00 seconds
      • Wait 2.00 seconds
      • Set MedusREsp = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MedusREsp Greater than 50
        • Then - Actions
          • Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at (Random point in MeduDMara01 <gen>) facing (Random angle) degrees
        • Else - Actions
          • Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at (Random point in MeduDMara02 <gen>) facing (Random angle) degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
 
Level 13
Joined
Mar 24, 2010
Messages
950
this is a better way i think.

  • Respawn 3 Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Temp_Integer = 1
      • Set Temp_UnitGroup = (Units owned by Player 12 (Brown))
      • Unit Group - Pick every unit in Temp_UnitGroup and do (Actions)
        • Loop - Actions
          • Set graveyardpoint[Temp_Integer] = (Position of (Picked unit))
          • Set graveyardunit[Temp_Integer] = (Unit-type of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to Temp_Integer
          • Set Temp_Integer = (Temp_Integer + 1)
      • Custom script: call DestroyGroup (udg_Temp_UnitGroup)
  • Respawn 3
    • Events
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
    • Actions
      • Wait 60.00 seconds
      • Unit - Create 1 graveyardunit[(Custom value of (Dying unit))] for Player 12 (Brown) at graveyardpoint[(Custom value of (Dying unit))] facing Default building facing degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Dying unit))
you can mod it to your liking :)
 
  • Wait until (((Picked unit) is dead) Equal to True), checking every 1.00 seconds
Part of the problem lies here. There is no "Picked Unit". Do you mean dying unit? If you mean dying unit, the condition is useless as the dying unit is obviously already dead and will always return true.

Do you mean wait until the game has removed the unit from existence? That is handled differently.
 
Level 3
Joined
May 24, 2008
Messages
53
@Lightbolt
Didn't found the "Revive unit"
@Bond009
I need the unit to respawn at a random point in a region, not always in the same place..
@Bribe
that was disabled in my editor(aswell as the 2 second wait), when i copied that, it didn't show..

Anyway, i "fixed" the problem by removing the last created unit, so i only get one unit..

Thanks a lot, though!!
 
Status
Not open for further replies.
Top