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

Mobs revive

Status
Not open for further replies.
Level 3
Joined
Jan 2, 2010
Messages
34
Hi ;)
I have a spot with 3 mobs

  • Trigger
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set Mobs[1] = Spider 0011 <gen>
      • Set Mobs_Spot[1] = (Position of Spider 0011 <gen>)
      • Set Mobs[2] = Giant Spider 0012 <gen>
      • Set Mobs_Spot[2] = (Position of Giant Spider 0012 <gen>)
      • Set Mobs[3] = Gnoll 0013 <gen>
      • Set Mobs_Spot[3] = (Position of Gnoll 0013 <gen>)
And i wanted to revive mobs when they die so i created a trigger

  • Trigger
    • Events
      • Unit - A unit die
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Codnitions
              • (Dying unit) Equal to Mobs[(Integer A)]
            • Then - Actions
              • Wait 30.00 seconds
              • Unit - Create 1 (Unit-type of (Dying unit)) for Neutral - Enemy at Mobs_Spot[(Integer A)]
              • Set - Mobs[(Integer A)] = (Last created unit)
            • Else - Conditions
But it's don't create a mobs :(
Help me please ;(
 
The loop is not used properly. Since the unit-types are only 3, do this:
  • Trigger
  • Events
    • Unit - A unit dies
  • Conditions
    • Or - Conditions
      • (Unit-type of (Triggering unit)) Equal to Spider
      • (Unit-type of (Triggering unit)) Equal to Giant Spider
      • (Unit-type of (Triggering unit)) Equal to Gnoll
  • Actions
    • Set Point1 = (Position of (Triggering unit))
    • Wait 30.00 seconds
    • Unit - Create 1 (Unit-type of (Triggering unit)) at Point1 facing default building degrees
    • Custom script: call RemoveLocation (udg_Point1)
 
Level 9
Joined
Jun 7, 2007
Messages
195
  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
      • (Unit-type of (Triggering unit)) Equal to Footman
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: local integer u_id = GetUnitTypeId( u )
      • Custom script: local real X = GetUnitX( u )
      • Custom script: local real Y = GetUnitY( u )
      • Custom script: call TriggerSleepAction( 30.00 )
      • Custom script: call CreateUnit( GetOwningPlayer( u ), u_id, X, Y, 270 )
      • Custom script: set u = null
 
Level 12
Joined
Nov 20, 2007
Messages
660
  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
      • (Unit-type of (Triggering unit)) Equal to Footman
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: local integer u_id = GetUnitTypeId( u )
      • Custom script: local real X = GetUnitX( u )
      • Custom script: local real Y = GetUnitY( u )
      • Custom script: call TriggerSleepAction( 30.00 )
      • Custom script: call CreateUnit( GetOwningPlayer( u ), u_id, X, Y, 270 )
      • Custom script: set u = null

I think that's too advanced for him ...
 
Level 12
Joined
Nov 20, 2007
Messages
660
dude, try this:
Respawn System
  • Respawn Settings
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set Respawn_Time = 30.00
      • Set Hostiles = (Units in (Playable map area) owned by Neutral Hostile)
      • Unit Group - Pick every unit in Hostiles and do (Actions)
        • Loop - Actions
          • Set Temp_Integer = (Temp_Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Temp_Integer
          • Set Creep_Point[Temp_Integer] = (Position of (Picked unit))
  • Creeps Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A structure) Not equal to True
      • ((Dying unit) is Summoned) Not equal to True
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • Custom script: local integer i = GetUnitTypeId(GetTriggerUnit())
      • Custom script: local integer ii = GetUnitUserData(GetTriggerUnit())
      • -------- Loot Start --------
      • Wait Respawn_Time game-time seconds
      • Custom script: call SetUnitUserData(CreateUnit(Player(12),i,GetLocationX(udg_Creep_Point[ii]),GetLocationY(udg_Creep_Point[ii]),270),ii)
If u don't get it, Click Here
And don't forget to give +rep
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
dude, try this:
Respawn System
  • Respawn Settings
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set Respawn_Time = 30.00
      • Set Hostiles = (Units in (Playable map area) owned by Neutral Hostile)
      • Unit Group - Pick every unit in Hostiles and do (Actions)
        • Loop - Actions
          • Set Temp_Integer = (Temp_Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Temp_Integer
          • Set Creep_Point[Temp_Integer] = (Position of (Picked unit))
  • Creeps Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A structure) Not equal to True
      • ((Dying unit) is Summoned) Not equal to True
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • Custom script: local integer i = GetUnitTypeId(GetTriggerUnit())
      • Custom script: local integer ii = GetUnitUserData(GetTriggerUnit())
      • -------- Loot Start --------
      • Wait Respawn_Time game-time seconds
      • Custom script: call SetUnitUserData(CreateUnit(Player(12),i,GetLocationX(udg_Creep_Point[ii]),GetLocationY(udg_Creep_Point[ii]),270),ii)
If u don't get it, Click Here
And don't forget to give +rep

So you are using other peoples triggers, for your own purpose, and asking for reputation? (facepalm)
 
Status
Not open for further replies.
Top