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

Save load disable when Single player?

Status
Not open for further replies.
Level 13
Joined
Jun 3, 2011
Messages
1,058
Hi guys u wan't to know how to make a trigger that when a player is playing in a single player it disable the Save / Load
 
Level 9
Joined
Apr 19, 2011
Messages
447
Basically, you want to avoid the player saving and loading by the classic way of opening the menu and clicking Save/Load, right?
Well, that's easy, I did this in my proyect. You have to detect when a player tries to save or load, then you have to show a dialog in screen. This will interrupt the saving or the loading. Then, you have to remove that dialog (otherwise, it'll interrupt the gameplay).
This is the trigger:

  • Avoid Saving
    • Events
      • Game - The game is about to be saved
    • Conditions
    • Actions
      • Dialog - Show YOUR_DIALOG for Player 1 (red)
      • Wait 0.00 seconds
      • Dialog - Hide YOUR_DIALOG for Player 1 (red)
To avoid loading is basically the same, you just have to change the event.
I also asked this once in the forums.
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/possible-prevent-player-saving-218205/

Regards
 
Level 13
Joined
Jun 3, 2011
Messages
1,058
Basically, you want to avoid the player saving and loading by the classic way of opening the menu and clicking Save/Load, right?
Well, that's easy, I did this in my proyect. You have to detect when a player tries to save or load, then you have to show a dialog in screen. This will interrupt the saving or the loading. Then, you have to remove that dialog (otherwise, it'll interrupt the gameplay).
This is the trigger:

  • Avoid Saving
    • Events
      • Game - The game is about to be saved
    • Conditions
    • Actions
      • Dialog - Show YOUR_DIALOG for Player 1 (red)
      • Wait 0.00 seconds
      • Dialog - Hide YOUR_DIALOG for Player 1 (red)
To avoid loading is basically the same, you just have to change the event.
I also asked this once in the forums.
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/possible-prevent-player-saving-218205/

Regards

No this is not i was talking about.. i was talking about a system that you put a code on that's what i meant
 
Level 18
Joined
Mar 7, 2005
Messages
824
Simply check if the "Player is playing" and "Playerslot equal to Player" not Computer..

Just do a check with those two things at beginning with all of your players (so if you use 10 Human players you have to go through all)

While checking you could easily store true values within a variable. So if Player 1 equal to is playing and Playerslot equal to Player/used then Set Variable XYZ + 1

At the end you just check if the variable XYZ is higher than 1 (means more than 1 player) else you can simply disable all save/load triggers.. that's all
 
Level 13
Joined
Jun 3, 2011
Messages
1,058
Simply check if the "Player is playing" and "Playerslot equal to Player" not Computer..

Just do a check with those two things at beginning with all of your players (so if you use 10 Human players you have to go through all)

While checking you could easily store true values within a variable. So if Player 1 equal to is playing and Playerslot equal to Player/used then Set Variable XYZ + 1

At the end you just check if the variable XYZ is higher than 1 (means more than 1 player) else you can simply disable all save/load triggers.. that's all

Can you give me a trigger format for that? i can't really understand
 
Level 18
Joined
Mar 7, 2005
Messages
824
  • Disable SaveLoad
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Check all Players, and add them to a variable to get total players in Game --------
      • -------- You need both conditions, else Computer Slots will be counted, too --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player 1 (Red) controller) Equal to User) and ((Player 1 (Red) slot status) Equal to Is playing)
        • Then - Actions
          • Set PlayersInGame = (PlayersInGame + 1)
        • Else - Actions
          • Do nothing
      • -------- ------------------------------------ --------
      • -------- you can either use multiple IF/Then/Else or this simple version for checking --------
      • -------- ------------------------------------ --------
      • If (((Player 2 (Blue) controller) Equal to User) and ((Player 2 (Blue) slot status) Equal to Is playing)) then do (Set PlayersInGame = (PlayersInGame + 1)) else do (Do nothing)
      • -------- ------------------------------------ --------
      • -------- if we only have 1 player (or less) we disable save/load functions --------
      • -------- ------------------------------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayersInGame Less than or equal to 1
        • Then - Actions
          • Trigger - Turn off SaveTrigger <gen>
          • Trigger - Turn off LoadTrigger <gen>
        • Else - Actions
          • Do nothing
basicly it's something like this, you can adjust it, and add the other players.. I've just used Player 1 and 2 for showing you how it works, just add the other players if needed.
 
Level 13
Joined
Jun 3, 2011
Messages
1,058
  • Disable SaveLoad
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Check all Players, and add them to a variable to get total players in Game --------
      • -------- You need both conditions, else Computer Slots will be counted, too --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player 1 (Red) controller) Equal to User) and ((Player 1 (Red) slot status) Equal to Is playing)
        • Then - Actions
          • Set PlayersInGame = (PlayersInGame + 1)
        • Else - Actions
          • Do nothing
      • -------- ------------------------------------ --------
      • -------- you can either use multiple IF/Then/Else or this simple version for checking --------
      • -------- ------------------------------------ --------
      • If (((Player 2 (Blue) controller) Equal to User) and ((Player 2 (Blue) slot status) Equal to Is playing)) then do (Set PlayersInGame = (PlayersInGame + 1)) else do (Do nothing)
      • -------- ------------------------------------ --------
      • -------- if we only have 1 player (or less) we disable save/load functions --------
      • -------- ------------------------------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayersInGame Less than or equal to 1
        • Then - Actions
          • Trigger - Turn off SaveTrigger <gen>
          • Trigger - Turn off LoadTrigger <gen>
        • Else - Actions
          • Do nothing
basicly it's something like this, you can adjust it, and add the other players.. I've just used Player 1 and 2 for showing you how it works, just add the other players if needed.

Should i put PlayersInGame as Player in Variable?
 
Status
Not open for further replies.
Top