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

Neutral Spawn system

Status
Not open for further replies.
Level 6
Joined
Mar 26, 2008
Messages
239
I'm making a kind of Hero Arena map and I need a Neutral Spawn system, like in DotA or smth like that, I tried to do it myself, but for now I cannot make it, could smb help?:hohum:
I made only first spawn, but when neutrals should respawn, it works only for one region, other neutrals are not respawned...
I need either GUI or JASS, it doesn't really matter.
If it already exists, plz post a link.=)
My English isn't perfect, so if u didn't understand, I allow u to ask.:thumbs_up:))
 
Last edited:
Level 9
Joined
Jul 24, 2007
Messages
308
seek DotA Template at the helper.net, there is a trigger in the map has the respawn system
i lost the map
anyway im sure it can be easily done by GUI:
event unit dies
condition own of dying unit is neutral passive/hostile
action
set point = position of dying unit/respawn location
wait X seconds
create 1 (unit type of dying unit) at point
custom script: call RemoveLocation(udg_point)

this code i made in less than a minute, for an efficient system seek the map
 
event unit dies
condition own of dying unit is neutral passive/hostile
action
set point = position of dying unit/respawn location
wait X seconds
create 1 (unit type of dying unit) at point
custom script: call RemoveLocation(udg_point)

Do not work, you should (and must) use Triggering Unit instead of Dying Unit, or another dying unit may overwrite it. Also, the point will be overwritten.

The most correct would be:
  • Actions
    • Custom script: local location udg_L = GetUnitLoc( GetTriggerUnit() )
    • Wait x.yz seconds
    • Unit - Create 1 (Unit-type of (Triggering Unit)) at L [...]
    • Custom script: call RemoveLocation( udg_L )
Have a point global variable called L too, or use the unit creation action in JASS too...
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Do not work, you should (and must) use Triggering Unit instead of Dying Unit, or another dying unit may overwrite it. Also, the point will be overwritten.

The most correct would be:
  • Actions
    • Custom script: local location udg_L = GetUnitLoc( GetTriggerUnit() )
    • Wait x.yz seconds
    • Unit - Create 1 (Unit-type of (Triggering Unit)) at L [...]
    • Custom script: call RemoveLocation( udg_L )
Have a point global variable called L too, or use the unit creation action in JASS too...

Although working(and leak free) this is not dota like at all. In dota creeps spawn at a precise spot(center of region I presume) and not where they died.
 
Level 17
Joined
Jan 21, 2007
Messages
2,013
You could add all units in every camp to a unit group for that creep camp. When a unit dies, check if it's in unit group 1, if not check 2, etc.
Then use the wait as in the other suggestions and create a unit-type of triggering unit at the unit groups region. Add last created unit to the specific unit group.

This trigger is going to be longer for each creep camp, but to make it cclean you could do 1 trigger for each unit group.

To make them stand at a specific point in the region you could use offsets, i believe.
 
Although working(and leak free) this is not dota like at all. In dota creeps spawn at a precise spot(center of region I presume) and not where they died.

Oops I guess I missed some parts of the post >.<

Then I'd suggest you to set each spawning point to a array variable, and then use a loop to create all the creeps at all regions...

If you want to respawn them when they die, use custom values. Something similar to:

  • For each integer (Integer A) from 1 to n do (Actions)
    • Loop - Actions
      • Unit - Create 1 creep for Neutral Hostile at SpawnPoint[(Integer A)] [...]
      • Unit - Set (last created unit) custom value to (Integer A)
This way, you'll know what's the unit's original spawn point (it will be SpawnPoint[Custom Value]).

In fact, I couldn't understand what he want very well xD
 
Level 6
Joined
Mar 26, 2008
Messages
239
You could add all units in every camp to a unit group for that creep camp. When a unit dies, check if it's in unit group 1, if not check 2, etc.
Then use the wait as in the other suggestions and create a unit-type of triggering unit at the unit groups region. Add last created unit to the specific unit group.

This trigger is going to be longer for each creep camp, but to make it cclean you could do 1 trigger for each unit group.

To make them stand at a specific point in the region you could use offsets, i believe.
I tried to do it this way, I also add "If All Units Of UnitGroup Are Dead" then Actions, but it worked only for 1 camp...
Do not work, you should (and must) use Triggering Unit instead of Dying Unit, or another dying unit may overwrite it. Also, the point will be overwritten.
I'll try to use Triggering Unit in my previous trigger, maybe it will work=)
 
Status
Not open for further replies.
Top