FootysMaXeD
New Member
- Reaction score
- 0
So i'm back again. I'm trying to fix the leaks in my triggers and fix the MUI problem. I've started learning JASS (Jass Intro), but I need help here please.
These are two system triggers I have in my map. They determine what happens to a player when his base is killed, or when he leaves. They both include a Gold Split system, which from initial testing is working nicely. I am not sure what Local variable(s) to use and I also don't know how to destroy a Player Variable (not Player Group).
Help appreciated.
These are two system triggers I have in my map. They determine what happens to a player when his base is killed, or when he leaves. They both include a Gold Split system, which from initial testing is working nicely. I am not sure what Local variable(s) to use and I also don't know how to destroy a Player Variable (not Player Group).
Trigger:
- Base Killed
- Events
- Unit - A unit Dies
- Conditions
- Or - Any (Conditions) are true
- Conditions
- (Unit-type of (Dying unit)) Equal to Initiate (Footmen)
- (Unit-type of (Dying unit)) Equal to Alliance Rank 1 (Riflemen)
- (Unit-type of (Dying unit)) Equal to Alliance Rank 2 (Captain)
- (Unit-type of (Dying unit)) Equal to Alliance Rank 3 (Spell Breakers)
- (Unit-type of (Dying unit)) Equal to Alliance Rank 4 (Knights)
- (Unit-type of (Dying unit)) Equal to Horde Rank 1 (Spirit Walkers)
- (Unit-type of (Dying unit)) Equal to Horde Rank 2 (Raiders)
- (Unit-type of (Dying unit)) Equal to Horde Rank 3 (Warlock + Grunt)
- (Unit-type of (Dying unit)) Equal to Horde Rank 4 (Tauren)
- (Unit-type of (Dying unit)) Equal to Scourge Rank 1
- (Unit-type of (Dying unit)) Equal to Scourge Rank 2
- (Unit-type of (Dying unit)) Equal to Scourge Rank 3
- (Unit-type of (Dying unit)) Equal to Scourge Rank 4
- (Unit-type of (Dying unit)) Equal to Night Elf Rank 1 (Treants)
- (Unit-type of (Dying unit)) Equal to Night Elf Rank 2 (Scouts)
- (Unit-type of (Dying unit)) Equal to Night Elf Rank 3 (Huntresses)
- (Unit-type of (Dying unit)) Equal to Night Elf Rank 4 (Dryads)
- Conditions
- Or - Any (Conditions) are true
- Actions
- Set TempPoint1 = (Position of (Dying unit))
- Set Temp_Player = (Owner of (Dying unit))
- Player Group - Remove Temp_Player from (All players)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Temp_Player is in ForceOne) Equal to True
- Then - Actions
- Player Group - Remove Temp_Player from ForceOne
- Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceOne))
- Player Group - Pick every player in ForceOne and do (Player - Add Temp_Integer to (Picked player) Current gold)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Temp_Player is in ForceTwo) Equal to True
- Then - Actions
- Player Group - Remove Temp_Player from ForceTwo
- Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceTwo))
- Player Group - Pick every player in ForceTwo and do (Player - Add Temp_Integer to (Picked player) Current gold)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Temp_Player is in ForceThree) Equal to True
- Then - Actions
- Player Group - Remove Temp_Player from ForceThree
- Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceThree))
- Player Group - Pick every player in ForceThree and do (Player - Add Temp_Integer to (Picked player) Current gold)
- Else - Actions
- Player Group - Remove Temp_Player from ForceFour
- Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceFour))
- Player Group - Pick every player in ForceFour and do (Player - Add Temp_Integer to (Picked player) Current gold)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Set PlayerDefeated[(Player number of Temp_Player)] = (PlayerDefeated[(Player number of (Triggering player))] + 1)
- Player - Set Temp_Player Current gold to 0
- Game - Display to (All players) for 15.00 seconds the text: (PlayerNames[(Player number of Temp_Player)] + has been defeated!)
- Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Player number of Temp_Player) + 1) to (PlayerNames[(Player number of Temp_Player)] + (Killed))
- Set TempGroup1 = (Units owned by Temp_Player)
- Unit Group - Pick every unit in TempGroup1 and do (Actions)
- Loop - Actions
- Unit - Remove (Picked unit) from the game
- Wait 3.00 seconds
- Unit - Remove (Picked unit) from the game
- Wait 3.00 seconds
- Unit - Remove (Picked unit) from the game
- Loop - Actions
- Custom script: call DestroyGroup (udg_TempGroup1)
- Player Group - Pick every player in (All players) and do (Actions)
- Loop - Actions
- Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across (Region centered at TempPoint1 with size (600.00, 600.00))
- Wait 10.00 seconds
- Visibility - Disable (Last created visibility modifier)
- Loop - Actions
- Custom script: call RemoveLocation (udg_TempPoint1)
- Events
Trigger:
- Player Leaves
- Events
- Player - Player 1 (Red) leaves the game
- Player - Player 2 (Blue) leaves the game
- Player - Player 3 (Teal) leaves the game
- Player - Player 4 (Purple) leaves the game
- Player - Player 5 (Yellow) leaves the game
- Player - Player 6 (Orange) leaves the game
- Player - Player 7 (Green) leaves the game
- Player - Player 8 (Pink) leaves the game
- Player - Player 9 (Gray) leaves the game
- Player - Player 10 (Light Blue) leaves the game
- Player - Player 11 (Dark Green) leaves the game
- Player - Player 12 (Brown) leaves the game
- Conditions
- Actions
- Set Temp_Player = (Triggering player)
- Game - Display to (All players) the text: (PlayerNames[(Player number of Temp_Player)] + has left the game!)
- Player Group - Remove Temp_Player from (All players)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Temp_Player is in ForceOne) Equal to True
- Then - Actions
- Player Group - Remove Temp_Player from ForceOne
- Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceOne))
- Player Group - Pick every player in ForceOne and do (Player - Add Temp_Integer to (Picked player) Current gold)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Temp_Player is in ForceTwo) Equal to True
- Then - Actions
- Player Group - Remove Temp_Player from ForceTwo
- Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceTwo))
- Player Group - Pick every player in ForceTwo and do (Player - Add Temp_Integer to (Picked player) Current gold)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Temp_Player is in ForceThree) Equal to True
- Then - Actions
- Player Group - Remove Temp_Player from ForceThree
- Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceThree))
- Player Group - Pick every player in ForceThree and do (Player - Add Temp_Integer to (Picked player) Current gold)
- Else - Actions
- Player Group - Remove Temp_Player from ForceFour
- Set Temp_Integer = ((Temp_Player Current gold) / (Number of players in ForceFour))
- Player Group - Pick every player in ForceFour and do (Player - Add Temp_Integer to (Picked player) Current gold)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Set PlayerDefeated[(Player number of Temp_Player)] = (PlayerDefeated[(Player number of (Triggering player))] + 2)
- Set TempGroup1 = (Units owned by Temp_Player)
- Unit Group - Pick every unit in TempGroup1 and do (Actions)
- Loop - Actions
- Unit - Remove (Picked unit) from the game
- Loop - Actions
- Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Player number of (Triggering player)) + 1) to (PlayerNames[(Player number of (Triggering player))] + (Left))
- Custom script: call DestroyGroup (udg_TempGroup1)
- Events
Help appreciated.