how to make spawn with space between creeps?

zzyzxroad

TH.net Regular
Reaction score
1
My spawn currently is grouped together that makes it look like one unit. I would like to have them possibly spawn with a space in between. perhaps a 1/4 second in between them appearing? I am not sure, what the best method is. I have tried so far:

1)setting collision size to 0,10....buth then they attack the towers if towers are built too close to the spaw location, even though the spawn is several towers away.

2)for the tower destruction t stop, I set the collision back to 0 and gave them the ghost ability, but then they are basically "1 unit" and run to the end in a matter of seconds.

3)Cant remember what else.. :D

Any thoughts or ideas how to remedy this?
 

Exide

I am amazingly focused right now!
Reaction score
448
Show us your code.
-Adding a 'wait 0.25 seconds' will probably help. (Depends on your code, though..)
 

zzyzxroad

TH.net Regular
Reaction score
1
Code:
If (Level_Number Equal to 1) then do (Set Monster_Type = Scout Level 1) else do (Do nothing)
If (Level_Number Equal to 1) then do (Set Monster_Amount = 20) else do (Do nothing)

Unit - Create 30 Monster_Type for Player 12 (Brown) at (Center of Red right spawn <gen>) facing Default building facing degrees

Trigger - Run Startup Movement <gen> (checking conditions)

nothing more really. they are just a normal spawn
 

Exide

I am amazingly focused right now!
Reaction score
448
Show us Startup Movement as well.
Also, make a loop:

For each Integer A 1 to 30 do:
Unit - Create 1 Monster_Type for Player 12 (Brown) at (Center of Red right spawn <gen>) facing Default building facing
Wait 0.10 seconds

-This trigger leaks.
 

zzyzxroad

TH.net Regular
Reaction score
1
Code:
Trigger - Run Move BluYelloLeft <gen> (ignoring conditions)          

Move BluYelloLeft
    Events
    Conditions
    Actions
        Unit Group - Pick every unit in AttackersBlueYelloLeft and do (Unit - Order (Picked unit) to Move To (Center of Yellow left corner <gen>))
 

Exide

I am amazingly focused right now!
Reaction score
448
You're running an awful lot of triggers. :p
What you could do is to create a couple of triggers (one for each region where the creeps move), like this:

Code:
A unit enters Region1

Owner of (Triggering Unit) equal to Player 12 (Brown)

set temppoint = Center of (Region2)
Order (Triggering unit) to Move to temppoint
custom script   call RemoveLocation(udg_temppoint)

Code:
A unit enters Region2

Owner of (Triggering Unit) equal to Player 12 (Brown)

set temppoint = Center of (Region3)
Order (Triggering unit) to Move to temppoint
custom script   call RemoveLocation(udg_temppoint)

And change your spawn trigger to this:

Code:
If (Level_Number Equal to 1) then do (Set Monster_Type = Scout Level 1) else do (Do nothing)
If (Level_Number Equal to 1) then do (Set Monster_Amount = 20) else do (Do nothing)

set temppoint =  Center of (Region1)
For each Integer A 1 to 30 do:
  Unit - Create 1 Monster_Type for Player 12 (Brown) at [B]temppoint[/B] facing 270
  Wait 0.10 seconds
custom script   call RemoveLocation(udg_temppoint)

You should also move the If / Then / Else out of the spawn trigger, and into another trigger that runs (and checks level) after each level is done.
 

zzyzxroad

TH.net Regular
Reaction score
1
Ok, thanks. I think I might need to delete al movement triggers and try it your way. Funny, I just disabled this:

If (Level_Number Equal to 1) then do (Set Monster_Amount = 20) else do (Do nothing)

and spawning still works. But it seems to clash. In this trigger I am saying to create 20 creeps but in the trigger:

Create 30 Monster_Type for Player 12

I am saying to create 30?
 

Exide

I am amazingly focused right now!
Reaction score
448
>I am saying to create 30?
-Yea, I missed that as well.
You should do this:

Code:
If (Level_Number Equal to 1) then do (Set Monster_Type = Scout Level 1) else do (Do nothing)
If (Level_Number Equal to 1) then do (Set Monster_Amount = 20) else do (Do nothing)

set temppoint =  Center of (Region1)
For each Integer A 1 to [B]Level_Number[/B] do:
  Unit - Create 1 Monster_Type for Player 12 (Brown) at temppoint facing 270
  Wait 0.10 seconds
custom script   call RemoveLocation(udg_temppoint)
 

zzyzxroad

TH.net Regular
Reaction score
1
Thanks for the help. I am working on it as you are replying. :D

Lets see where screw it up next.
 

zzyzxroad

TH.net Regular
Reaction score
1
Hmm, I keep getting an error here:

Custom script: call RemoveLocation(udg_Tmppoint)


Error:

line:Invalid argument type (string) (endfunction)
line:Expected a code Statement (string) (function InitTrig_Grey_Region takes nothing returns nothing)
line:Expected a function name (string) (endfunction)

Also, I am kinda wondering if this will work for 10 ifferent spawns? (10 players)
 

Exide

I am amazingly focused right now!
Reaction score
448
>Hmm, I keep getting an error here:

Custom script: call RemoveLocation(udg_Tmppoint)


Weird, only error I can see could be the name of the variable 'Tmppoint' - make sure you spelled it correctly, and that you added a Point Variable with the same name (exclude udg_) in the variable editor.

Open Trigger Editor (F4), open the Variable Editor (small X icon at the top), click 'add/new variable' -> choose Point in type, and name it something. In this case 'Tmppoint'. Then click 'ok'.

Also, show me your spawn trigger again.
And try not to double post, instead: Edit your last post. (Double post only after 24 hours.)
 

zzyzxroad

TH.net Regular
Reaction score
1
Woops, sorry about double.


I actually tried your trigger wthout "call removelocation" and the spawn move seamlessly thru the map to the end. I actually used the variable type "region" not point.


dummy me, i needed a space in between Removelocation and (udg_tmppoint). seems to be working now. will let you know!!

Ok, so I have all the spawns working, and moving to the next point in the map. The first level works perfect. The next levels however, some of the spawns want to wait about 10 second until they decide they want to finally run. Its the same spawn that stick every round. also there are other spawns that get to the next point, then decide to wait about 10 seconds before moving on,while the rest move right along seamlessly.

any idea?
 

Exide

I am amazingly focused right now!
Reaction score
448
>dummy me, i needed a space in between Removelocation and (udg_tmppoint).
-Nah, that's not needed.

>I actually tried your trigger wthout "call removelocation" and the spawn move seamlessly thru the map to the end.
-Removing it will still cause leaks, though.

>I actually used the variable type "region" not point.
-That might be it. :p
 

Exide

I am amazingly focused right now!
Reaction score
448

Exide

I am amazingly focused right now!
Reaction score
448
True, but in this case it's not required to be able to stop it.
 

zzyzxroad

TH.net Regular
Reaction score
1
Ok, so I have all the spawns working, and moving to the next point in the map. The first level works perfect. The next levels however, some of the spawns want to wait about 10 second until they decide they want to finally run. Its the same spawn that stick every round. also there are other spawns that get to the next point, then decide to wait about 10 seconds before moving on,while the rest move right along seamlessly.
 

LightChaosma

New Member
Reaction score
60
have a look at my spawning system, maybe a bit confusing at first, but migh save you a whole buch of triggers, this system spawns units spaced apart for each player at the same time, and only needs a few triggers and it works for all levels:

link

if you have questions, just ask ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top