1) Banks. Look at this trigger. I can't understand, what's wrong. It was working in test map, but in normal map it gives error. Look:
Terran1Victory
Events
Player - Player (Player 1 from (Players on team 1)) leaves the game with Victory
Local Variables
Conditions
(Controller of player (Player 1 from (Players on team 1))) == User
Actions
Variable - Set Terran1TerranWins = (Terran1TerranWins + 1)
Bank - Preload and synchronize bank Bankname for player (Player 1 from (Players on team 1))
Bank - Open bank Bankname for player (Player 1 from (Players on team 1))
Variable - Set WorkBank = (Last opened bank)
Bank - Set Option Signature for Bank WorkBank to Enable
General - If (Conditions) then do (Actions) else do (Actions)
If
(Bank WorkBank is verified) == True
Then
Bank - Store integer Terran1TerranWins as "TerranWins" of section (Handle of player (Triggering player)) in bank WorkBank
Bank - Save bank WorkBank
Else
UI - Display "An error occured while saving stats..." for (All players) to Subtitle area
Bankname is a string variable with predefined value. I tryed to place preload bank triggers to map initialization, use"triggering player", or directly use "player 1 from players in team 1". It always displays my error message: An error occured while saving stats... Any suggestions?
2) User interface question. There are 2 teams in my game. Team 1 (Terran) and Team 2 (Zerg). When player joins game lobby, he enters team 1 (terran) for example. Then, game host moves this player to team 2 (Zerg), and starts game. This player plays for zerg team, but have terran's user interface and terran sounds like Not enough minerals. How can I change this to zerg for all players in team 2 via triggers?
1. Events can't use functions in their definition. Use the conditions or the first few actions to filter for specific players.
2. Preload is a dummy action in the editor. The editor will remove the action internally and note down the player number and the used string to upload and share that player slot's bank file during map's loading screen among the other players.
You must write down the bank name and the player name as values and not function calls/variables/etc for the preload.
However, the other actions can use variables as they are real actions that are executed during the map.
3. New bank files are always unverified. But they were initially empty. I would suggest that you analyze the status of the saving at map start for the players instead checking that everytime you save something.
Ok, i've tried. No results. I've added my bank to preload section in map, Trying different variations with this trigger didn't give me workable results(((
2Ahli634: Thanks for you map. =) I've found it when started adding banks into my map. It was helpful with understanding banks. But now, it can't help me.
And then... If I can't use functions and variables in open\preload bank triggers, how can i open bank for Player 1 from team 1? It seems that Player 1 from team 1 and player 1 are not the same things.
Terran1Victory
Events
Player - Player Any Player leaves the game with Victory
Local Variables
Conditions
And
Conditions
(Triggering player) == (Player 1 from (Players on team 1))
(Controller of player (Player 1 from (Players on team 1))) == User
Actions
Variable - Set Terran1TerranWins = (Terran1TerranWins + 1)
Bank - Preload and synchronize bank "ZergInTheCity" for player 1
Bank - Open bank "ZergInTheCity" for player 1
Variable - Set WorkBank = (Last opened bank)
Bank - Set Option Signature for Bank WorkBank to Enable
General - If (Conditions) then do (Actions) else do (Actions)
If
(Bank WorkBank is verified) == True
Then
Bank - Store integer Terran1TerranWins as "TerranWins" of section (Handle of player (Triggering player)) in bank WorkBank
Bank - Save bank WorkBank
Else
UI - Display "An error occured while saving stats..." for (All players) to Subtitle area
Preloading requires exact specification. However opening a bank does not, you should be open a bank for player 1 from team 1 if the bank was preloaded for them.
And yes player 1 and player 1 from team 1 are different. player 1 could be on team 2, or 2, or 4, ... etc.
Preloading banks must be done at map initialization like this.
Trigger:TerranVictoryEvents:Player-PlayerAnyPlayerleavesthegamewithVictoryLocalVariables:Conditions:-And-Conditions:--(Triggeringplayer)==(Player1from(Playersonteam1))--(Controllerofplayer(Player1from(Playersonteam1)))==UserActions:Variable-SetTerran1TerranWins=(Terran1TerranWins+1)Bank-Openbank"ZergInTheCity"forplayer1Variable-SetWorkBank=(Lastopenedbank)Bank-SetOptionSignatureforBankWorkBanktoEnableGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(BankWorkBankisverified)==TrueThenBank-StoreintegerTerran1TerranWinsas"TerranWins"ofsection(Handleofplayer(Triggeringplayer))inbankWorkBankBank-SavebankWorkBankElseUI-Display"An error occured while saving stats..."for(Allplayers)toSubtitlearea
However when they leave the game it's too late for that what you need is something like this
Trigger:TerranVictoryEvents:Player-PlayerAnyPlayerleavesthegamewithanyUnitanyunitdiesLocalVariables:Worldbank<bank>Conditions:Actions:Playergroup-RemoveplayertriggeringplayerfromstillingamePlayerGroup-AddplayertriggeringplayertodeadGeneral-If(numberofplayersinstillingame)==1ThenVariable-ModifyTerranTerranWins[player1fromstillingame]+1Bank-Openbank"ZergInTheCity"for(player1fromstillingame)Variable-SetWorkBank=(Lastopenedbank)Bank-SetOptionSignatureforBankWorkBanktoEnableGeneral-If(Conditions)thendo(Actions)elsedo(Actions)-If(BankWorkBankisverified)==True-ThenBank-StoreintegerTerranTerranWins[player1fromstillingame]as"TerranWins"ofsection(Handleofplayer(player1fromstillingame))inbankWorkBankBank-SavebankWorkBank-ElseUI-Display"An error occured while saving stats..."for(Allplayers)toSubtitleareaElse
This will trigger when someone leaves the game or loses one of their unit, what you'd need to do is set it so that it triggers when they leave or they meet the loss conditions for your map. The if then else statement essentially triggers when the win conditions are met. Then it saves the bank for the winning player. This is just a general idea of what you need done, but it's a nice little outline, you'd also have to save the bank for the losing players too, and all that.
1) Banks. Look at this trigger. I can't understand, what's wrong. It was working in test map, but in normal map it gives error. Look:
Terran1Victory
Events
Player - Player (Player 1 from (Players on team 1)) leaves the game with Victory
Local Variables
Conditions
(Controller of player (Player 1 from (Players on team 1))) == User
Actions
Variable - Set Terran1TerranWins = (Terran1TerranWins + 1)
Bank - Preload and synchronize bank Bankname for player (Player 1 from (Players on team 1))
Bank - Open bank Bankname for player (Player 1 from (Players on team 1))
Variable - Set WorkBank = (Last opened bank)
Bank - Set Option Signature for Bank WorkBank to Enable
General - If (Conditions) then do (Actions) else do (Actions)
If
(Bank WorkBank is verified) == True
Then
Bank - Store integer Terran1TerranWins as "TerranWins" of section (Handle of player (Triggering player)) in bank WorkBank
Bank - Save bank WorkBank
Else
UI - Display "An error occured while saving stats..." for (All players) to Subtitle area
Bankname is a string variable with predefined value. I tryed to place preload bank triggers to map initialization, use"triggering player", or directly use "player 1 from players in team 1". It always displays my error message: An error occured while saving stats... Any suggestions?
2) User interface question. There are 2 teams in my game. Team 1 (Terran) and Team 2 (Zerg). When player joins game lobby, he enters team 1 (terran) for example. Then, game host moves this player to team 2 (Zerg), and starts game. This player plays for zerg team, but have terran's user interface and terran sounds like Not enough minerals. How can I change this to zerg for all players in team 2 via triggers?
1. Events can't use functions in their definition. Use the conditions or the first few actions to filter for specific players.
2. Preload is a dummy action in the editor. The editor will remove the action internally and note down the player number and the used string to upload and share that player slot's bank file during map's loading screen among the other players.
You must write down the bank name and the player name as values and not function calls/variables/etc for the preload.
However, the other actions can use variables as they are real actions that are executed during the map.
3. New bank files are always unverified. But they were initially empty. I would suggest that you analyze the status of the saving at map start for the players instead checking that everytime you save something.
Have a look at my bank demo map. At least I hope this file was that.
https://dl.dropboxusercontent.com/u/4479839/bankTest.SC2Map
@Ahli634: Go
Another better way to preload banks is to up top under map, go to preload data, banks, enter the bank name and select who you want it to load for.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Ok, i've tried. No results. I've added my bank to preload section in map, Trying different variations with this trigger didn't give me workable results(((
2Ahli634: Thanks for you map. =) I've found it when started adding banks into my map. It was helpful with understanding banks. But now, it can't help me.
And then... If I can't use functions and variables in open\preload bank triggers, how can i open bank for Player 1 from team 1? It seems that Player 1 from team 1 and player 1 are not the same things.
Terran1Victory
Events
Player - Player Any Player leaves the game with Victory
Local Variables
Conditions
And
Conditions
(Triggering player) == (Player 1 from (Players on team 1))
(Controller of player (Player 1 from (Players on team 1))) == User
Actions
Variable - Set Terran1TerranWins = (Terran1TerranWins + 1)
Bank - Preload and synchronize bank "ZergInTheCity" for player 1
Bank - Open bank "ZergInTheCity" for player 1
Variable - Set WorkBank = (Last opened bank)
Bank - Set Option Signature for Bank WorkBank to Enable
General - If (Conditions) then do (Actions) else do (Actions)
If
(Bank WorkBank is verified) == True
Then
Bank - Store integer Terran1TerranWins as "TerranWins" of section (Handle of player (Triggering player)) in bank WorkBank
Bank - Save bank WorkBank
Else
UI - Display "An error occured while saving stats..." for (All players) to Subtitle area
Preloading requires exact specification. However opening a bank does not, you should be open a bank for player 1 from team 1 if the bank was preloaded for them.
And yes player 1 and player 1 from team 1 are different. player 1 could be on team 2, or 2, or 4, ... etc.
Preloading banks must be done at map initialization like this.
Then in another trigger you can open it
However when they leave the game it's too late for that what you need is something like this
This will trigger when someone leaves the game or loses one of their unit, what you'd need to do is set it so that it triggers when they leave or they meet the loss conditions for your map. The if then else statement essentially triggers when the win conditions are met. Then it saves the bank for the winning player. This is just a general idea of what you need done, but it's a nice little outline, you'd also have to save the bank for the losing players too, and all that.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)