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

Custom Hero Arena style creep system

Status
Not open for further replies.
Level 10
Joined
Jan 20, 2011
Messages
492
Hey guys, I'm wondering if anyone could help me with a Custom Hero Arena type creep system.

What is this you ask? It's were if a unit dies at any time, a unit will spawn after a specific number of seconds on in the same position it originally was, but this unit that just spawned shall be completely different.

So say I kill a wolf level 2, I want a Troll Level 3 to spawn in it's location 30 seconds later.

I know that I will need to store all of the units within arrays, but I don't no how to get started as in after I store these units within. I have asked Glorn2, but no reply. So if anyone could point me in the right direction, or do anything to help, it would be much appreciated.

Note: I will be using several different groups of creeps within that can only spawn based on it's group, and will not spawn if another unit from another group dies, for example;

Group Easy: Wolf level 2 dies --> troll level 3 spawns --> troll dies --> Knight Level 4 Spawns
Group Medium: Grey Wolf Level 3 Dies ---> Troll Shaman Level 4 spawns --> Troll Shaman Dies ---> Hydra Level 5 Spawns
Group Hard: Dire Wolf Level 5 Dies ---> Troll Warlord Level 6 Spawns ---> Troll Warlord Dies ---> Rock Golem Spawns

So a Dire Wolf will not spawn a Troll Shaman, since they are in different groups.

Thanks for any help guys and for taking time to read this. If more information is needed for you to understand just let me know.
 
Last edited:
Level 6
Joined
Feb 5, 2012
Messages
1,685
If you ask how to start

Store all unit types or even number of seconds into arrays in Init Creep Spawn (map initialization)

You need timers here.. but because it is MUI let's just wait for some experts around here but i am sure that one of your trigger will use Unit Dies event then the Timer will run then after the timer it will create units..
 
Level 8
Joined
Jul 7, 2013
Messages
141
I think you can do this with several triggers and some arrays.

On the first trigger, it should detect if the creep camp dies. When that camp does die, use an integer array and add 1 to it. you can refer to this integer array to determine what level of creep you are already in. You can use unit type/unit group arrays for your creep camps.

In the second trigger, you can just create a periodic that would check the integer amount and create new creeps according to the integer array and that should be it.
 
Level 13
Joined
Jan 30, 2012
Messages
1,298
here the trigger
  • Creep Revival System Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set Integer = (Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Integer
          • Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
          • Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())
  • Revive Creeps 1 by 1
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    • Actions
      • Wait 5.00 game-time seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing (Random angle) degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
replace this line
  • Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing (Random angle) degrees
with
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Triggering unit)) Equal to Wolf
    • Then - Actions
      • Unit - Create 1 troll for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing (Random angle) degrees
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Triggering unit)) Equal to troll
    • Then - Actions
      • Unit - Create 1 Knight for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing (Random angle) degrees
    • Else - Actions
 
Level 10
Joined
Jan 20, 2011
Messages
492
Ok guys thank you for the help so far, but I still have two more inquires now;

1. Since the Unit dies trigger has a wait in it would a second unit dieing overwrite the first trigger (As in stop it and reset it), so here's an example;\

First Unit Dies - 1st Unit Die Trigger Runs
Second Unit Dies - 2nd Unit Dies Trigger Runs

The 2nd trigger goes off half way through the first, will it run independently or will it overwrite the first trigger and restart it?

2. I will need loops for the spawn part, and I have a trigger in mind how to do it, but the only problem is if the first answer is "that it runs independently", how am I going to do the Loop, without it getting new information from the second (So Loop could be at 15, and then another one just starts sending the loop variable back to one)?

So I will give an example;
  • For Integer Variable 1 to 20
    • Loop
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to UnitHard[Variable]
        • Then - Actions
          • Unit - Create 1 UnitHard[Variable +1] for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing (Random angle) degrees
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Triggering unit)) Equal to UnitEasy[Variable]
          • Then - Actions
            • Unit - Create 1 UnitEasy[Variable +1] for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing (Random angle) degrees
      • Else - Actions
So as you can see if I was to do a loop when two independent triggers are running it would glitch up? (Not sure) So how do I counter this

EDIT: Apparently it works so far, but if anyone sees a problem could they let me know (besides leaks)
 
Last edited:
Level 10
Joined
Jan 20, 2011
Messages
492
Ok guys, so I have a trigger, and it seemed to be working, but for some reason it respawn every unit except for my Skeletons, which are based off the Orc Skeletons (Sunken Ruins). I have them done the same way as every other unit and they work fine, but not the skeletons.

  • Creep Respawn Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set UnitTroll1[1] = Island Troll (Level 2)
      • Set UnitTroll1[2] = Island Troll (Level 3)
      • Set UnitTroll1[3] = Island Troll (Level 4)
      • Set UnitTroll2[1] = Island Troll Shaman (Level 3)
      • Set UnitTroll2[2] = Island Troll Shaman (Level 4)
      • Set UnitTroll2[3] = Island Troll Shaman (Level 5)
      • Set UnitTroll3[1] = Forest Troll Champion (Level 5)
      • Set UnitTroll3[2] = Forest Troll Champion (Level 6)
      • Set UnitTroll3[3] = Forest Troll Champion (Level 7)
      • Set UnitCrab1[1] = Crab Limbripper (Level 2)
      • Set UnitCrab1[2] = Crab Limbripper (Level 3)
      • Set UnitCrab1[3] = Crab Limbripper (Level 4)
      • Set UnitCrab2[1] = Crab Behemoth (Level 3)
      • Set UnitCrab2[2] = Crab Behemoth (Level 4)
      • Set UnitCrab2[3] = Crab Behemoth (Level 5)
      • Set UnitSkele1[1] = Skeleton (Level 3)
      • Set UnitSkele1[2] = Skeleton (Level 4)
      • Set UnitSkele1[3] = Skeleton (Level 5)
      • Set UnitSkele2[1] = Skeleton Champion (Level 5)
      • Set UnitSkele2[2] = Skeleton Champion (Level 6)
      • Set UnitSkele2[3] = Skeleton Champion (Level 7)
      • Set Respawn_Time = 5.00
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set Integer = (Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Integer
          • Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
          • Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())
Don't mind the if statement spam
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
      • (Unit-type of (Triggering unit)) Not equal to Treasure Chest
    • Actions
      • Wait Respawn_Time game-time seconds
      • For each (Integer Variable) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitSkele1[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitSkele1[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitSkele2[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitSkele2[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitTroll1[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitTroll1[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitTroll2[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitTroll2[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitTroll3[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitTroll3[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitCrab1[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitCrab1[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitCrab2[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitCrab2[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions


Could anyone tell me why the skeletons aren't respawning? Any help would be appreciated.
 
Last edited:
Level 13
Joined
Jan 30, 2012
Messages
1,298
Ok guys, so I have a trigger, and it seemed to be working, but for some reason it respawn every unit except for my Skeletons, which are based off the Orc Skeletons (Sunken Ruins). I have them done the same way as every other unit and they work fine, but not the skeletons.

  • Creep Respawn Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set UnitTroll1[1] = Island Troll (Level 2)
      • Set UnitTroll1[2] = Island Troll (Level 3)
      • Set UnitTroll1[3] = Island Troll (Level 4)
      • Set UnitTroll2[1] = Island Troll Shaman (Level 3)
      • Set UnitTroll2[2] = Island Troll Shaman (Level 4)
      • Set UnitTroll2[3] = Island Troll Shaman (Level 5)
      • Set UnitTroll3[1] = Forest Troll Champion (Level 5)
      • Set UnitTroll3[2] = Forest Troll Champion (Level 6)
      • Set UnitTroll3[3] = Forest Troll Champion (Level 7)
      • Set UnitCrab1[1] = Crab Limbripper (Level 2)
      • Set UnitCrab1[2] = Crab Limbripper (Level 3)
      • Set UnitCrab1[3] = Crab Limbripper (Level 4)
      • Set UnitCrab2[1] = Crab Behemoth (Level 3)
      • Set UnitCrab2[2] = Crab Behemoth (Level 4)
      • Set UnitCrab2[3] = Crab Behemoth (Level 5)
      • Set UnitSkele1[1] = Skeleton (Level 3)
      • Set UnitSkele1[2] = Skeleton (Level 4)
      • Set UnitSkele1[3] = Skeleton (Level 5)
      • Set UnitSkele2[1] = Skeleton Champion (Level 5)
      • Set UnitSkele2[2] = Skeleton Champion (Level 6)
      • Set UnitSkele2[3] = Skeleton Champion (Level 7)
      • Set Respawn_Time = 5.00
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set Integer = (Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Integer
          • Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
          • Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())
Don't mind the if statement spam
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
      • (Unit-type of (Triggering unit)) Not equal to Treasure Chest
    • Actions
      • Wait Respawn_Time game-time seconds
      • For each (Integer Variable) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitSkele1[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitSkele1[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitSkele2[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitSkele2[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitTroll1[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitTroll1[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitTroll2[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitTroll2[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitTroll3[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitTroll3[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitCrab1[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitCrab1[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitCrab2[Variable]
            • Then - Actions
              • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
              • Unit - Create 1 UnitCrab2[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions


Could anyone tell me why the skeletons aren't respawning? Any help would be appreciated.

maybe try to link the ITE :\
 
Level 13
Joined
Jan 30, 2012
Messages
1,298
If Then Else

Ex:


  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Triggering unit)) Equal to UnitSkele1[Variable]
    • Then - Actions
      • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
      • Unit - Create 1 UnitSkele1[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Triggering unit)) Equal to UnitSkele2[Variable]
          • Then - Actions
            • Set tempPoint = (Point(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
            • Unit - Create 1 UnitSkele2[(Variable + 1)] for Neutral Hostile at tempPoint facing Default building facing degrees
            • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
            • Custom script: call RemoveLocation(udg_tempPoint)
          • Else - Actions
 
Status
Not open for further replies.
Top