• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Is this spawning system triggers sufficent?

Status
Not open for further replies.
Level 15
Joined
Jul 9, 2008
Messages
1,552
so I made a request in the request froms to create a spawning system for me 3 people said they will do it but never ended up doing it. i then asked some one to do it who is taking requests and he seems to be inactive so i just gave up and tryd my self so could some 1 help me/tell me what i need to add to make these triggers more sufficent

what happens is there are 5 waves per level on the last wave there is a boos and the next level of waves wont start untill the boss is killed
each level has a different set of units

here is what i have so far so can some one please tell me if these are sufficent or how to make these more sufficent.

  • Main
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_count Equal to 0
        • Then - Actions
          • Set Wave_count = (Wave_count + 1)
          • Set Wave_unit_number[1] = (2 + (3 x number_of_players))
          • Set Wave_unit_number[2] = (1 + (2 x number_of_players))
          • Set temp_point = (Center of spawn point 1 <gen>)
          • Unit - Create Wave_unit_number[1] Wave_units[1] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
          • Unit - Create Wave_unit_number[2] Wave_units[2] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_temp_point)
          • Set temp_point = (Center of spawn point 2 <gen>)
          • Set Attack_points = (Center of spawn point 1 Copy <gen>)
          • Unit - Create Wave_unit_number[1] Wave_units[1] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
          • Unit - Create Wave_unit_number[2] Wave_units[2] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_temp_point)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wave_count Equal to 1
            • Then - Actions
              • Set Wave_count = (Wave_count + 1)
              • Set Wave_unit_number[1] = (5 + (4 x number_of_players))
              • Set Wave_unit_number[2] = (3 + (3 x number_of_players))
              • Set temp_point = (Center of spawn point 1 <gen>)
              • Unit - Create Wave_unit_number[1] Wave_units[1] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
              • Unit - Create Wave_unit_number[2] Wave_units[2] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
              • Custom script: call RemoveLocation (udg_temp_point)
              • Set temp_point = (Center of spawn point 2 <gen>)
              • Set Attack_points = (Center of spawn point 1 Copy <gen>)
              • Unit - Create Wave_unit_number[1] Wave_units[1] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
              • Unit - Create Wave_unit_number[2] Wave_units[2] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
              • Custom script: call RemoveLocation (udg_temp_point)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Wave_count Equal to 2
                • Then - Actions
                  • Set Wave_count = (Wave_count + 1)
                  • Set Wave_unit_number[1] = (2 + (2 x number_of_players))
                  • Set Wave_unit_number[2] = (3 + (2 x number_of_players))
                  • Set Wave_unit_number[3] = (2 + (2 x number_of_players))
                  • Set temp_point = (Center of spawn point 1 <gen>)
                  • Unit - Create Wave_unit_number[1] Wave_units[1] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                  • Unit - Create Wave_unit_number[2] Wave_units[2] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                  • Unit - Create Wave_unit_number[3] Wave_units[3] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                  • Unit - Order (Last created unit) to Attack-Move To Attack_points
                  • Custom script: call RemoveLocation (udg_temp_point)
                  • Set temp_point = (Center of spawn point 2 <gen>)
                  • Set Attack_points = (Center of spawn point 1 Copy <gen>)
                  • Unit - Create Wave_unit_number[1] Wave_units[1] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                  • Unit - Create Wave_unit_number[2] Wave_units[2] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                  • Unit - Create Wave_unit_number[3] Wave_units[3] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                  • Unit - Order (Last created unit) to Attack-Move To Attack_points
                  • Custom script: call RemoveLocation (udg_temp_point)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Wave_count Equal to 3
                    • Then - Actions
                      • Set Wave_count = (Wave_count + 1)
                      • Set Wave_unit_number[2] = (3 + (2 x number_of_players))
                      • Set Wave_unit_number[3] = (2 + (2 x number_of_players))
                      • Set Wave_unit_number[4] = (2 + (1 x number_of_players))
                      • Set temp_point = (Center of spawn point 1 <gen>)
                      • Unit - Create Wave_unit_number[2] Wave_units[2] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                      • Unit - Create Wave_unit_number[3] Wave_units[3] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                      • Unit - Create Wave_unit_number[4] Wave_units[4] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                      • Custom script: call RemoveLocation (udg_temp_point)
                      • Set temp_point = (Center of spawn point 2 <gen>)
                      • Set Attack_points = (Center of spawn point 1 Copy <gen>)
                      • Unit - Create Wave_unit_number[2] Wave_units[2] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                      • Unit - Create Wave_unit_number[3] Wave_units[3] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                      • Unit - Create Wave_unit_number[4] Wave_units[4] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                      • Custom script: call RemoveLocation (udg_temp_point)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Wave_count Equal to 4
                        • Then - Actions
                          • -------- Boss Triggers --------
                          • -------- Boss Triggers --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Wave_Level Equal to 0
                            • Then - Actions
                              • Trigger - Turn on Skeleton boss spawns <gen>
                            • Else - Actions
                          • -------- Boss Triggers --------
                          • -------- Boss Triggers --------
                          • Trigger - Turn off (This trigger)
                          • Multiboard - Set the text for (Last created multiboard) item in column 3, row 12 to (coulors[11] + Bosses Death)
                          • Set Wave_count = 0
                          • Set Wave_unit_number[2] = (3 + (2 x number_of_players))
                          • Set Wave_unit_number[3] = (2 + (2 x number_of_players))
                          • Set Wave_unit_number[4] = (2 + (1 x number_of_players))
                          • Set temp_point = (Center of spawn point 1 <gen>)
                          • Unit - Create 1 Wave_units[5] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                          • Set Wave_boss[1] = (Last created unit)
                          • Unit - Create Wave_unit_number[2] Wave_units[2] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                          • Unit - Create Wave_unit_number[3] Wave_units[3] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                          • Unit - Create Wave_unit_number[4] Wave_units[4] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                          • Custom script: call RemoveLocation (udg_temp_point)
                          • Set temp_point = (Center of spawn point 2 <gen>)
                          • Set Attack_points = (Center of spawn point 1 Copy <gen>)
                          • Unit - Create 1 Wave_units[5] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                          • Set Wave_boss[2] = (Last created unit)
                          • Unit - Create Wave_unit_number[2] Wave_units[2] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                          • Unit - Create Wave_unit_number[3] Wave_units[3] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                          • Unit - Create Wave_unit_number[4] Wave_units[4] for Player 11 (Dark Green) at temp_point facing Default building facing degrees
                          • Set Wave_Level = (Wave_Level + 1)
                          • Custom script: call RemoveLocation (udg_temp_point)
                        • Else - Actions

the system works with my multiboard clock so these are also main triggers
  • spawn clock 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_countdown[2] Equal to 0
        • Then - Actions
          • Set Wave_count = 0
          • Trigger - Turn off (This trigger)
          • Trigger - Turn on spawn clock <gen>
          • Trigger - Run Unit set up <gen> (checking conditions)
          • Trigger - Run Main <gen> (checking conditions)
          • Set Wave_countdown[2] = 0
        • Else - Actions
          • Set Wave_countdown[2] = (Wave_countdown[2] - 1)
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row 12 to (coulors[11] + (String(Wave_countdown[2])))
  • spawn clock
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_countdown[1] Equal to 0
        • Then - Actions
          • Trigger - Run Main <gen> (checking conditions)
          • Set Wave_countdown[1] = 45
        • Else - Actions
          • Set Wave_countdown[1] = (Wave_countdown[1] - 1)
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row 12 to (coulors[11] + (String(Wave_countdown[1])))
my unit set up and boss deaths and units attack move
  • Unit set up
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_Level Equal to 0
        • Then - Actions
          • Set Wave_units[1] = Skeleton Warrior (level one)
          • Set Wave_units[2] = Skeleton Archer
          • Set Wave_units[3] = Giant Skeleton Warrior
          • Set Wave_units[4] = Skeletal Mage
          • Set Wave_units[5] = Lord of the skeletons
        • Else - Actions
  • ---ect...ect----
  • Boss Deaths
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) Equal to Wave_boss[1]) or ((Triggering unit) Equal to Wave_boss[2])
    • Actions
      • Set Wave_boss_Death = (Wave_boss_Death + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_boss_Death Equal to 2
        • Then - Actions
          • Set Wave_countdown[2] = 100
          • Trigger - Turn on spawn clock 2 <gen>
        • Else - Actions
i have this for each lane
  • main attack
    • Events
      • Unit - A unit enters spawn point 1 <gen>
    • Conditions
      • ((Triggering unit) belongs to an ally of Player 11 (Dark Green)) Equal to True
    • Actions
      • Set Attack_points = (Center of spawn point 2 Copy <gen>)
      • Unit - Order (Triggering unit) to Attack-Move To Attack_points
      • Custom script: call RemoveLocation (udg_Attack_points)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Additionally, create an integer variable called "Level" (if you haven't got one already) and an integer variable called "Wave_Count".

Then you do the setup like this:

  • Events
    • Time - Elapsed game time is 1.00 seconds
  • Conditions
  • Actions
    • Set Wave_Count = Wave_Count + 1
    • Set Wave_units1[Wave_Count] = Skeleton Warrior (level one)
    • Set Wave_units2[Wave_Count] = Skeleton Archer
    • Set Wave_units3[Wave_Count] = Giant Skeleton Warrior
    • Set Wave_units4[Wave_Count] = Skeletal Mage
    • Set Wave_units5[Wave_Count] = Lord of the skeletons
    • Set Wave_unit_number1[Wave_Count] = (2 + (3 x number_of_players))
    • Set Wave_unit_number2[Wave_Count] = (1 + (2 x number_of_players))
    • Set Wave_Count = Wave_Count + 2
    • Set Wave_units1[Wave_Count] = [...]
    • Set Wave_units2[Wave_Count] = [...]
    • Set Wave_units3[Wave_Count] = [...]
    • Set Wave_units4[Wave_Count] = [...]
    • Set Wave_units5[Wave_Count] = [...]
    • Set Wave_unit_number1[Wave_Count] = [...]
    • Set Wave_unit_number2[Wave_Count] = [...]
    • etc...
Then you don't have to run this trigger every time, all units are set up at the start.

Now you can don't even need the loop (what dardas said), as all variables are pre-set.


I've attached a little system to this post, perhaps you find it useful.
HINT: go to File -> Preferences -> Text colors, search for "Trigger Editor - Function - Comment" and set the text color to something which catches the eye, yet is easy to read (mine is 150/50/200 RGB).

And you can do this for other functions as well (I do it so I can quickly recognize e.g. unit actions, comments or player actions without having to read the entire thing or carefully look at the icons).
Another comment color is extremely useful for implementing other spells/systems though, I really recommend you change at least that.
 

Attachments

  • Sample TD.w3x
    24.7 KB · Views: 64
Level 11
Joined
Sep 12, 2008
Messages
657
yeah.. well its not here atm. (comp broke.. blah blah)
and this is what it includes:

1. gold system, you get gold per round, per kill.(you choose which round, which unit type.)
2. lumber system, you get lumber per round, per kill. (you choose which round, which unit type.)
3.mutliboard system. (round, what armor type, lives, etc.)
4.spawn system ( used variables like the one above me did, just easier to edit. )
5. amount of units per spawn, regions where the units spawn, regions where they attack after spawn.
6. probably more and i cant remember.

ill give you it when i get my comp back.. (sry, it broke down :/)
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
Do it ap0calypse's way unless you just wanna wait for that guy to give his stuff. your better just starting over for now.

useing ap0colypse's way i dunno how to put in the features i want

-waves stop on boss round and after boss is killed there is a break then the waves start again
-the number of units per wave changes after each wave


i dont want some 1 to create me a spawning the spawning system other wise this will be in the requests fourms( i had one there but nothing)

i need some one to see how i can make the triggers i have more sufficeint unless they already are
 
A simple solution would be something like this:
  • Te
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Levels = 1
      • -------- Unit Types --------
      • Set Units[1] = Knight
      • Set Units[2] = Frost Wyrm
      • Set Units[3] = Green Dragon Whelp
      • -------- Boss --------
      • Set Units[4] = Pit Lord
      • -------- End of Boss --------
      • Set Units[5] = Dark Troll
      • -------- Amount of Creeps --------
      • Set AmountOfCreeps[1] = 5
      • Set AmountOfCreeps[2] = 11
      • Set AmountOfCreeps[3] = 7
      • Set AmountOfCreeps[4] = 1
      • Set AmountOfCreeps[5] = 14
      • Countdown Timer - Start SpawnTimer as a One-shot timer that will expire in 5.00 seconds
  • Tri
    • Events
      • Time - SpawnTimer expires
    • Conditions
    • Actions
      • Set Point = (Center of Region 000 <gen>)
      • For each (Integer A) from 1 to AmountOfCreeps[Levels], do (Actions)
        • Loop - Actions
          • Unit - Create 1 Units[Levels] for Neutral Hostile at Point facing Default building facing degrees
          • Unit Group - Add (Last created unit) to TempGroup
      • Special Effect - Create a special effect at Point using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation (udg_Point)
  • Tre
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Unit Group - Remove (Triggering unit) from TempGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Levels Less than 5
            • Then - Actions
              • Set Levels = (Levels + 1)
              • Countdown Timer - Start SpawnTimer as a One-shot timer that will expire in 5.00 seconds
            • Else - Actions
        • Else - Actions
If you want to adjust the delay between the spawns, you can use these lines in the first trigger:
  • Actions
    • Set TimeIntervals[1] = 5.00
    • Set TimeIntervals[2] = 7.00
    • Set TimeIntervals[3] = 2.00
    • Set TimeIntervals[4] = 4.00
    • Set TimeIntervals[2] = 12.00
TimeIntervals[] are Real variables.

Test map:
 

Attachments

  • Spawn Triggers [Timer].w3x
    17.9 KB · Views: 45
Uhm, no, the number of creeps spawned is defined through the "AmountOfCreeps" variable and the Integer A loop spawns creeps, up to the current index of the variable "Levels", which is assimilated into the AmountOfCreeps variable, defining its index.

You are not changing the timer, I didn't change any timer.

They actually do spawn. I don't really understand your problem. I obviously don't upload maps before testing them carefully many times. :]
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
you miss under stood the not all unit spawn every wave
my fault also i typed it wrong


i dont want all units to spawn each wave

e.g

level one humans
wave 1 is footmen and archer
wave 2 is footmen and archer and knight
wave 3 its knight archer preist
...ect
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
@Millzy, that is very easy to add.

Just think a little...

How are the unit types set?
- By variables.

Would it be possible to add a second variable?
- Yes

Can that variable store the second (or even third) unit type?
- Yes

Can another variable store the amount of units have to spawn for each type every wave?
- Yes.


What I'm trying to say here: add another variable and the system can handle multiple unit types.
Add 2 more variables and you can say how many units of each type should spawn (e.g. 10 footmen and 5 archers).
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
You shouldn't use a loop, nor should you use if/then/elses for this.

All you need to do is run a trigger and spawn UnitType[Level].
Or perhaps you were talking about something else?

not sure what you mean

i just tested the triggers i already have and it seems to work pritty good shale i upload the map so you can check it?

i dunno but it seems like no one has looked at all the triggers i posted
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
All objects in same race: all creeps (incoming waves) are now in custom -> neutral hostile.
This makes setting up waves a lot easier, editing them a lot faster and it looks a lot better as well.
I had to search through all races, all subcategories to find the correct units.
Next time you create a game: do this yourself.

Raw triggers: triggers that aren't working yet, only the basic structure is done (loop, if/then/else but not all actions are there).
I need to modify/enhance that trigger a bit before it works as efficient and smooth as possible.
 
Status
Not open for further replies.
Top