• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Timers and Waves

Status
Not open for further replies.
Level 5
Joined
Oct 3, 2009
Messages
93
Basically, I need waves to last for 90 seconds, have 30 seconds between (120sec total) and spawn a unit every 5 seconds. There are about 35 waves so any help would be nice :D
(P.S. please be specific because I read all the tips DSG has given so far and I'm still confused)

Thanks in advance
 
Level 9
Joined
Dec 21, 2006
Messages
490
Trigger 1 :

Event: Timer elapsed

Actions:

-Start Timer 90 seconds
-Var Wave = Wave + 1
-Turn off this trigger
-Turn on Trigger 2
-Turn on Trigger 3

Trigger 2 :

Event: Every 5 seconds

Actions: Create Unit[Wave] at point

Trigger 3 :

Event: Timer elapsed

Actions:
-turn off this trigger
-Start Timer 30 seconds
-Turn on Trigger 1
-Turn off Trigger 2

------------------------------------
you need to declare the var Unit[] at map init with every spawn creep
e.g. Unit[1] = zergling
Unit[2] = drone
etc
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,204
There are 2 ways that I would recommend.
1. A trigger running on a 5 second timer that acts as a state machine. Does 6 runs of waiting and then does 18 runs of spawning. In transition between waiting and spawning you change the wave and the units to spawn.

2. 2 trigger system with passive wave incrementing thread and spawning state machine thread. A control trigger running every 120 seconds increments the wave and turns on the spawn trigger. The spawning trigger runs every 5 seconds and will run 18 times to spawn your units before turning itself off.

Use arrays to store wave information (the index is great for a wave number). Use integers to keep track of the current wave as well as the state of the triggers.
 
Level 5
Joined
Oct 3, 2009
Messages
93
Cool, cool. Since I have no experience with these, what do I need to add to make the units move and if I need units to spawn at two points, is this doable?
Thanks

Edit: Figured out how to spawn them at two points, just need to make them move
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,204
You need to copy the script the GUI line compiles to, and not the actual text the GUI line gives the user to make reading easier.

My script was an example of how easy it is to make a spawn system (I made it in about 1 hour of which some of that time was spent wressling with Galaxies crap C specification). Your actual implementation can be made in GUI based on ideas I showed in the script if you so wish.
 
Level 5
Joined
Oct 3, 2009
Messages
93
So, what is wrong with
UnitIssueOrder((UnitLastCreated()), (OrderTargetingPoint("move", 0, MiddleLeft)), c_orderQueueReplace)

The error seems to be in the point
I'm probably doing it wrong again, but just trying to learn.
Also I added MiddleLeft as a point at the top of your function along with the other point you had
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,204
UnitIssueOrder((UnitLastCreated()), (OrderTargetingPoint("move", 0, MiddleLeft)), c_orderQueueReplace)
Is that the whole line?
If so you forgot the ";".

Code:
UnitIssueOrder((UnitLastCreated()), (OrderTargetingPoint("move", 0, MiddleLeft)), c_orderQueueReplace);
This is just like what you do in C and java.
Galaxy is very fussy so expects the statement terminator on the same line as the statement ends.
 
Everytime a unit is created add them to a unit group.
Have another trigger issuing every unit in that unit group to move to a specific spot.
Creating a trigger that only tells the (last created unit) to a spot can create a number of issues:

- You would have to create each unit individually, times however many units in that wave.

- If one gets stuck (for whatever reason; walling or whatever) then they will stop and will not continue along their designated path.

So again.. the way I mentioned above is the best way possible.
 
You issue the move order directly after when you create a unit.

Yes, but if you don't continuously tell them to move many issues can arise.
I've been in many maps before where a single unit get's stuck at the top because the units took too long to organize and move.
So again.. constantly telling the unit to move is the best bet.
 
Level 9
Joined
Dec 21, 2006
Messages
490
there is a way without triggers. If there is just one position the units shall move to you can add a buff to the unit which has a periodic effect that searchs for a special unit ( which you have placed on the map before, anyone with special attributes like massiv, ... ) and orders this unit to move to that special unit. so units wont get stuck at any time, but if you work on a TD with more players and lots of waypoints you will need several buffs and different validators. if players are seperated you can validate the special units with path length e.g.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,204
Depends on the map. In a TD you never should have to reorder the units unless something disrupts their orders (like a tower effect) in which case you specificly reoder only those units when the order disruption should end.

In a hero defense style map the spawns should have some form of AI controling them so they attack the centre target and any enemies they encounter.
 
Status
Not open for further replies.
Top