Can anyone tell me if preloading banks for each player is necessary for an rpg that saves mutiple heroes. Also if so does it need to be done in the melee init trigger? If you load your heroes with a button clicking trigger and each player from 1-4 has their own loading trigger, what would make the game some times swap the players bank saves. Example: Player 1 loads player 3s bank file or player 2 loads player 4s heroes. Some times the game loads ok, but when 4 players try to go in theres a strange bank swapping type bug that happens often. Any info will be much appreciated.
The preload action happened before the the map actually beginnings and basically just restores information. Heroes do not need to be "placed" right away and neither do banks have to be opened from the beginning, but preload has to be done to sync up with the map files itself. Preloading shouldn't have issues but you can have seperate triggers/definitions actually access the bank or store the character from the bank into a variable if you want to test and see where your other banking actions might be going wrong.
Also there should only be one click to load trigger if your doing it right and using loops. Preloading for the most part is the only bank action that has to be done specifically individually per player.
Player Loading
Events
Dialog - Any Dialog Item is used by Player 1 with event type Clicked
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Used dialog item) == Load Button
Then
Bank - Preload and synchronize bank "deadlandshero" for player 1
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Bank - Open bank "deadlandshero" for player 1
Bank - Set Option Signature for Bank (Last opened bank) to Enable
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Supplies Used) == 0
Player Viewing[(Triggering player)] == 0
(Bank (Last opened bank) has "atunit" in section "player") == True
Then
Bank - Restore "atunit" of section "player" from bank (Last opened bank) for player 1 at Hero Load facing 0.0
UI - Show game UI for (Player group((Triggering player)))
General - If (Conditions) then do (Actions) else do (Actions)
If
(Bank (Last opened bank) has "exp" in section "player") == True
Then
Unit - Set Hero Units[(Triggering player)] Experience to (Real((Load "exp" of section "player" from bank (Last opened bank) as integer value)))
General - Wait 2.0 Game Time seconds
UI - Clear All Messages for (Player group((Triggering player)))
Visibility - Create a visibility revealer for player (Triggering player) within Outpost
This is a cleaned up example for player 1's loading trigger, i took out some of the camera and dialog actions so its not so cluttered, theres more If then Else actions after this one, that load the other heroes. Player 2,3,4 triggers are like this one.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey everyone,
Can anyone tell me if preloading banks for each player is necessary for an rpg that saves mutiple heroes. Also if so does it need to be done in the melee init trigger? If you load your heroes with a button clicking trigger and each player from 1-4 has their own loading trigger, what would make the game some times swap the players bank saves. Example: Player 1 loads player 3s bank file or player 2 loads player 4s heroes. Some times the game loads ok, but when 4 players try to go in theres a strange bank swapping type bug that happens often. Any info will be much appreciated.
demon
@Demonicus2009: Go
Copy all of the actions for one of the player triggers AS TEXT then post it so we can see what you're doing exactly.
Please use the seach function next time http://www.sc2mapster.com/forums/development/triggers/20081-bank-is-preloading-really-needed/
The preload action happened before the the map actually beginnings and basically just restores information. Heroes do not need to be "placed" right away and neither do banks have to be opened from the beginning, but preload has to be done to sync up with the map files itself. Preloading shouldn't have issues but you can have seperate triggers/definitions actually access the bank or store the character from the bank into a variable if you want to test and see where your other banking actions might be going wrong.
Also there should only be one click to load trigger if your doing it right and using loops. Preloading for the most part is the only bank action that has to be done specifically individually per player.
Player Loading
Events
Dialog - Any Dialog Item is used by Player 1 with event type Clicked
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Used dialog item) == Load Button
Then
Bank - Preload and synchronize bank "deadlandshero" for player 1
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Bank - Open bank "deadlandshero" for player 1
Bank - Set Option Signature for Bank (Last opened bank) to Enable
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player (Triggering player) Supplies Used) == 0
Player Viewing[(Triggering player)] == 0
(Bank (Last opened bank) has "atunit" in section "player") == True
Then
Bank - Restore "atunit" of section "player" from bank (Last opened bank) for player 1 at Hero Load facing 0.0
UI - Show game UI for (Player group((Triggering player)))
General - If (Conditions) then do (Actions) else do (Actions)
If
(Bank (Last opened bank) has "exp" in section "player") == True
Then
Unit - Set Hero Units[(Triggering player)] Experience to (Real((Load "exp" of section "player" from bank (Last opened bank) as integer value)))
General - Wait 2.0 Game Time seconds
UI - Clear All Messages for (Player group((Triggering player)))
Visibility - Create a visibility revealer for player (Triggering player) within Outpost
This is a cleaned up example for player 1's loading trigger, i took out some of the camera and dialog actions so its not so cluttered, theres more If then Else actions after this one, that load the other heroes. Player 2,3,4 triggers are like this one.