• 🏆 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!

Does anyone see a problem in this?? please help!

Status
Not open for further replies.
Level 11
Joined
May 10, 2008
Messages
1,001
Im making an RPG with save/load... i buy some items with my hero... but then when i load him.. he has the stats on him.. but no armor... Please help :cry:
heres wat it looks like:

Save:
  • [CodeGenSaveItemCount
    • Events
    • Conditions
    • Actions
      • Set Size = 6
      • Set Value = (Number of items carried by code_Unit)
  • CodeGenSaveItem
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item carried by Unit in slot CodeGenItemIndex) Not equal to No item
        • Then - Actions
          • For each (Integer B) from 0 to (CodeItemsSize - 1), do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by Unit in slot CodeGenItemIndex)) Equal to CodeItems[(Integer B)]
                • Then - Actions
                  • Set Size = 6
                  • Set Value = (Integer B)
                  • Set CodeGenItemIndex = (CodeGenItemIndex + 1)
                  • Skip remaining actions
                • Else - Actions
        • Else - Actions
      • Set Size = 0
      • Set Value = 0
      • Set CodeGenItemIndex = (CodeGenItemIndex + 1)

Load:
  • CodeGenLoadItemCount
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • firstpass Equal to True
        • Then - Actions
          • Set Size = 3
          • Skip remaining actions
        • Else - Actions
      • Set CodeGenItemIndex = Value
  • CodeGenLoadItem
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CodeGenItemIndex Equal to 0
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • firstpass Equal to True
        • Then - Actions
          • Set Size = 6
          • Skip remaining actions
        • Else - Actions
      • Set CodeGenItemIndex = (CodeGenItemIndex - 1)
      • Hero - Create CodeItems[Value] and give it to Unit
 
Last edited:
Level 11
Joined
May 10, 2008
Messages
1,001
Here is my save and load... things....
Save:
  • Save
    • 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
      • Player - Player 3 (Teal) types a chat message containing -save as An exact match
      • Player - Player 4 (Purple) types a chat message containing -save as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -save as An exact match
      • Player - Player 6 (Orange) types a chat message containing -save as An exact match
      • Player - Player 7 (Green) types a chat message containing -save as An exact match
      • Player - Player 8 (Pink) types a chat message containing -save as An exact match
      • Player - Player 9 (Gray) types a chat message containing -save as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -save as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -save as An exact match
      • Player - Player 12 (Brown) types a chat message containing -save as An exact match
    • Conditions
    • Actions
      • Set Unit = (Random unit from (Units currently selected by (Triggering player)))
      • Trigger - Run CustomBufferFuncInit (checking conditions)
      • Set buf_size = 0
      • Set idx_hi = 0
      • Set idx_lo = 5
      • For each (Integer A) from 0 to 63, do (Actions)
        • Loop - Actions
          • Set buf[(Integer A)] = 0
      • Set a_idx = 0
      • Custom script: loop
      • Custom script: exitwhen udg_a_idx > udg_CustomBufferCount - 1
      • Set Size = 0
      • Trigger - Run CustomBufferFuncSaveValue[a_idx] (checking conditions)
      • Set Value = (Min(Value, (power2[Size] - 1)))
      • Set Value = (Max(0, Value))
      • Set a = (Size - 1)
      • Custom script: loop
      • Custom script: exitwhen udg_a < 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • idx_lo Equal to -1
        • Then - Actions
          • Set idx_lo = 5
          • Set idx_hi = (idx_hi + 1)
        • Else - Actions
      • Set b = (Value / power2[a])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • b Not equal to 0
        • Then - Actions
          • Set buf[idx_hi] = (buf[idx_hi] + power2[idx_lo])
          • Set Value = (Value - power2[a])
        • Else - Actions
      • Set idx_lo = (idx_lo - 1)
      • Set a = (a - 1)
      • Custom script: endloop
      • Set a_idx = (a_idx + 1)
      • Custom script: endloop
      • Set Size = (idx_hi + 1)
      • Custom script: set udg_Size = udg_Size + CodeAddChecksum(udg_Size, udg_keycrc_size6, udg_keycrc)
      • Set s = CryptInitKey
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Length of (Name of (Triggering player))) mod 2) Equal to 0
        • Then - Actions
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Set s = (s + ((Name of (Triggering player)) + w))
        • Else - Actions
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Set s = (s + (Name of (Triggering player)))
      • Trigger - Run SystemToolsCryptKeyInit <gen> (checking conditions)
      • Trigger - Run SystemToolsCrypt <gen> (checking conditions)
      • Set s = <Empty String>
      • For each (Integer A) from 0 to (Size - 1), do (Actions)
        • Loop - Actions
          • Set s = (s + basearr[buf[(Integer A)]])
      • Game - Display to (All players) for 30.00 seconds the text: (|cffffcc00Code: |r + s)

Load:

  • Load
    • 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
      • Player - Player 3 (Teal) types a chat message containing -load as A substring
      • Player - Player 4 (Purple) types a chat message containing -load as A substring
      • Player - Player 5 (Yellow) types a chat message containing -load as A substring
      • Player - Player 6 (Orange) types a chat message containing -load as A substring
      • Player - Player 7 (Green) types a chat message containing -load as A substring
      • Player - Player 8 (Pink) types a chat message containing -load as A substring
      • Player - Player 9 (Gray) types a chat message containing -load as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -load as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -load as A substring
      • Player - Player 12 (Brown) types a chat message containing -load as A substring
    • Conditions
    • Actions
      • Trigger - Run CustomBufferFuncInit (checking conditions)
      • Set s = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
      • Custom script: call CodeParseString(udg_s)
      • Set Size = (Length of s)
      • Set s = CryptInitKey
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Length of (Name of (Triggering player))) mod 2) Equal to 0
        • Then - Actions
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Set s = (s + ((Name of (Triggering player)) + w))
        • Else - Actions
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Set s = (s + (Name of (Triggering player)))
      • Trigger - Run SystemToolsCryptKeyInit <gen> (checking conditions)
      • Trigger - Run SystemToolsDecrypt <gen> (checking conditions)
      • Custom script: set udg_i = CodeGetChecksum(udg_Size, udg_keycrc_size6, udg_keycrc)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • i Equal to 0
        • Then - Actions
          • Set buf_size = 0
          • Set idx_hi = 0
          • Set idx_lo = 5
          • Set a_idx = 0
          • Custom script: loop
          • Custom script: exitwhen udg_a_idx > udg_CustomBufferCount - 1
          • Set Size = 0
          • Set firstpass = True
          • Trigger - Run CustomBufferFuncLoadValue[a_idx] (checking conditions)
          • Set Value = 0
          • Set a = (Size - 1)
          • Custom script: loop
          • Custom script: exitwhen udg_a < 0
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • idx_lo Equal to -1
            • Then - Actions
              • Set idx_lo = 5
              • Set idx_hi = (idx_hi + 1)
            • Else - Actions
          • Set b = (buf[idx_hi] / power2[idx_lo])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • b Not equal to 0
            • Then - Actions
              • Set buf[idx_hi] = (buf[idx_hi] - power2[idx_lo])
              • Set Value = (Value + power2[a])
            • Else - Actions
          • Set idx_lo = (idx_lo - 1)
          • Set a = (a - 1)
          • Custom script: endloop
          • Set firstpass = False
          • Trigger - Run CustomBufferFuncLoadValue[a_idx] (checking conditions)
          • Set a_idx = (a_idx + 1)
          • Custom script: endloop
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: |cffffcc00Load Code...
 
Level 11
Joined
May 10, 2008
Messages
1,001
PipeDreams??? man.... i want to use this system though... its just i have no idea to save or load my items up when i load my character.... please help someone... im desperate
 
Status
Not open for further replies.
Top