• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Creeps Respawn Help

Status
Not open for further replies.
Level 5
Joined
May 27, 2007
Messages
126
If you mean, respawn X seconds after they died:

Trigger I
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Respawn_Time = 10.00
      • Unit Group - Pick every unit in (Units in (Entire map) owned by Player Neutral Hostile) 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))
Trigger II
  • The Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player Neutral Hostile
      • (Custom value of (Triggering unit)) Greater than 0
    • Actions
      • Wait 20.00 seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for Player Neutral Hostile at Creep_Point[(Custom value of (Triggering unit))] facing 270.00 degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
Trigger III
  • Add Creep to Respawn
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player Neutral Hostile
    • Actions
      • Set Temp_Integer = (Temp_Integer + 1)
      • Unit - Set the custom value of (Triggering unit) to Temp_Integer
      • Set Creep_Point[Temp_Integer] = (Position of (Triggering unit))
Variables that are included:

Respawn_Time:

Typ: Real
Value: (0) Default (NO ARRAYS!!)

Temp_Integer

Typ: Integer
Value: (0) Default (NO ARRAYS!!)

Creep_Point

Typ: Point
Value: none (ARRAY: Size: 1)

What this does ingame:

Whenever a creep of player neutral hostile (you can change in whatever player that is possible in Warcraft III) dies, the game will wait 10 seconds, according to the trigger:

  • Set Respawn_Time = 10.00
If you want to make the respawn take longer or shorter, then you just have to change the value "10.00" in something else!


Hope this works for you!


Merry christmas, and a happy new year! :D

Syntic
 
Level 6
Joined
Dec 9, 2008
Messages
233
Trigger I

Map initialization --- create point 1 on unit's position ( your creep)

Trigger II

Unit dies
Dying unit equal to Your creep
Create 1 Your creep at point 1

I think you can do it like this, but you'll have to use JNGP
 
Level 5
Joined
May 27, 2007
Messages
126
Unit - Create 1 (Unit-type of (Triggering unit)) for Player Neutral Hostile at Creep_Point[(Custom value of (Triggering unit))] facing 270.00 degrees

However this isn't good, as if you dragged a creep from the camp, the other creep will respawn away of the camp. You must create a region I think at the camp.

the unit DOES respawn at the old spot =) tried it out
 
Status
Not open for further replies.
Top