I'm trying to make a map that ends game in victory for whichever player reaches a certain kill count. The only problem is I have absolutely no idea how to get this to work. I can get the action to end in victory easily enough, but I have no idea what event to use or if it's even possible. I have a Leaderboard set up and working, but now I want it to end game in victory for player who reaches a kill level.
I also want to set up an anti-camping zone in the map. I have the Event set up as "Any Unit enters Anti-Camping Region" and I want the final action to be "Kill Units in Anti-Camping Region" but I want it to have a timer so When Timer Expires all units in the region are killed. Is there a way to do this? I've been trying but the timer never works.
Kills Counter
Events
Unit - Any Unit dies
Local Variables
Killer = (Killing player) <Integer>
Conditions
Actions
Variable - Modify Kills[Killer]: + 1
Needed global variable with [array]
Win condition:
Events
Timer - Every 1.0 seconds of Game Time
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Kills[(Picked player)] >= 100
Then
Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
Else
Killing in certain region all units by matching condition (make global variable of TIMER to start it in other triggers if you would want if reaches player certain kills. you can restart timer too..), needs corrections:
Events
Timer - Timer (not global) expires
Local Variables
Timer (not global) = (New timer) <Timer>
Conditions
Actions
Timer - Start Timer (not global) as a One Shot timer that will expire in 60.0 Game Time seconds
Unit Group - Pick each unit in (Any units in Region 001 owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Remove (Picked unit) from the game
I got the victory condition to work easily enough.
But the Anti-Camping Region was a little buggy. I tried the trigger you posted but it gives me a syntax error when I do it so I tried a global timer instead, and it worked perfectly.
I did the following:
Events: Any Unit Enters Region - No-Camping Zone
Actions: Start Timer Anti-Camp Timer
with another trigger
Event: Anti-Camp Timer Expires
Actions: Pick each unit in (Any Units in No-Camping Zone owned by Any Player matching Excluding: Missile, Dead, Hidden with at most Any amount) do actions - Actions: Unit - Remove (Picked Unit) from Game
I'm just curious, how is the anti camping zone designed? Just like a general "no-go" zone, where you get squashed after a certain time? Or do you want to prevent players from staying in the same spot all the time?
A problem with your anti-camp design could be: Player A enters zone->timer started. Timer running out in 3..2..1..Player B enters zone...0. Player B caught for being in the wrong place at the wrong time.
For general anti camp stuff you could work with the "Unit Becomes Idle" Triggers.
For example set a marker of the units current zone/point in an idle candidates list and use a global timer to check periodically, whether your idle candidates left the zone/moved at least X from the initial point.
Or just start a trigger when unit becomes idle, and set a position variable locally. Wait for X seconds and check again.
I set it up as each player has a base and if an enemy is camping in the base, they get booted out.
I added the condition that owner of triggering unit == player 1 if it's in base 2, and 2 if in 1, and so forth. Every new trigger has its own timer then. It seems to work so far. Unit Becomes Idle can easily be countered by moving slightly, but still allowing camping.
I'm also putting a timer window in so the player sees how long they have to get out.
Kills Counter
Events
Unit - Any Unit dies
Local Variables
Killer = (Killing player) <Integer>
Conditions
Actions
Variable - Modify Kills[Killer]: + 1
Needed global variable with [array]
Win condition:
Events
Timer - Every 1.0 seconds of Game Time
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Kills[(Picked player)] >= 100
Then
Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
Else
...
Using a periodic event to check the condition is very evil ;) Just check the condition directly:
IncreaseKillsForPlayerOptions:ActionReturnType:(None)ParametersPlayer=0<Integer>GrammarText:IncreaseKillsForPlayer(Player)HintText:(None)CustomScriptCodeLocalVariablesindex=0<Integer>ActionsVariable-Setindex=(Player-1)Variable-ModifyKills[index]: + 1
General - If (Conditions) then do (Actions) else do (Actions)
If
Kills[index] >= Kill Limit
Then
Game - End game in Victory for player Player (Show dialogs, Show score screen)
Else
// Here you would also update your dialogs etc.
Just a suggestion, Instead of a timer, How about putting negative HP regeneration? By Percentage, So anyone who stays in the Anti-Camp region will slowly lose HP until they die.
@FuzzYD: Go
The idea is nice.
you could also setup an aura, that applies an effect that kills a unit after a certain time if the player does not move out.
I'm trying to make a map that ends game in victory for whichever player reaches a certain kill count. The only problem is I have absolutely no idea how to get this to work. I can get the action to end in victory easily enough, but I have no idea what event to use or if it's even possible. I have a Leaderboard set up and working, but now I want it to end game in victory for player who reaches a kill level.
I also want to set up an anti-camping zone in the map. I have the Event set up as "Any Unit enters Anti-Camping Region" and I want the final action to be "Kill Units in Anti-Camping Region" but I want it to have a timer so When Timer Expires all units in the region are killed. Is there a way to do this? I've been trying but the timer never works.
Can anyone help me?
Kills Counter
Events
Unit - Any Unit dies
Local Variables
Killer = (Killing player) <Integer>
Conditions
Actions
Variable - Modify Kills[Killer]: + 1
Needed global variable with [array]
Win condition:
Events
Timer - Every 1.0 seconds of Game Time
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Kills[(Picked player)] >= 100
Then
Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
Else
Killing in certain region all units by matching condition (make global variable of TIMER to start it in other triggers if you would want if reaches player certain kills. you can restart timer too..), needs corrections:
Events
Timer - Timer (not global) expires
Local Variables
Timer (not global) = (New timer) <Timer>
Conditions
Actions
Timer - Start Timer (not global) as a One Shot timer that will expire in 60.0 Game Time seconds
Unit Group - Pick each unit in (Any units in Region 001 owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Remove (Picked unit) from the game
I hope this works well :)
TwoDie
I got the victory condition to work easily enough.
But the Anti-Camping Region was a little buggy. I tried the trigger you posted but it gives me a syntax error when I do it so I tried a global timer instead, and it worked perfectly.
I did the following:
Events: Any Unit Enters Region - No-Camping Zone
Actions: Start Timer Anti-Camp Timer
with another trigger
Event: Anti-Camp Timer Expires
Actions: Pick each unit in (Any Units in No-Camping Zone owned by Any Player matching Excluding: Missile, Dead, Hidden with at most Any amount) do actions - Actions: Unit - Remove (Picked Unit) from Game
@Titanium321: Go
I'm just curious, how is the anti camping zone designed? Just like a general "no-go" zone, where you get squashed after a certain time? Or do you want to prevent players from staying in the same spot all the time? A problem with your anti-camp design could be: Player A enters zone->timer started. Timer running out in 3..2..1..Player B enters zone...0. Player B caught for being in the wrong place at the wrong time.
For general anti camp stuff you could work with the "Unit Becomes Idle" Triggers. For example set a marker of the units current zone/point in an idle candidates list and use a global timer to check periodically, whether your idle candidates left the zone/moved at least X from the initial point. Or just start a trigger when unit becomes idle, and set a position variable locally. Wait for X seconds and check again.
I set it up as each player has a base and if an enemy is camping in the base, they get booted out.
I added the condition that owner of triggering unit == player 1 if it's in base 2, and 2 if in 1, and so forth. Every new trigger has its own timer then. It seems to work so far. Unit Becomes Idle can easily be countered by moving slightly, but still allowing camping.
I'm also putting a timer window in so the player sees how long they have to get out.
Using a periodic event to check the condition is very evil ;) Just check the condition directly:
@Titanium321: Go
Just a suggestion, Instead of a timer, How about putting negative HP regeneration? By Percentage, So anyone who stays in the Anti-Camp region will slowly lose HP until they die.
@FuzzYD: Go The idea is nice. you could also setup an aura, that applies an effect that kills a unit after a certain time if the player does not move out.
@Pfaeff: Go
His (Pfaeff's) idea is better, I suggest you should use it.