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

[Trigger] Respawn creeps at their starting position

Status
Not open for further replies.
Level 5
Joined
Jun 25, 2005
Messages
92
I just downloaded "EZ Spawnsystem", which respawns one creep of the same type of its starting position, if it was killed. I need the trigger to make a Troll-Tribe-map...

I modified the trigger just a bit, but if a creep was killed there spawned some random units. The basic trigger was working well, I think I made a mistake...

But what did I do wrong?




  • SpawnSystem Initialization
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • Auslöser - Run SpawnSystem Spawnunit <gen> (checking conditions)
      • Wait 1.00 seconds
      • Auslöser - Run SpawnSystem Spawnpoint <gen> (checking conditions)
  • SpawnSystem Respawn
    • Ereignisse
      • Einheit - A unit owned by Neutral feindlich Stirbt
    • Bedingungen
    • Aktionen
      • Custom script: local unit udg_SystemSpawn_RespawnUnit
      • Custom script: local integer udg_SystemSpawn_RespawnUnitIndex
      • For each (Integer A) from 1 to 67, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Dying unit) Gleich SystemSpawn_SpawnUnit[(Integer A)]
            • 'THEN'-Aktionen
              • Set SystemSpawn_RespawnUnitIndex = (Integer A)
            • 'ELSE'-Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • SystemSpawn_RespawnUnitIndex Größer als 0
        • 'THEN'-Aktionen
          • Skip remaining actions
        • 'ELSE'-Aktionen
      • Einheit - Create 1 (Unit-type of (Dying unit)) for Neutral feindlich at ((Center of (Entire map)) offset by (SystemSpawn_SpawnPointX[SystemSpawn_RespawnUnitIndex], SystemSpawn_SpawnPointY[SystemSpawn_RespawnUnitIndex])) facing Vorgabe für Gebäude-Ausrichtung degrees
      • Set SystemSpawn_SpawnUnit[SystemSpawn_RespawnUnitIndex] = (Last created unit)
      • Set SystemSpawn_RespawnUnit = SystemSpawn_SpawnUnit[SystemSpawn_RespawnUnitIndex]
      • Einheit - Hide SystemSpawn_RespawnUnit
      • Wait 5.00 seconds
      • Einheit - Unhide SystemSpawn_RespawnUnit
  • SpawnSystem Spawnunit
    • Ereignisse
    • Bedingungen
    • Aktionen
      • Set SystemSpawn_SpawnUnit[1] = Wild wolf 0150 <gen>
      • Set SystemSpawn_SpawnUnit[2] = Wild wolf 0151 <gen>
      • Set SystemSpawn_SpawnUnit[3] = Crab 0152 <gen>
      • Set SystemSpawn_SpawnUnit[4] = Crab 0154 <gen>
      • Set SystemSpawn_SpawnUnit[5] = Crab 0153 <gen>
      • Set SystemSpawn_SpawnUnit[6] = Bear 0121 <gen>
      • Set SystemSpawn_SpawnUnit[7] = Wild pig 0133 <gen>
      • Set SystemSpawn_SpawnUnit[8] = Bear 0134 <gen>
      • Set SystemSpawn_SpawnUnit[9] = Treant 0135 <gen>
      • Set SystemSpawn_SpawnUnit[10] = Rabbit 0136 <gen>
      • Set SystemSpawn_SpawnUnit[11] = Rabbit 0137 <gen>
      • Set SystemSpawn_SpawnUnit[12] = Rabbit 0138 <gen>
      • Set SystemSpawn_SpawnUnit[13] = Treant 0141 <gen>
      • Set SystemSpawn_SpawnUnit[14] = Treant ancient 0139 <gen>
      • Set SystemSpawn_SpawnUnit[15] = Treant 0140 <gen>
      • Set SystemSpawn_SpawnUnit[16] = Wild dog 0143 <gen>
      • Set SystemSpawn_SpawnUnit[17] = Wild dog 0142 <gen>
      • Set SystemSpawn_SpawnUnit[18] = Raccoon 0144 <gen>
      • Set SystemSpawn_SpawnUnit[19] = Skink 0145 <gen>
      • Set SystemSpawn_SpawnUnit[20] = Skink 0146 <gen>
      • Set SystemSpawn_SpawnUnit[21] = Skink 0147 <gen>
      • Set SystemSpawn_SpawnUnit[22] = Raccoon 0149 <gen>
      • Set SystemSpawn_SpawnUnit[23] = Treant ancient 0158 <gen>
      • Set SystemSpawn_SpawnUnit[24] = Treant 0159 <gen>
      • Set SystemSpawn_SpawnUnit[25] = Treant 0160 <gen>
      • Set SystemSpawn_SpawnUnit[26] = Treant 0161 <gen>
      • Set SystemSpawn_SpawnUnit[27] = Treant 0162 <gen>
      • Set SystemSpawn_SpawnUnit[28] = Treant 0164 <gen>
      • Set SystemSpawn_SpawnUnit[29] = Treant 0163 <gen>
      • Set SystemSpawn_SpawnUnit[30] = Treant ancient 0165 <gen>
      • Set SystemSpawn_SpawnUnit[31] = Treant 0167 <gen>
      • Set SystemSpawn_SpawnUnit[32] = Treant 0166 <gen>
      • Set SystemSpawn_SpawnUnit[33] = Treant ancient 0168 <gen>
      • Set SystemSpawn_SpawnUnit[34] = Treant 0170 <gen>
      • Set SystemSpawn_SpawnUnit[35] = Treant 0169 <gen>
      • Set SystemSpawn_SpawnUnit[36] = Piranhia 0171 <gen>
      • Set SystemSpawn_SpawnUnit[37] = Piranhia 0172 <gen>
      • Set SystemSpawn_SpawnUnit[38] = Piranhia 0173 <gen>
      • Set SystemSpawn_SpawnUnit[39] = Piranhia 0174 <gen>
      • Set SystemSpawn_SpawnUnit[40] = Piranhia 0177 <gen>
      • Set SystemSpawn_SpawnUnit[41] = Piranhia 0176 <gen>
      • Set SystemSpawn_SpawnUnit[42] = Piranhia 0175 <gen>
      • Set SystemSpawn_SpawnUnit[43] = Fel treant 0178 <gen>
      • Set SystemSpawn_SpawnUnit[44] = Fel treant 0179 <gen>
      • Set SystemSpawn_SpawnUnit[45] = Fel treant 0181 <gen>
      • Set SystemSpawn_SpawnUnit[46] = Fel treant 0180 <gen>
      • Set SystemSpawn_SpawnUnit[47] = Treant 0182 <gen>
      • Set SystemSpawn_SpawnUnit[48] = Treant 0183 <gen>
      • Set SystemSpawn_SpawnUnit[49] = Treant 0186 <gen>
      • Set SystemSpawn_SpawnUnit[50] = Treant 0185 <gen>
      • Set SystemSpawn_SpawnUnit[51] = Treant ancient 0184 <gen>
      • Set SystemSpawn_SpawnUnit[52] = Snake 0188 <gen>
      • Set SystemSpawn_SpawnUnit[53] = Treant 0189 <gen>
      • Set SystemSpawn_SpawnUnit[54] = Wild wolf 0190 <gen>
      • Set SystemSpawn_SpawnUnit[55] = Wild wolf 0191 <gen>
      • Set SystemSpawn_SpawnUnit[56] = Treant 0192 <gen>
      • Set SystemSpawn_SpawnUnit[57] = Treant 0193 <gen>
      • Set SystemSpawn_SpawnUnit[58] = Wild pig 0194 <gen>
      • Set SystemSpawn_SpawnUnit[59] = Rabbit 0196 <gen>
      • Set SystemSpawn_SpawnUnit[60] = Rabbit 0195 <gen>
      • Set SystemSpawn_SpawnUnit[61] = Rabbit 0198 <gen>
      • Set SystemSpawn_SpawnUnit[62] = Rabbit 0197 <gen>
      • Set SystemSpawn_SpawnUnit[63] = Rabbit 0199 <gen>
      • Set SystemSpawn_SpawnUnit[64] = Rabbit 0200 <gen>
      • Set SystemSpawn_SpawnUnit[65] = Rabbit 0202 <gen>
      • Set SystemSpawn_SpawnUnit[66] = Rabbit 0201 <gen>
      • Set SystemSpawn_SpawnUnit[67] = Murloc-hunter 0203 <gen>
  • SpawnSystem Spawnpoint
    • Ereignisse
    • Bedingungen
    • Aktionen
      • For each (Integer A) from 1 to 67, do (Actions)
        • Schleifen - Aktionen
          • Set SystemSpawn_SpawnPointX[(Integer A)] = (X of (Position of SystemSpawn_SpawnUnit[(Integer A)]))
          • Set SystemSpawn_SpawnPointY[(Integer A)] = (Y of (Position of SystemSpawn_SpawnUnit[(Integer A)]))
 
Last edited:
Level 5
Joined
Jun 25, 2005
Messages
92
sorry, I wanted to add them, but couldn't find the tag xD

the tutorials just say "add a trigger tag", but not how to add them...
bad help for a noob / newcomer like me...
 
Level 15
Joined
Jan 31, 2007
Messages
502
First of all - Welcome to The Hive Workshop :)
To create Trigger tag just click on the lil "trigger" icon or use [.TRIGGER][./TRIGGER] ( without the dots )
And please add trigger tags or even do not copy and paste the text because many parts are still german of your editor and i guess not everyone knows e.g what an "Einheit" is

I think the creation of the unit is the wrong thing because you create the unit at the center offset the X and Y values instead of creating if directly at the Position
"at ((Center of (Entire map)) offset by (SystemSpawn_SpawnPointX[SystemSpawn_RespawnUnitIndex], SystemSpawn_SpawnPointY[SystemSpawn_RespawnUnitIndex]))"
=> Should be :
  • Unit - Create 1 (Unit-type of (Dying unit)) for Neutral agressive at (Point(SystemSpawn_SpawnPointX[SystemSpawn_RespawnUnitIndex], SystemSpawn_SpawnPointY[SystemSpawn_RespawnUnitIndex]) facing 0 degree
And please add trigger tags or even do not copy and paste thee text because many parts are still german of your editor
 
Level 5
Joined
Apr 24, 2007
Messages
90
Why are yours so complicated? The easiest thing to do is:
Event: A unit dies
Condition: (Colour of (Owner of triggering unit)) = Black
Action: Create 1 (unit-type of (triggering unit) for Neutral Hostile at (postion of (triggering unit)) facing default bulding facing degrees.
tht easy thts wat i use in my maps and it works perfectly. You may want to add a wait trigger though.
 
Level 11
Joined
Jul 12, 2005
Messages
764
paskovich said:
Two-line trigger:
  • Wait x seconds
  • Create unit at (Position of Triggering unit) ..
-> this will create the newest breed where the other died, and not where they should camp..

Mine:
-Requires 1 trigger only
-Does not use global variables
-Does not uses the units' custom value
-Uses coordinates instead of locations --> leak free
-Revives creeps at their initial locations
-Also stores the initial facing of the creeps
 
Level 5
Joined
Jun 25, 2005
Messages
92
First at all: thanks for the help. :)

I now tried it like that... simple and easy, like the first try:

  • Creep Respawn
    • Ereignisse
      • Einheit - A unit Stirbt
    • Bedingungen
      • (Owner of (Triggering unit)) Gleich Neutral feindlich
    • Aktionen
      • Wait 2.00 seconds
      • Einheit - Create 1 (Unit-type of (Triggering unit)) for Neutral feindlich at (Position of (Triggering unit)) facing (Random point in (Playable map area))

It works... oh. Now I remember why I didn't use this one. If I use this trigger, the unit respawns at the position, where it dies, but
they have to respawn at their STARTING position. The unit mustn't respawn at another point, than it's started. I'm making a Troll Tribe Map, so I want the units to walk around, but everytime they die, they have to respawn at their starting position. That's why it's so complicated. :p

Hope you can help me... :)
 
Level 2
Joined
May 31, 2007
Messages
20
Mine consist out of 2 triggers, if you want it being MUI you have to translate the second Trigger into JASS and use a local integer.

The Init Trigger
  • RInit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set tmp_group = (Units in (Playable map area) owned by Neutral Hostile)
      • Unit Group - Pick every unit in tmp_group and do (Actions)
        • Loop - Actions
          • Set RPoint[integer] = (Position of (Picked unit))
          • Set RType[integer] = (Unit-type of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to integer
          • Set integer = (integer + 1)
      • Custom script: call DestroyGroup(udg_tmp_group)
And the revive Trigger
  • RAction
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • -------- To make this trigger MUI change it into JASS and remove the '//' from the follwing lines --------
      • -------- Also change all custom data things to the local integer. --------
      • -------- local integer WhichType = GetUnitUserData(GetTriggerUnit()) --------
      • Wait 5.00 seconds
      • Unit - Create 1 RType[(Custom value of (Triggering unit))] for Neutral Hostile at RPoint[(Custom value of (Triggering unit))] facing Default building facing (270.0) degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
 
Level 5
Joined
Jun 25, 2005
Messages
92
@Fireeye

Hm, looks good, but I'm not skilled enough to make the trigger by myself into GUI. Please post a testmap with the trigger, so I can test it.

If it works well, I'll give you credits and use the trigger in my map. :D
 
Level 5
Joined
Jun 25, 2005
Messages
92
@-Johnny:Thanks for the trigger. Yes, I'm going to learn it, but without examples it's hard to see how WE works the best way. Oh, I also will give you credits. :)

I first tried to do this trigger by myself.
I tried it, so do not complain! :D
 
Level 3
Joined
Jun 14, 2007
Messages
33
Johnny, not complaining, but I tried it too... and when I kill a unit it respawns but then when I kill it again, I waitied about 15 seconds (I set for 10 seconds) and it does not respawn, do you know what might be the problem?
 
Level 4
Joined
Dec 15, 2007
Messages
108
so waht is the best STARTING POSITION revival system?

and it would be perfect if it possbile when no units in map coz i can only place some more creeps
 
Status
Not open for further replies.
Top