I'm trying to rig up a tower defense map, and the current issue i'm facing is how to make the last remaining player the victor. I've got monitors checking the lives of all the players to declare defeat, but i'm not sure whether the game will automatically declare victory for the last player. If not, how do i do it?
I have a timer-based trigger (4 to be exact) that kills off players out of lives, so i have that angle covered. My question lies in what I have to do when there's 1 player left: do I just let it happen and the game will declare that person the victor or if not what system should i rig to manually declare victory for him/her?
I suggest you activate the killing trigger on the trigger that takes a life because the periodic events slows a lot the game and generate a lot of network traffic.
there should be a better way but i would put a variable with numbers of players still playing and a player group with all player and a life array with the size of players..
every time someone loses a life you would check his life in the array and if its 0 you would put -1 in the still playing variable and remove him from player group..
etc etc
and when the still playing is = 1 you would trigger victoury for the player group that would be just the winning player by that time :o
Make 1 global var Active players, and decrease it when someone dies, then make victory trigger and add action Wait4condition - active players var == 1, then figure what player is a winner - (check lives) and display winning text, wheres the problem?
Prooflink please for "wait condition", if you're right i should rework my own map :p
anyway - of TS isnt lazy - add run trigger "victory" to the player death trigger
Well im not sure but I once read in this forum that periodic events and wait for condition shouldn't be used only if there is no other way to do it.
Ask yourself this what makes the "condition" be true?
And if the answer is a trigger or a event you can use, you should change it.
I can't tell you much about network traffic, but you can make it as i say above independently on if it works with the "wait for condition" will be better.
Sorry if that doesnt answer your question.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to rig up a tower defense map, and the current issue i'm facing is how to make the last remaining player the victor. I've got monitors checking the lives of all the players to declare defeat, but i'm not sure whether the game will automatically declare victory for the last player. If not, how do i do it?
@RCIX:
I thought of a solution a that could be to make a function that is activated when a player lose a life and it check every player's lifes.
I will make a map with my idea.
Edit: I see you conected before I made the map, there you go. :P
I have a timer-based trigger (4 to be exact) that kills off players out of lives, so i have that angle covered. My question lies in what I have to do when there's 1 player left: do I just let it happen and the game will declare that person the victor or if not what system should i rig to manually declare victory for him/her?
@RCIX:
I suggest you activate the killing trigger on the trigger that takes a life because the periodic events slows a lot the game and generate a lot of network traffic.
All right, but that still doesn't answer my question ^_^
there should be a better way but i would put a variable with numbers of players still playing and a player group with all player and a life array with the size of players..
every time someone loses a life you would check his life in the array and if its 0 you would put -1 in the still playing variable and remove him from player group..
etc etc
and when the still playing is = 1 you would trigger victoury for the player group that would be just the winning player by that time :o
Make 1 global var Active players, and decrease it when someone dies, then make victory trigger and add action Wait4condition - active players var == 1, then figure what player is a winner - (check lives) and display winning text, wheres the problem?
@RCIX:
I made a map with the system.... did you at last took a look at it?
@Fen1kz:
wait for condition have the same problem as periodic events... should only be used if there is really no other way do it.
Prooflink please for "wait condition", if you're right i should rework my own map :p anyway - of TS isnt lazy - add run trigger "victory" to the player death trigger
Just now i did, and it solves my problem :) Mind if i borrow and modify this code?
@RCIX:
Feel free to use it as you want modify or w/e I made it for you to teach and help. ;D
@mihai14 so what about wait condition network traffic?
@Fen1kz:
Well im not sure but I once read in this forum that periodic events and wait for condition shouldn't be used only if there is no other way to do it.
Ask yourself this what makes the "condition" be true?
And if the answer is a trigger or a event you can use, you should change it.
I can't tell you much about network traffic, but you can make it as i say above independently on if it works with the "wait for condition" will be better.
Sorry if that doesnt answer your question.