HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A great creeps respawn trigger

04-10-2004, 02:22 AM#1
Deathperception
I made this trigger after hours of searching for a triggers that will spawn and remove the corpses on my open rpg here it is.

First place a unit anywhere on the map. Next make the first trigger that will respawn the unit or units when they die. You probably could figure this one out yourself.

Event
Unit - A unit owned by Player 9 (Gray) Dies (or whatever player color your creeps belong to)

Conditions
No Conditions

Action
Unit - Create 1 (Unit-type of (Dying unit)) for Player 9 (Gray) at (Position of (Dying unit)) facing Default building facing (270.0) degrees

Now create another trigger this one will remove the corpses of every unit that dies on your map.

Event
Time - Every 120.00 seconds of game time
Or how many seconds you want the corpses to stay until they are removed.

Conditions
No Conditions

Actions
Unit Group - Pick every unit in (Units in (Playable map area)(((Matching unit) is dead) Equal to True)) and do (Unit - Remove (Picked unit) from the game)

With this simple trigger you can remove all corpses on your map without making multiple triggers. :>
04-10-2004, 01:40 PM#2
giiefgii
This will respawn the creeps as soon as they die, I don't think many people want that.
04-11-2004, 10:48 AM#3
Anitarf
Also, the removal trigger will remove corpses every 120 sec, not after 120 sec, so, if you kill an enemy unit at the right time, it's corpse will dissapear immediately.
04-11-2004, 04:31 PM#4
johnfn
I have a very cool respawn trigger that sort of bypasses all of these problems. (it was on an old RPG of mine) Check it out:

set up monster respawning system
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Wait 2.00 seconds
Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
Loop - Actions
Set for_every_unit = (for_every_unit + 1)
Set loc_of_creeps[for_every_unit] = (Position of (Picked unit))
Set corresponding_type_of_monster[for_every_unit] = (Picked unit)



Respawn Monster
Events
Unit - A unit owned by Neutral Hostile Dies
Conditions
Actions
For each (Integer forloop) from 1 to (Number of units in (Units owned by Neutral Hostile)), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
corresponding_type_of_monster[(Integer A)] Equal to (Dying unit)
Then - Actions
Wait 30.00 seconds
Unit - Create 1 (Unit-type of corresponding_type_of_monster[(Integer A)]) for Neutral Hostile at loc_of_creeps[(Integer A)] facing Default building facing (270.0) degrees
Set corresponding_type_of_monster[(Integer A)] = (Last created unit)
Else - Actions


Cool, eh? You can set the 30 seconds to whatever you want to lengthen or shorten the respawn time.
04-11-2004, 10:23 PM#5
Anitarf
What if during those 30 seconds a trigger that has "for loop integer A" in it is triggered? Wouldn't that change the "integer A" which you use again after the wait command as if it has remained the same?
04-11-2004, 11:02 PM#6
johnfn
Quote:
Originally Posted by Anitar
What if during those 30 seconds a trigger that has "for loop integer A" in it is triggered? Wouldn't that change the "integer A" which you use again after the wait command as if it has remained the same?
Oh, whoops. I guess i fixed my old trigger, but only halfway. All instances of Integer A should be replaced with forloop.