I have created a king of the hill variant which requires a trigger to run every 1second gametime to check certain conditions of units within the hill region and update a leaderboard with that information on a second by second basis.
As most of you know it's important to alert the players as to when a hill is being taken or when a hill has been captured by an enemy player. I know how to setup the ping, sounds, and messaging to all players, but here is my problem: Since my normal trigger runs every 1 second game-time, If I broadcast a message when someone captures a hill within the bounds of that trigger. then a ping and a message is sent to each player every second as long as that hill is captured.
I need to setup a trigger that only sends out a message one time when a certain condition is met, but I can't seem to find anything in the "events" section that allows me to setup something like this.
FYI: I'm using real# variables that are modified for each hero unit within a given region to update the leaderboard. For example, hero unit within region modify team1 variable +1 and modify team2 variable -1 (visa versa if enemy hero unit within the region. I have set these variables with the boundries of 0 being the lowest and 60 being the highest. If a team reaches 60 on their variable they capture the point. So, it would be ideal to have a "event" that said something like "if team1 variable =60 then do actions: ping, send message. BUT, I can't find anything like this in the events!
You guys are amazingly skilled with triggers so I'm hoping you can help me to solve this problem. Thank you!
Maybe you can just use simple boolean variables to set a state, like "hasAlerted" and then when the hill gets captured, check if the boolean is false, then send the message and set the boolean to true.
Maybe you can just use simple boolean variables to set a state, like "hasAlerted" and then when the hill gets captured, check if the boolean is false, then send the message and set the boolean to true.
Something like that should work.
I'm sorry can you please explain it in simpler terms? Or help me walk through it with how to do what you are saying? I'm new to triggering so I'm not sure what you mean, but I really need to find a solution to this. It's driving me crazy! Thank you
Well you know how to use variables since you say you're using real variables. Just make new variables of type Boolean. Then set the variable to false when you are sending the message the first time, and check to see if it is true before you send it.
- If
(hasAlerted == false)
- Then
Set hasAlerted to true
Send message ("The hill has been captured!")
- Else
Do nothing
Then when the hill gets captured by someone else or something, set the hasAlerted to false, so it will send another alert.
Will this "If then else" action you talked about be used within the 1 second "event"? Also, typically in a game of capture the flag the region gets captured by back and forth by both teams will this continue to work with just this setup?
Well you've got this messaging event running every second, to check for a change in hill ownership. If you place that If Then block in the event, then yeah it will be checked at every interval.
As for being captured the other way.. if I'm imagining this right, all you have to do is set the boolean to false whenever you want a 'hill has been captured' message to go off one time.
Sorry if this is hard to understand.. I'm not very good at teaching people things since I myself am still learning. There might also of course be some super easy way to do this that I don't know about it. This is what I would do, though.
I got your setup to work! There is only one problem now. I did everything just like you said, but the condition being used to check for hill ownership is something like this for both teams: team1=60
I set bounds on the variables so 0being the least and 60 being the greatest anything over 60 will register back to 60. Since my trigger runs if variable =60 (which is all the time if someone owns the hill) the boolean setup is still repeating over and over again. You know what I'm saying? this is ow so frustrating. Any suggestions?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have created a king of the hill variant which requires a trigger to run every 1second gametime to check certain conditions of units within the hill region and update a leaderboard with that information on a second by second basis.
As most of you know it's important to alert the players as to when a hill is being taken or when a hill has been captured by an enemy player. I know how to setup the ping, sounds, and messaging to all players, but here is my problem: Since my normal trigger runs every 1 second game-time, If I broadcast a message when someone captures a hill within the bounds of that trigger. then a ping and a message is sent to each player every second as long as that hill is captured.
I need to setup a trigger that only sends out a message one time when a certain condition is met, but I can't seem to find anything in the "events" section that allows me to setup something like this.
FYI: I'm using real# variables that are modified for each hero unit within a given region to update the leaderboard. For example, hero unit within region modify team1 variable +1 and modify team2 variable -1 (visa versa if enemy hero unit within the region. I have set these variables with the boundries of 0 being the lowest and 60 being the highest. If a team reaches 60 on their variable they capture the point. So, it would be ideal to have a "event" that said something like "if team1 variable =60 then do actions: ping, send message. BUT, I can't find anything like this in the events!
You guys are amazingly skilled with triggers so I'm hoping you can help me to solve this problem. Thank you!
@Etravex: Go
Maybe you can just use simple boolean variables to set a state, like "hasAlerted" and then when the hill gets captured, check if the boolean is false, then send the message and set the boolean to true.
Something like that should work.
I'm sorry can you please explain it in simpler terms? Or help me walk through it with how to do what you are saying? I'm new to triggering so I'm not sure what you mean, but I really need to find a solution to this. It's driving me crazy! Thank you
@Etravex: Go
Well you know how to use variables since you say you're using real variables. Just make new variables of type Boolean. Then set the variable to false when you are sending the message the first time, and check to see if it is true before you send it.
- If
(hasAlerted == false)
- Then
Set hasAlerted to true
Send message ("The hill has been captured!")
- Else
Do nothing
Then when the hill gets captured by someone else or something, set the hasAlerted to false, so it will send another alert.
@anguule: Go
Will this "If then else" action you talked about be used within the 1 second "event"? Also, typically in a game of capture the flag the region gets captured by back and forth by both teams will this continue to work with just this setup?
@Etravex: Go
Well you've got this messaging event running every second, to check for a change in hill ownership. If you place that If Then block in the event, then yeah it will be checked at every interval.
As for being captured the other way.. if I'm imagining this right, all you have to do is set the boolean to false whenever you want a 'hill has been captured' message to go off one time.
Sorry if this is hard to understand.. I'm not very good at teaching people things since I myself am still learning. There might also of course be some super easy way to do this that I don't know about it. This is what I would do, though.
@anguule: Go
I got your setup to work! There is only one problem now. I did everything just like you said, but the condition being used to check for hill ownership is something like this for both teams: team1=60
I set bounds on the variables so 0being the least and 60 being the greatest anything over 60 will register back to 60. Since my trigger runs if variable =60 (which is all the time if someone owns the hill) the boolean setup is still repeating over and over again. You know what I'm saying? this is ow so frustrating. Any suggestions?