Hello, i am making a map and i have run into a problem...
For a player to lose (Its until last one standing) Their hero and Revive building both need to be dead, but with my limited 14 year old knowledge of the triggers i cant think of anything that will work because there are 15 different heroes and 3 different revive buildings.
I have tried using 'or' in conditions but i dont think its working.
There are 3 triggers and one unit group for each player
This is what i have done:
Trigger 1 (This is adding their hero to the unit group)
Events
Any unit enters entire map
Conditions
owner of triggering unit = 1
OR
conditions
Unit type of unit = Stukov
Unit type of unit = Karass
Unit type of unit = Raynor
this continues on to the 15 heroes.Actions
Add triggering unit to Hero/Revive buildings Player 1
Trigger 2 (This is adding the revive buildings to the unit group)
Events
Any unit enters entire map
Conditions
Owner of Triggering unit = 1
OR
Unit type of unit = Nexus
Unit type of Unit = Hatchery
Unit type of unit = Command Center
Actions
Add Triggering Unit to Hero/Revive unit group Player 1
Trigger 3 (This is where if there are 0 units in the unit group and a unit they own dies they lose)
Events
Any unit Dies
Conditions
Owner of triggering Unit = 1
Number of living units in unit group Hero/Revive Player 1 = 0
Actions
Wait 5 seconds
End game in Defeat for player 1
Display text message blah blah player 1 has lost
PLEASE HELP AND THANKS FOR HELPING!!!
I am, as i said only 14 and i have been using the editor for 5 years but i have been self teaching myself and i am not sure if this is wrong because its not done right or if i'm using the wrong things because it makes sense in my head
It could be that the condition is a prerequisite before a trigger can be triggered. In that case I would change the Event "Any Unit Dies" to "Periodic Event" and remove the first condition "Owner of Triggering Unit == 1".
are you saying that it triggers too often or not at all?
if its the former, then the likely reason is that the units are not in the unit group properly. unit enters entire map rarely really works for me as an event anyway. I would change the event and have them added to the unit group another way. Im pretty sure that units preplaced on the map do not trigger that event, so if the building is already on the map when the game starts it is not getting added to the group.
also remember if you are using a behavior that prevents hero death like in the campaign, I don't believe they count as "dead" so in that case the trigger may never be able to fire.
that shouldn't matter, ive done things like that before. the last trigger looks fine, the problem is with it's conditions, and im pretty sure that owning player = 1 isn't the problem, which only leaves the unit group condition.
Im not sure, but I don't think buildings count as living units. So when the unit dies, it thinks there's no living units left in the unit group. So you might have to additionally check to make sure there are no structures owned by the player in the third trigger.
Hmmm...the triggers maybe count just two units. Idk really, those conditious are using more for simple stuff, for harder things are Action conditions with "If Then Else". I really dont know but i have to use for more conditions If Then Else action.
Sup dude. I think I understand what you are trying to do, just doing it a bit incorrect. I'd also suggest learning just a bit more, as you can make things a lot easier on yourself in the long run. Specifically you should learn arrays, for loops, for each loops, and custom functions.
How you add a unit to a unit group depends on when the unit is added. It seems like you are adding units via the terrain editor, which means they are on the map before the game beings. If that is the case, you need to use the Map Initialization event, then loop through all existing units with a for each loop. If you add a unit via triggers or it spawns while the game is running, you can use the Unit Is Created event.
In looks like you currently intend to have a set of triggers as well as one unit group per player. While that will work, you can make your triggers account for any number of players and use only one unit group variable if you just make your unit group an array. For a very very brief explanation, make a new unit group variable, check the box for array, and set the array size to 15 to count for the maximum number of players. Then instead of referencing "HeroGroupPlayer1" you will use "HeroGroup[1]" where the 1 is actually a numeric value. While a small change, it allows you to do things like use the OwnerOfUnit function to reference a player group.
I've attached a very simple map that shows everything I talked about. My map only has two extra things that your doesn't. First, it has a trigger that slowly kills off the 3 current players just to show the death trigger working. Second, I made a custom function to test weather a unit should be added to the unit group called "Unit Is Heroic". This allows you to keep your list of hero units in one location incase you need to modify it later.
Final tip, use debug messages (Debug Message action) when trying to find errors. Just placing one at the start of a trigger to see if the trigger even starts can be massively helpful.
This may be more explanation than you need, but getting things set up properly now will save you far more time in the long run.
In response to fishy77, anything in the units tab of either the terrain editor or the data editor is considered a unit and testing for being alive works fine. This includes buildings.
Thank you all so much! i didnt know i would get so much help.
I knew it was partly working because the text message would come up in game, but it would happen over and over so i knew somthing was wrong with the unit group or how they where being added.
PS sorry for my knowledge being so basic about triggers.
Hello, i am making a map and i have run into a problem... For a player to lose (Its until last one standing) Their hero and Revive building both need to be dead, but with my limited 14 year old knowledge of the triggers i cant think of anything that will work because there are 15 different heroes and 3 different revive buildings. I have tried using 'or' in conditions but i dont think its working.
There are 3 triggers and one unit group for each player
This is what i have done:
Trigger 1 (This is adding their hero to the unit group) Events Any unit enters entire map Conditions owner of triggering unit = 1 OR conditions Unit type of unit = Stukov Unit type of unit = Karass Unit type of unit = Raynor this continues on to the 15 heroes. Actions Add triggering unit to Hero/Revive buildings Player 1
Trigger 2 (This is adding the revive buildings to the unit group) Events Any unit enters entire map Conditions Owner of Triggering unit = 1 OR Unit type of unit = Nexus Unit type of Unit = Hatchery Unit type of unit = Command Center Actions Add Triggering Unit to Hero/Revive unit group Player 1
Trigger 3 (This is where if there are 0 units in the unit group and a unit they own dies they lose) Events Any unit Dies Conditions Owner of triggering Unit = 1 Number of living units in unit group Hero/Revive Player 1 = 0 Actions Wait 5 seconds End game in Defeat for player 1 Display text message blah blah player 1 has lost
PLEASE HELP AND THANKS FOR HELPING!!! I am, as i said only 14 and i have been using the editor for 5 years but i have been self teaching myself and i am not sure if this is wrong because its not done right or if i'm using the wrong things because it makes sense in my head
what is happening when u run the trigger under the current setup?
a picture of the trigger will also likely help
@joey101d: Go
When the Trigger is triggered it is doing the death sequence but it is happening not when all of the players hero/revive buildings are dead.
It could be that the condition is a prerequisite before a trigger can be triggered. In that case I would change the Event "Any Unit Dies" to "Periodic Event" and remove the first condition "Owner of Triggering Unit == 1".
@BozoOvermind: Go
are you saying that it triggers too often or not at all? if its the former, then the likely reason is that the units are not in the unit group properly. unit enters entire map rarely really works for me as an event anyway. I would change the event and have them added to the unit group another way. Im pretty sure that units preplaced on the map do not trigger that event, so if the building is already on the map when the game starts it is not getting added to the group.
also remember if you are using a behavior that prevents hero death like in the campaign, I don't believe they count as "dead" so in that case the trigger may never be able to fire.
@OutsiderXE: Go
that shouldn't matter, ive done things like that before. the last trigger looks fine, the problem is with it's conditions, and im pretty sure that owning player = 1 isn't the problem, which only leaves the unit group condition.
Im not sure, but I don't think buildings count as living units. So when the unit dies, it thinks there's no living units left in the unit group. So you might have to additionally check to make sure there are no structures owned by the player in the third trigger.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
Hmmm...the triggers maybe count just two units. Idk really, those conditious are using more for simple stuff, for harder things are Action conditions with "If Then Else". I really dont know but i have to use for more conditions If Then Else action.
Try, you will see.
Sup dude. I think I understand what you are trying to do, just doing it a bit incorrect. I'd also suggest learning just a bit more, as you can make things a lot easier on yourself in the long run. Specifically you should learn arrays, for loops, for each loops, and custom functions.
How you add a unit to a unit group depends on when the unit is added. It seems like you are adding units via the terrain editor, which means they are on the map before the game beings. If that is the case, you need to use the Map Initialization event, then loop through all existing units with a for each loop. If you add a unit via triggers or it spawns while the game is running, you can use the Unit Is Created event.
In looks like you currently intend to have a set of triggers as well as one unit group per player. While that will work, you can make your triggers account for any number of players and use only one unit group variable if you just make your unit group an array. For a very very brief explanation, make a new unit group variable, check the box for array, and set the array size to 15 to count for the maximum number of players. Then instead of referencing "HeroGroupPlayer1" you will use "HeroGroup[1]" where the 1 is actually a numeric value. While a small change, it allows you to do things like use the OwnerOfUnit function to reference a player group.
I've attached a very simple map that shows everything I talked about. My map only has two extra things that your doesn't. First, it has a trigger that slowly kills off the 3 current players just to show the death trigger working. Second, I made a custom function to test weather a unit should be added to the unit group called "Unit Is Heroic". This allows you to keep your list of hero units in one location incase you need to modify it later.
Final tip, use debug messages (Debug Message action) when trying to find errors. Just placing one at the start of a trigger to see if the trigger even starts can be massively helpful.
This may be more explanation than you need, but getting things set up properly now will save you far more time in the long run.
In response to fishy77, anything in the units tab of either the terrain editor or the data editor is considered a unit and testing for being alive works fine. This includes buildings.
Thank you all so much! i didnt know i would get so much help. I knew it was partly working because the text message would come up in game, but it would happen over and over so i knew somthing was wrong with the unit group or how they where being added. PS sorry for my knowledge being so basic about triggers.
If you wanna learn more about the editor, the tutorial link in my signature is a great place to start. It has tutorials for almost anything.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here