I am new here on this forum and to trigger editing. I need help making this simple trigger:
Condition: Everytime my (builder) create for example a (supply depot), I want :
Action: the supply depot to start spawning unit every 5 sec.
But, That's not all.
1- I want those units that spawn to attack move to a specific location (to attack a nexus for example)
2- I want those units that spawn to be able to have rally point (so I can decide the path they are making while on attack move, even if they auto-move to the nexus)
In other words, I want to be able to control the path of the units that spawn, even if they will always want to go attack the nexus.
Can a trigger exist for this specific proposition?
You can issue different subsequent orders to attackmove towards the rally points and finally towards the nexus. Or do you want the rally points to be different for every unit?
The spawning itself is fairly simple. You can use various approaches, like i.e. a global timer or an auto-casted ability with a certain cooldown (if you want the spawn times to be individual to the supply depot).
When the trigger expires or the ability is used:
Unit - Create 1 unit for player Player at (Position of SupplyDepot) facing (Position of RallyPoint1) (No Options)
Unit - Order (Last created unit) to ( Attack targeting (Position of RallyPoint1)) (Replace Existing Orders)
Unit - Order (Last created unit) to ( Attack targeting (Position of TargetNexus)) (After Existing Orders)
You could also use a generic train ability to spawn the unit if you prefer a data-based solution.
I made a really quick tug of war style game; with some documentation along the way. You can download it and look at the code and modify it as much as you want. It may give you an idea how you can set it up.
Winryamo, I want the player to have complete freedom on the rally point. Ex: Player create supply depot (it will spawn every 5 sec a marine), but the player can choose where the "spawned marine" will go. Then, when the "spawned marine" arrive at the rally point end, he automatically go attack the nexus.
Ok so I checked your map, and this is exactly what I want (When you create a building it spawn unit periodic), but I would like it so you can issue rally point
on the units that spawn.
Do you have any idea/suggestions on how I could integrate this system?
You can create an action in the trigger that creates the units (or have a trigger with the event Unit finished training and issue order to the trained unit)
Then have an action issue an order to the unit you want to the rally point of the training unit (You can chose a units rally point when chosing a point).
Event:
Unit enters entire map(region)
Condition:
Unit type of unit == supply depot
Action:
Repeat forever:
Wait 5 game seconds
If the else
If:
Unit triggering unit is alive == true
Then:
Create 1 marine(unit) at position(position of triggering unit) with default facing point
Else:
...
Hey guys!
I am new here on this forum and to trigger editing. I need help making this simple trigger:
Condition: Everytime my (builder) create for example a (supply depot), I want :
Action: the supply depot to start spawning unit every 5 sec.
But, That's not all.
1- I want those units that spawn to attack move to a specific location (to attack a nexus for example) 2- I want those units that spawn to be able to have rally point (so I can decide the path they are making while on attack move, even if they auto-move to the nexus)
In other words, I want to be able to control the path of the units that spawn, even if they will always want to go attack the nexus.
Can a trigger exist for this specific proposition?
@santapaprika: Go
You can issue different subsequent orders to attackmove towards the rally points and finally towards the nexus. Or do you want the rally points to be different for every unit?
The spawning itself is fairly simple. You can use various approaches, like i.e. a global timer or an auto-casted ability with a certain cooldown (if you want the spawn times to be individual to the supply depot).
When the trigger expires or the ability is used:
Unit - Create 1 unit for player Player at (Position of SupplyDepot) facing (Position of RallyPoint1) (No Options)
Unit - Order (Last created unit) to ( Attack targeting (Position of RallyPoint1)) (Replace Existing Orders)
Unit - Order (Last created unit) to ( Attack targeting (Position of TargetNexus)) (After Existing Orders)
You could also use a generic train ability to spawn the unit if you prefer a data-based solution.
https://www.sc2mapster.com/maps/just-another-tug-map/files/1-just-another-tug/
I made a really quick tug of war style game; with some documentation along the way. You can download it and look at the code and modify it as much as you want. It may give you an idea how you can set it up.
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
Hi guys!
Thanks for the reply! I'll check this out.
Winryamo, I want the player to have complete freedom on the rally point. Ex: Player create supply depot (it will spawn every 5 sec a marine), but the player can choose where the "spawned marine" will go. Then, when the "spawned marine" arrive at the rally point end, he automatically go attack the nexus.
GlornII, I am gonna check this out ;)
@GlornII: Go
Ok so I checked your map, and this is exactly what I want (When you create a building it spawn unit periodic), but I would like it so you can issue rally point on the units that spawn.
Do you have any idea/suggestions on how I could integrate this system?
@santapaprika: Go
You can create an action in the trigger that creates the units (or have a trigger with the event Unit finished training and issue order to the trained unit)
Then have an action issue an order to the unit you want to the rally point of the training unit (You can chose a units rally point when chosing a point).
Event:
Unit enters entire map(region)
Condition:
Unit type of unit == supply depot
Action:
Repeat forever:
Wait 5 game seconds
If the else
If:
Unit triggering unit is alive == true
Then:
Create 1 marine(unit) at position(position of triggering unit) with default facing point
Else:
...
Thanks guys I really appreciate the help!