Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
i have a tower defense map setup with a creep spawn triggers that i found online that starts automatically
can someone help me getting the trigger to apply for each player that joins the game?
right now it uses a single spawn goes to the next level after all the creeps have been killed no matter how many 'players' are in the game.
its a fixed amount of creeps each level, and i want to be able to make the game scale for each player as multiple players would make the game too easy. ideally a spawn area for each player.
hang on i was trying to copy from the trigger list..
sorry if this looks like a lot, i tried copying the creeps spawns/levels trigger
and just changed the player from 12 to 11, so there were 2 different instances of the same trigger
i also tried making multiple spawn points using multiple regions but i couldnt assign more than a single spawn point
to the spawn trigger
but what happened is after all the creeps from level 1 died the game just stopped.
also theres a small issue with the creeps bounty, the player is assigned to player 12 for the creeps, if i changed that to neutral hostile would that allow bounties to be collected, since you dont normally collect bounties, only experience, from killing enemy units?
inittialize game
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
Sound - Play Music
Visibility - Disable fog of war
Visibility - Disable black mask
-------- For the game initialization, it is a wise discission to initialize using time elapse --------
-------- because the timer window will not show up if you use map initialization event --------
Set goldLevelText[6] = ((String(goldLevelGiven[6])) + is given.)
Set creepNumLevel[6] = 20
Set levelWarnings[6] = ((String(creepNumLevel[6])) + Level 6 creeps are coming.)
firstSpawnTimer
Events
Conditions
Actions
-------- In our first spawn, we need to create a different timer and a timer window aside from the timer window to use in a regular level or spawns. --------
Countdown Timer - Start startTimer as a One-shot timer that will expire in 5.00 seconds
Countdown Timer - Create a timer window for startTimer with title Next Level in:
-------- We should store our timer window in a variable because we have two timer windows --------
Set startTimerWindow = (Last created timer window)
-------- Now, we will show our timer window to the player to give him time to prepare --------
Countdown Timer - Show startTimerWindow
firstSpawnEnd
Events
Time - startTimer expires
Conditions
Actions
-------- If our firstSpawnTimer expires we should do the following: --------
-------- 1. Hide or even destroy our first spawn--timer window. --------
Countdown Timer - Hide startTimerWindow
-------- 2. Tell the player that the first level is approaching --------
Game - Display to (All players) for 5.00 seconds the text: levelWarnings[LevelCounter]
-------- 3. Turn on the creation of creeps --------
Trigger - Turn on Spawn <gen>
Spawn
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
-------- This trigger is initially off. --------
-------- First thing to do is to store the locations where the spawn should occur and where our creeps will go --------
-------- 1. The spawn location --------
Set Spawner = (Random point in Region 000 <gen>)
-------- 2. The location where our creeps will go --------
Set tempPoint = (Random point in Region 001 <gen>)
-------- By using the if statement below, we set as to how many are allowed to spawn --------
-------- in each level --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of living creepSpawnType[LevelCounter] units owned by Player 12 (Brown)) Equal to creepNumLevel[LevelCounter]
Then - Actions
-------- We then turn off this trigger if the desired number of spawned creeps is meet --------
Trigger - Turn off (This trigger)
Else - Actions
-------- If the number of creeps is still not enough, the creation will still continue --------
Unit - Create 1 creepSpawnType[LevelCounter] for Player 12 (Brown) at Spawner facing Default building facing degrees
-------- We order each creeps to attack and move towards the set dump area we call as tempPoint --------
Unit - Order (Last created unit) to Attack-Move To tempPoint
-------- If everything is done, we should remove memory leaks --------
Custom script: call RemoveLocation(udg_Spawner)
Custom script: call RemoveLocation(udg_tempPoint)
-------- This ends the creation of creeps --------
endLevel
Events
Player - Player 12 (Brown)'s Food used becomes Less than or equal to 0.00
Conditions
Actions
-------- The level will end if all creeps are dead --------
-------- Player - Player 12 (Brown)'s Food used becomes Less than or equal to 0.00 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
LevelCounter Less than 6
Then - Actions
-------- We have to set the last level and here we have up to level 6 --------
-------- Then, we create coundown timer for the next wave of creeps. --------
Countdown Timer - Start levelTimer as a One-shot timer that will expire in 1.00 seconds
-------- Create the timer window --------
Countdown Timer - Create a timer window for levelTimer with title Next Level in:
-------- Save it in a variable --------
Set levelTimerWindow = (Last created timer window)
-------- Show the timer window to the player so he can be alerted --------
Countdown Timer - Show levelTimerWindow
Else - Actions
-------- We put here the action when the last level is reached. Here, the last level is 65 as stated in our if statement - --------
Game - Display to (All players) for 30.00 seconds the text: END GAME
nextLevel
Events
Time - levelTimer expires
Conditions
Actions
-------- In this trigger, you can see that we work on a different expiring timer than the --------
-------- expired timer of the first spawn. This is because, this will be used for the leveling purpose. --------
-------- If the level timer expires, we need to hide it --------
Countdown Timer - Hide levelTimerWindow
-------- We then add 1 to our level (the next spawns) --------
Set LevelCounter = (LevelCounter + 1)
-------- Then we display the alert text --------
-------- Take note that the text we used is actually a variable we get in the Set Creeps trigger --------
-------- Instead of using levelWarnings[0], levelWarnings[1], etc we just say levelWarnings[LevelCounter] --------
Game - Display to (All players) for 5.00 seconds the text: levelWarnings[LevelCounter]
-------- Now, we have to turn on The Spawn trigger to create units for the next level --------
Player - Turn Gives bounty On for Player 12 (Brown)
You can use this for the bounty.
For multiple spawn points you have to take a look at your "Spawn" trigger. You need an additional variable for the second spawn point. And then create another unit at this point and order it to move. Your trigger has a problem if units die before all of them have spawned though and will create too many as a result. I suggest changing the condition to
(Number of units in (Units owned by Player 12 (Brown) of type creepSpawnType[LevelCounter])) Greater than or equal to creepNumLevel[LevelCounter]
You could always modify my kind of bad TD spawn system I made for a version of Green Circle TD. It was data fed and dealt with player scaling as well as multiple spawns (as is part of the map).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.