• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Save/Load Questions

Status
Not open for further replies.
Level 6
Joined
Apr 29, 2007
Messages
140
I have imported a Save/Load sytem into my map and have stumbled upon several questions and problems.

The Trigger i have used was made only for player 1 (red).

Here's the trigger:


  • Save Integer Variable
    • Events
      • Player - Player 1 (Red) types a chat message containing -save as An exact match
    • Conditions
    • Actions
      • -------- ------ Random (XXX) ------ --------
      • Cinematic - Clear the screen of text messages for (All players)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers1 = (Random integer number between 1 and 12)
          • Set Save_SavingCode = Save_X[Random_Numbers1]
        • Else - Actions
          • Do nothing
      • -------- ------ Random (A) ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers2 = (Random integer number between 1 and 15)
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + <Empty String>))
        • Else - Actions
          • Do nothing
      • -------- Username Letters (#2) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + <Empty String>)))
        • Else - Actions
          • Do nothing
      • -------- ------ Random (YY) ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers3 = (Random integer number between 1 and 9)
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + <Empty String>))))
        • Else - Actions
          • Do nothing
      • -------- ---- The Numbers (ZZZ) ---- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + (Save_Z[IntegerValue] + <Empty String>)))))
        • Else - Actions
          • Do nothing
      • -------- ------ Random (A) ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers4 = (Random integer number between 1 and 15)
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + (Save_Z[IntegerValue] + (Save_Numbers_RandomA[Random_Numbers4] + <Empty String>))))))
        • Else - Actions
          • Do nothing
      • -------- Username Letters (#1) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + (Save_Z[IntegerValue] + (Save_Numbers_RandomA[Random_Numbers4] + ((Substring((Name of (Triggering
        • Else - Actions
          • Do nothing
      • -------- ------ Random (WW) ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers5 = (Random integer number between 1 and 15)
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + (Save_Z[IntegerValue] + (Save_Numbers_RandomA[Random_Numbers4] + ((Substring((Name of (Triggering
        • Else - Actions
          • Do nothing
      • -------- ------ Random (A) ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers6 = (Random integer number between 1 and 15)
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + (Save_Z[IntegerValue] + (Save_Numbers_RandomA[Random_Numbers4] + ((Substring((Name of (Triggering
        • Else - Actions
          • Do nothing
      • Game - Display to Player Group - Player 1 (Red) for 240.00 seconds the text: Save_SavingCode
The code saves an Integer, which i will be making into saving gold.
The problem is, the IntegerValue is just for player red, correct?

I tried adding an array to the IntegerValue and changed all of the places where the IntegerValue used to be with Integer Value [Player Number of (Trigering Player)], but when I save, it only gives me two letters - vE, which will not load anything.

My question is, will all players be able to use the IntegerValue, WITHOUT an array?

A couple of other things that might help, basically the map is a team game, and there are quests. A reward for the quest gives players a certain ammount of renown (gold) that they will be able to load in later sessions. When the quest is completed the IntegerValue would need to be increased by +2.

If I'm correct, then the IntegerValue would be the same for all players in this format, and if an array didnt work, what would I need to do?

So what am I missing?

Here's my edited trigger with the array that just saved two letters:

  • Save Integer Variable Edit
    • Events
      • Player - Player 1 (Red) types a chat message containing -save as An exact match
      • Player - Player 2 (Blue) types a chat message containing -save as An exact match
    • Conditions
    • Actions
      • -------- ------ Random (XXX) ------ --------
      • Cinematic - Clear the screen of text messages for (All players)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers1 = (Random integer number between 1 and 12)
          • Set Save_SavingCode = Save_X[Random_Numbers1]
        • Else - Actions
          • Do nothing
      • -------- ------ Random (A) ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers2 = (Random integer number between 1 and 15)
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + <Empty String>))
        • Else - Actions
          • Do nothing
      • -------- Username Letters (#2) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + <Empty String>)))
        • Else - Actions
          • Do nothing
      • -------- ------ Random (YY) ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers3 = (Random integer number between 1 and 9)
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + <Empty String>))))
        • Else - Actions
          • Do nothing
      • -------- ---- The Numbers (ZZZ) ---- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + (Save_Z[(Player number of (Triggering player))] + <Empty String>)))))
        • Else - Actions
          • Do nothing
      • -------- ------ Random (A) ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers4 = (Random integer number between 1 and 15)
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + (Save_Z[IntegerValue_Copy[(Player number of (Triggering player))]] + (Save_Numbers_RandomA[Random_
        • Else - Actions
          • Do nothing
      • -------- Username Letters (#1) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + (Save_Z[IntegerValue_Copy[(Player number of (Triggering player))]] + (Save_Numbers_RandomA[Random_
        • Else - Actions
          • Do nothing
      • -------- ------ Random (WW) ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers5 = (Random integer number between 1 and 15)
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + (Save_Z[IntegerValue_Copy[(Player number of (Triggering player))]] + (Save_Numbers_RandomA[Random_
        • Else - Actions
          • Do nothing
      • -------- ------ Random (A) ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) slot status) Equal to Is playing
        • Then - Actions
          • Set Random_Numbers6 = (Random integer number between 1 and 15)
          • Set Save_SavingCode = (Save_X[Random_Numbers1] + (Save_Numbers_RandomA[Random_Numbers2] + ((Substring((Name of (Triggering player)), 2, 2)) + (Save_Numbers_RandomY[Random_Numbers3] + (Save_Z[IntegerValue_Copy[(Player number of (Triggering player))]] + (Save_Numbers_RandomA[Random_
        • Else - Actions
          • Do nothing
      • Game - Display to (All players matching ((Player((Player number of (Triggering player)))) Equal to (Matching player))) for 240.00 seconds the text: (|c000099ff + Save_SavingCode)


And Finally heres the loading part, Edited with the Integer array.

  • Load Integer Variable
    • Events
      • Player - Player 1 (Red) types a chat message containing -load as A substring
      • Player - Player 2 (Blue) types a chat message containing -load as A substring
    • Conditions
    • Actions
      • Set Letter2ofusername = (Substring((Name of (Triggering player)), 2, 2))
      • Set Letter1ofusername = (Substring((Name of (Triggering player)), 1, 1))
      • -------- ------ XXX ------ --------
      • For each (Integer B) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 7, 9)) Equal to Save_X[(Integer B)]
            • Then - Actions
              • Set Load_True[1] = True
            • Else - Actions
              • Do nothing
      • -------- ----- A ----- --------
      • For each (Integer B) from 1 to 15, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 10, 10)) Equal to Save_Numbers_RandomA[(Integer B)]
            • Then - Actions
              • Set Load_True[2] = True
            • Else - Actions
              • Do nothing
      • -------- Ltr 2 of user name --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 11, 11)) Equal to Letter2ofusername
        • Then - Actions
          • Set Load_True[3] = True
        • Else - Actions
      • -------- ------ YY ------ --------
      • For each (Integer B) from 1 to 9, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 12, 13)) Equal to Save_Numbers_RandomY[(Integer B)]
            • Then - Actions
              • Set Load_True[4] = True
            • Else - Actions
              • Do nothing
      • -------- Score (ZZZ) --------
      • For each (Integer B) from 0 to 99, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 14, 16)) Equal to Save_Z[(Integer B)]
            • Then - Actions
              • Set Load_True[5] = True
              • Set IntegerValue_Copy[(Player number of (Triggering player))] = (Integer B)
            • Else - Actions
              • Do nothing
      • -------- ------ A ------ --------
      • For each (Integer B) from 1 to 15, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 17, 17)) Equal to Save_Numbers_RandomA[(Integer B)]
            • Then - Actions
              • Set Load_True[6] = True
            • Else - Actions
              • Do nothing
      • -------- Ltr 1 of user name --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 18, 18)) Equal to Letter1ofusername
        • Then - Actions
          • Set Load_True[7] = True
        • Else - Actions
      • -------- ------ WW ------ --------
      • For each (Integer B) from 1 to 15, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 19, 20)) Equal to Save_Numbers_RandomW[(Integer B)]
            • Then - Actions
              • Set Load_True[8] = True
            • Else - Actions
              • Do nothing
      • -------- ------ A ------ --------
      • For each (Integer B) from 1 to 15, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 21, 21)) Equal to Save_Numbers_RandomA[(Integer B)]
            • Then - Actions
              • Set Load_True[9] = True
            • Else - Actions
              • Do nothing
      • -------- Ltr 1 of user name --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 18, 18)) Equal to Letter1ofusername
        • Then - Actions
          • Set Load_True[6] = True
        • Else - Actions
      • -------- ------ Check if all Code is true, else do nothing ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Load_True[3] Equal to True
          • Load_True[7] Equal to True
        • Then - Actions
          • Game - Display to (All players matching ((Player((Player number of (Triggering player)))) Equal to (Matching player))) the text: Authorization: |cff...
        • Else - Actions
          • Game - Display to (All players matching ((Player((Player number of (Triggering player)))) Equal to (Matching player))) the text: Authorization: |cff...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Load_True[1] Equal to True
          • Load_True[2] Equal to True
          • Load_True[4] Equal to True
          • Load_True[5] Equal to True
          • Load_True[6] Equal to True
          • Load_True[8] Equal to True
          • Load_True[9] Equal to True
        • Then - Actions
          • Game - Display to (All players matching ((Player((Player number of (Triggering player)))) Equal to (Matching player))) the text: Code Data: |cff32cd...
        • Else - Actions
          • Game - Display to (All players matching ((Player((Player number of (Triggering player)))) Equal to (Matching player))) the text: Code Data: |cffD900...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Load_True[1] Equal to True
              • Load_True[2] Equal to True
              • Load_True[3] Equal to True
              • Load_True[4] Equal to True
              • Load_True[5] Equal to True
              • Load_True[6] Equal to True
              • Load_True[7] Equal to True
              • Load_True[8] Equal to True
              • Load_True[9] Equal to True
        • Then - Actions
          • Game - Display to (All players matching ((Player((Player number of (Triggering player)))) Equal to (Matching player))) the text: |cff0080FFLoading C...
          • Set Load_True[1] = False
          • Set Load_True[2] = False
          • Set Load_True[3] = False
          • Set Load_True[4] = False
          • Set Load_True[5] = False
          • Set Load_True[6] = False
          • Set Load_True[7] = False
          • Set Load_True[8] = False
          • Set Load_True[9] = False
          • Player - Add IntegerValue_Copy[(Player number of (Triggering player))] to (Player((Player number of (Triggering player)))) Current gold
        • Else - Actions
          • Game - Display to (All players) the text: |cffD90000Invaild C...
          • Set Load_True[1] = False
          • Set Load_True[2] = False
          • Set Load_True[3] = False
          • Set Load_True[4] = False
          • Set Load_True[5] = False
          • Set Load_True[6] = False
          • Set Load_True[7] = False
          • Set Load_True[8] = False
          • Set Load_True[9] = False
 
Last edited:
I wanted to use an array because you can set it to represent each person.

When a player types load I thought it would load the same integer as everyone else, but I may be wrong, ill try to leave it alone to see what happens

I dont think it will load the same values for each player because every code is unique and -load only loads the code for the player that used -load...
 
Level 9
Joined
Oct 11, 2009
Messages
477
Why there are too much Do Nothing actions? Don't you know they leak, I don't know why Blizzard made that damn function and since it doesn't execute any actions though....:confused::ugly:
 
Status
Not open for further replies.
Top