So I am making a game mode that is not unlike ASOIAF, Ocarina of Time, or Rise of the Witch King, and I'm trying to get the spawning system to function.
I have set up a countdown timer that goes off every 1 minute, and I want to create a trigger that spawns units at a certain point every time the countdown timer expires. Next to the point, there is a spawn building that represents ownership of the point, and I want the trigger to give these spawned units to the owner of the Spawn Building. This is a game mode where all the spawn buildings start off as a neutral building that players must destroy to capture, because of a trigger I have that works like this.
Conversion Trigger
Events
Unit -Any Unit dies
Local Variables
Conditions
(Owner of (Triggering unit)) == 15
((Triggering unit) is in Neutral Spawns Unit Group) == True
Actions
Unit -Create 1 (Unit type of (Triggering unit)) for player (Killing player) at (Position of (Triggering unit)) using default facing (No Options)
One of the problems that I have been running into is the fact that I cannot just set the value to "Owner of Building" because the building doesn't exist, because of the fact that when player captures this building, a new building is put into place, so creating this trigger and giving the units to the owner of the spawn building doesn't work because the spawn building is destroyed and a new one is put in its place. This is how I set up the trigger initially, shown below, and it doesn't work because of the fact that a new building is put into place. (Also, I don't want the trigger to spawn units if the spawn building is owned by the neutral, which is why the If-Then-else statement is there)
Vancouver Spawn
Events
Timer -Spawn Countdown Timer expires
Local Variables
Conditions
Actions
General -If (Conditions) then do (Actions) else do (Actions)
If
(Owner of Spawn - Vancouver (Starting Location) [26.50, 150.50]) == 15
Then
Else
Unit -Create 2 Zealot for player (Owner of Spawn - Vancouver (Starting Location) [26.50, 150.50]) at Vancouver Spawn Point using default facing (No Options)
Is there a way to check if this building type is owned by anyone in the game map. These spawn buildings are unique and only one of them exist at all in the game map, so I was hoping so that there was a way to make a condition check if there is just a single instance of the Spawn Building existing, and then giving the spawned units to the Owner of that Spawn Building.
Thank you in advance!
Rollback Post to RevisionRollBack
I also go by Krazymouse in SC2.
Past works: Cat and Mouse Winter Revival, Wrong Weapons Mod
You could add each building of type X to a unit group for Player 1, then run a check of "number of units in unit group" to see if it is greater than zero. Then do the same for each player.
I would add all the spawners to a unit group and then use a for each unit in unit group loop to spawn the units based on the owner of the unit from the unit group.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
So I am making a game mode that is not unlike ASOIAF, Ocarina of Time, or Rise of the Witch King, and I'm trying to get the spawning system to function.
I have set up a countdown timer that goes off every 1 minute, and I want to create a trigger that spawns units at a certain point every time the countdown timer expires. Next to the point, there is a spawn building that represents ownership of the point, and I want the trigger to give these spawned units to the owner of the Spawn Building. This is a game mode where all the spawn buildings start off as a neutral building that players must destroy to capture, because of a trigger I have that works like this.
One of the problems that I have been running into is the fact that I cannot just set the value to "Owner of Building" because the building doesn't exist, because of the fact that when player captures this building, a new building is put into place, so creating this trigger and giving the units to the owner of the spawn building doesn't work because the spawn building is destroyed and a new one is put in its place. This is how I set up the trigger initially, shown below, and it doesn't work because of the fact that a new building is put into place. (Also, I don't want the trigger to spawn units if the spawn building is owned by the neutral, which is why the If-Then-else statement is there)
Is there a way to check if this building type is owned by anyone in the game map. These spawn buildings are unique and only one of them exist at all in the game map, so I was hoping so that there was a way to make a condition check if there is just a single instance of the Spawn Building existing, and then giving the spawned units to the Owner of that Spawn Building.
Thank you in advance!
I also go by Krazymouse in SC2.
Past works: Cat and Mouse Winter Revival, Wrong Weapons Mod
You could add each building of type X to a unit group for Player 1, then run a check of "number of units in unit group" to see if it is greater than zero. Then do the same for each player.
<Click Here> To See My Epic Single Player Campaign (LifeForceCampaign.com)
I would add all the spawners to a unit group and then use a for each unit in unit group loop to spawn the units based on the owner of the unit from the unit group.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg