- Joined
- Mar 16, 2008
- Messages
- 955
I'm trying to copy a load save system that is more complicated from one of my maps and move it to another map. All I want it to do is simply count the number of games each player has played. Could anyone help me figure this out? Thank you.
Triggers:
Triggers:
-
Custom Auto Save
-
Events
-
Conditions
-
Actions
-
-------- ran by victory triggers --------
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
-
Set VariableSet SaveLoadEvent_Player = (Picked player)
-
Set VariableSet SaveLoadEvent_PN = (Player number of SaveLoadEvent_Player)
-
-------- --------
-
-------- --------
-
-------- --------
-
-------- --------
-
-------- PUT YOUR SAVE ACTIONS HERE: --------
-
Set VariableSet SaveCount = -1
-
-------- --------
-
-------- --------
-
-------- GAMES PLAYED: --------
-
Set VariableSet SaveCount = (SaveCount + 1)
-
Set VariableSet SaveMaxValue[SaveCount] = 24
-
Set VariableSet SaveValue[SaveCount] = (games_played[SaveLoadEvent_PN] + 1)
-
-------- --------
-
-------- STOP --------
-
-------- --------
-
-------- --------
-
-------- Save to disk: --------
-
Custom script: set udg_SaveTempInt = Savecode.create()
-
For each (Integer A_load_save) from 0 to SaveCount, do (Actions)
-
Loop - Actions
-
Custom script: call Savecode(udg_SaveTempInt).Encode(udg_SaveValue[bj_forLoopAIndex], udg_SaveMaxValue[bj_forLoopAIndex])
-
-
-
Set VariableSet SaveTempString = <Empty String>
-
Custom script: set udg_SaveTempString = Savecode(udg_SaveTempInt).Save(udg_SaveLoadEvent_Player, 1)
-
Custom script: call SaveFile.create(udg_SaveLoadEvent_Player, "Save", 1, udg_SaveTempString)
-
-------- --------
-
-------- Displays Message to Players (best spot to put this) --------
-
-------- --------
-
Game - Display to (All players) the text: |cff00ff00Game play...
-
-
-
-
-
Custom Load Event
-
Events
-
Game - SaveLoadEvent becomes Equal to 1.00
-
-
Conditions
-
Actions
-
-------- Validate: --------
-
Custom script: set udg_SaveTempInt = integer(Savecode.create())
-
Custom script: if not (Savecode(udg_SaveTempInt).Load(udg_SaveLoadEvent_Player, udg_SaveLoadEvent_Code, 1)) then
-
Game - Display to (Player group(SaveLoadEvent_Player)) the text: Invalid load code (...
-
Skip remaining actions
-
Custom script: endif
-
-------- --------
-
-------- --------
-
-------- PUT YOUR LOAD ACTIONS HERE (Reverse Order): --------
-
Set VariableSet SaveCount = -1
-
-------- --------
-
-------- GAMES PLAYED: --------
-
Set VariableSet SaveCount = (SaveCount + 1)
-
Set VariableSet SaveMaxValue[SaveCount] = 24
-
Custom script: call SaveHelper.GUILoadNext()
-
Set VariableSet games_played[SaveLoadEvent_PN] = SaveValue[SaveCount]
-
-------- --------
-
-------- STOP --------
-
-------- --------
-
-------- --------
-
Custom script: call Savecode(udg_SaveTempInt).destroy()
-
-
-
Custom Auto Load Start
-
Events
-
Time - Elapsed game time is 3.00 seconds
-
-
Conditions
-
Actions
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
-
Player Group - Add (Picked player) to load_save_file_group
-
-
-
Countdown Timer - Start load_save_file_timer as a Repeating timer that will expire in 0.25 seconds
-
-
-
Custom Auto Load Repeat
-
Events
-
Time - load_save_file_timer expires
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of players in load_save_file_group) Greater than 0
-
-
Then - Actions
-
Set VariableSet SaveLoadEvent_Player = (Random player from load_save_file_group)
-
Set VariableSet SaveLoadEvent_PN = (Player number of SaveLoadEvent_Player)
-
Player Group - Remove SaveLoadEvent_Player from load_save_file_group.
-
Custom script: call LoadSaveSlot(udg_SaveLoadEvent_Player, 1)
-
-
Else - Actions
-
-------- All players have loaded: --------
-
Countdown Timer - Start load_save_rewards_timer as a One-shot timer that will expire in 0.50 seconds
-
Custom script: call DestroyForce( udg_load_save_file_group )
-
Countdown Timer - Pause load_save_file_timer
-
Custom script: call DestroyTimer( GetExpiredTimer() )
-
-
-
-
-
Save Init
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- This willl be the directory the save codes will be saved to. Set it to your Map Name. --------
-
Set VariableSet MapName = Kings_and_Knights_alpha
-
-------- ------------------- --------
-
-------- This message will display to players who don't have local files enabled --------
-
Set VariableSet LocalFiles_WarningMessage = |cffe53b3bYou need to enable local files to load your character from disk on patches prior to 1.30!
-
Custom script: set udg_LocalFiles_WarningMessage = udg_LocalFiles_WarningMessage + "\n\n"
-
-
Last edited: