• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Save/Load Problem

Status
Not open for further replies.
Level 22
Joined
Jul 25, 2009
Messages
3,091
Why doesn't this work right? It saves the wrong integer or something. You could have 500,000 exp and it will save 6,000.

  • CG Setup Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Detect Single/Multi Player (ap0calypse) --------
      • Game Cache - Create a game cache from SinglePlayer.w3v
      • Custom script: if ( SaveGameCache(bj_lastCreatedGameCache) == true ) then
      • Set SingleMultiPlayer = 1
      • Custom script: else
      • Set SingleMultiPlayer = ((Number of players in (All players)) + 1)
      • Custom script: endif
      • -------- Actual setup (TriggerHappy) --------
      • Set Alphabet = KvMuhyS1ncY@CP&Odx5jQLeIJt0$XNlpTaBm4rizVo6GE#sAwHD28kUf3FbRq%9Z7gW
      • Set UPPER_CASE_COLOR = |c00ff0000
      • Set LOWER_CASE_COLOR = |c00321602
      • Set OTHER_CHARS_COLOR = |c00ff3300
      • Set SavePlayerName = True
      • Set LOAD_VALID = False
      • Set Compress = TriggerHappy187
      • Custom script: call CG_Init()
      • Set Base = (Length of Alphabet)
      • Set SAVE_FAIL_REASON = <Empty String>
  • CG Save Copy
    • 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 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
    • Conditions
    • Actions
      • Set SaveCount = 1
      • Set Save[SaveCount] = SingleMultiPlayer
      • Set SaveCount = 2
      • Set Save[SaveCount] = PlayerXP[(Player number of (Triggering player))]
      • Custom script: call CG_Execute()
      • Game - Display to (Player group((Triggering player))) the text: (XP Saved: + (String(PlayerXP[(Player number of (Triggering player))])))
      • Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code
  • CG Load Copy
    • 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
    • Conditions
    • Actions
      • Custom script: call CG_Load(SubString(GetEventPlayerChatString(), 6, 999))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LOAD_VALID Equal to False
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: Your code was inval...
          • Skip remaining actions
        • Else - Actions
      • Set LoadCount = 1
      • Set TempInt = Load[LoadCount]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Equal to 1
          • SingleMultiPlayer Not equal to 1
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: This is a single-pl...
          • Skip remaining actions
        • Else - Actions
      • Set LoadCount = 2
      • Set PlayerXP[(Player number of (Triggering player))] = Load[LoadCount]
      • Game - Display to (Player group((Triggering player))) the text: (|c00448844Valid Code|r, XP: + (String(PlayerXP[(Player number of (Triggering player))])))
      • For each (Integer LoopInt) from 1 to RankCount, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerXP[(Player number of (Triggering player))] Greater than or equal to RankXP[LoopInt]
            • Then - Actions
              • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
              • Custom script: call CinematicFilterGenericBJ( 0.00, BLEND_MODE_BLEND, udg_RankMask[udg_LoopInt], 100, 100, 100, 100, 100.00, 100.00, 100.00, 0 )
              • Custom script: endif
              • Set RankR[(Player number of (Triggering player))] = LoopInt
              • Player - Make RankAvailability[LoopInt] Available for training/construction by (Triggering player)
              • Player - Set name of (Triggering player) to ((<Empty String> + (RankAbbrevs[LoopInt] + . )) + PlayerName[(Player number of (Triggering player))])
            • Else - Actions
 
Level 16
Joined
Jun 24, 2009
Messages
1,409
That explains a lot. Could you be more helpful? I didn't make this by the way, Ap0calypse made the save/load system for me, he used TriggerHappy's as the base.

Well I can't believe that Apocalypse made that. Maybe he had a bad day or smthin. But if he really did that, he just removed a biiiiiiig part of the original trigger. A biiii important part. Try to modify it yourself from the original.
 
Level 22
Joined
Jul 25, 2009
Messages
3,091
It's easy and described at the system's page... Also you should start to learn triggering because without it you're skills in mapping are will be rather limited.

I know GUI to its fullest extents, though I've never had to make, or tried to make a save/load system, it's not a lack of skill but a lack of knowledge.

I have another problem if you'd like to take a shot at it take a shot.

  • Set MS_temppoint3[1] = (Position of (Attacked unit))
  • Set MS_TargetPoint1 = (MS_temppoint3[1] offset by (Random real number between 0.00 and 300.00) towards (Random angle) degrees)
  • Custom script: call RemoveLocation(udg_MS_temppoint3[1]
It's for my dynamic missile system I am making by editing Redscore's unfortunately I can't figure out how to remove the location if it's indexed using another integer as the array. At the moment if this fires twice in a certain time period (less than a second) it glitches because temppoint3[1] is already in use.
 
Status
Not open for further replies.
Top