Spawn Trigger

2fat2move

New Member
Reaction score
0
Hey guys, I'm already trying for 2 days to get a trigger which spawn hostile monster's in my map.

I already had it, but my monster's only spawned at that point, where they died. I want that they teleport back (or something) to the originial spawn point. Can anyone help me please?
 

O.A

Quantum physics rules
Reaction score
29
Here's a system i use in one of my maps, and it works well. At Map Initialization do the following;

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())

Creep_X and Creep_Y are Real Arrays

Then when you want to respawn the creep;

Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) 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

Use Point with offset (offset is the coordinates of the creep at the start of the map, offset from the center of the map)

and right after that;

Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))

so it has the same value and will be respawned to the same location over and over.

PS. This method has some things worth mentioning, such as if the corpse of the creep disappears fully, it will no longer be respawned (i think), for me that's not a problem, hopefully not for you either... and maybe someone knows a way around this?
 

Solu9

You can change this now in User CP.
Reaction score
216
PS. This method has some things worth mentioning, such as if the corpse of the creep disappears fully, it will no longer be respawned (i think), for me that's not a problem, hopefully not for you either... and maybe someone knows a way around this?

Nice method. For the corpse issue. If the death time of the killed unit is higher than the repawn timer it should not be a problem.
 

O.A

Quantum physics rules
Reaction score
29
That's true, in a normal rotation (kill & respawn, repeat) the creeps won't disappear, but when using abilities like Animate Dead or Carrion Beetle, it will always remove those creeps from rotation, because their corpses disappear, that's the only way i see it becoming a problem, if the map has a lot of animate scrolls or a Hero with Animate Dead.
 

2fat2move

New Member
Reaction score
0
Thanks very much guys! If u could help me one more time maybe? I can't find "Pick every unit in (Units in (Playable map area) owned by Neutral Hostile)" I only can find "Pick every unit in (Units in (Playable map area)" How I can add "owned by Neutral Hostile"? Can u tell me pls? :(
 

Solu9

You can change this now in User CP.
Reaction score
216
This?
Trigger:
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
 

2fat2move

New Member
Reaction score
0
Units owned my Neutral Hostile, ye but O.A is writing all together like "Pick every unit in (Units in (Playable map area) owned by Neutral Hostile)" how I can do that?

Edit: Or do I even need "Units in Playable map arena" if it affects all "Neutral Hostile"?

Edit#2: Fuack. Actually took a look and found it instantly. Forget my last question. Thank you all very much. :)
 

Solu9

You can change this now in User CP.
Reaction score
216
I don't know why it makes any difference if you are picking every unit in the playable area owned by that player. But anyway. This then?:

Trigger:
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
 

2fat2move

New Member
Reaction score
0

Attachments

  • Scipts.png
    Scipts.png
    39 KB · Views: 260
  • Scipts.png
    Scipts.png
    65.2 KB · Views: 244

O.A

Quantum physics rules
Reaction score
29
All that does is it makes it not leak the locations, it shouldn't have anything to do with whether it works or not, both variations you have in those pictures should work. Of course it's better to take care of the leaks (not that they really affect anything), but i'm glad it's working for you in any case.
 

2fat2move

New Member
Reaction score
0
I tried both, only the "longer" script did work. =/ I dunno why, but it just work now. :) Thanks for your help.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top