Through some tinkering figured a way to respawn non building units, this is mostly from Onetwo's unit death and item drops.
You'll want to start by making a global unit type variable, check array and leave it on no game link.
Make a new trigger name it something you'll remember like Define Mobs, set variable action, set it to the global var that was just made and change the variable to the unit you want to respawn, leave the 0 in the brackets alone. Repeat the process for as many mobs you want to respawn , add a comment above the set variables if your going to have other player sets besides player 15 the player(s) would fight, make sure to uncheck initially on in the right click options for the trigger.
New trigger name it preferably the player group the player(s) would fight and in event create a any unit dies(Event > Unit > Unit Dies) leave it as it is and make two variables, a unit type and point: unit type variable set to function > unit type of unit and the point variable function > position of unit. The naming of the variable left as Dieing unit with the type of variable they are(unit, position), now make a comparison condition and change the integer to the player group 15.
Make a If Then action, under if make a and condition, under and make another condition this one comparison and change the open parenthesis to unit type of unit, leave triggering unit alone and change the integer to to the global mob variable that has the data of specific units you want to respawn. Under then a General wait, set how long you want to wait till the mob respawns. New action Create units facing angle, change the first unit to your dieing unit type variable, 1 to 15, the point to your dieing unit position variable and the angle to a random facing found under function. One more trigger to add which is a general skip remaining actions. Now before you go in thinking it will just work there is one trigger we need to add in the initialization file, make a run trigger and point it to your mob definition trigger, so when the if then goes off it will check to see if the unit is within that array. So now you should be able to copy and paste your If Thens changing the array integer to the corresponding unit in your definition trigger, and that is set for 1 player group just copy the whole trigger if your using more then one group
Through some tinkering figured a way to respawn non building units, this is mostly from Onetwo's unit death and item drops.
You'll want to start by making a global unit type variable, check array and leave it on no game link.
Make a new trigger name it something you'll remember like Define Mobs, set variable action, set it to the global var that was just made and change the variable to the unit you want to respawn, leave the 0 in the brackets alone. Repeat the process for as many mobs you want to respawn , add a comment above the set variables if your going to have other player sets besides player 15 the player(s) would fight, make sure to uncheck initially on in the right click options for the trigger.
New trigger name it preferably the player group the player(s) would fight and in event create a any unit dies(Event > Unit > Unit Dies) leave it as it is and make two variables, a unit type and point: unit type variable set to function > unit type of unit and the point variable function > position of unit. The naming of the variable left as Dieing unit with the type of variable they are(unit, position), now make a comparison condition and change the integer to the player group 15.
Make a If Then action, under if make a and condition, under and make another condition this one comparison and change the open parenthesis to unit type of unit, leave triggering unit alone and change the integer to to the global mob variable that has the data of specific units you want to respawn. Under then a General wait, set how long you want to wait till the mob respawns. New action Create units facing angle, change the first unit to your dieing unit type variable, 1 to 15, the point to your dieing unit position variable and the angle to a random facing found under function. One more trigger to add which is a general skip remaining actions. Now before you go in thinking it will just work there is one trigger we need to add in the initialization file, make a run trigger and point it to your mob definition trigger, so when the if then goes off it will check to see if the unit is within that array. So now you should be able to copy and paste your If Thens changing the array integer to the corresponding unit in your definition trigger, and that is set for 1 player group just copy the whole trigger if your using more then one group
Good tutorial!
You inspired me to maybe do one myself in the future on my channel...