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

[Trigger] Check Single Player Trigger

Status
Not open for further replies.
Level 7
Joined
Nov 6, 2019
Messages
186
Ok simple thing, i want the map to disable save/load system if u load up on single player, and i have code for that already.

  • AntiSP
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Player Check --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) controller) Equal to User
          • (Player 1 (Red) slot status) Equal to Is playing
        • Then - Actions
          • Set VariableSet AntiSP = (AntiSP + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) controller) Equal to User
          • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • Set VariableSet AntiSP = (AntiSP + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 (Teal) controller) Equal to User
          • (Player 3 (Teal) slot status) Equal to Is playing
        • Then - Actions
          • Set VariableSet AntiSP = (AntiSP + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 (Purple) controller) Equal to User
          • (Player 4 (Purple) slot status) Equal to Is playing
        • Then - Actions
          • Set VariableSet AntiSP = (AntiSP + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 (Yellow) controller) Equal to User
          • (Player 5 (Yellow) slot status) Equal to Is playing
        • Then - Actions
          • Set VariableSet AntiSP = (AntiSP + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 (Orange) controller) Equal to User
          • (Player 6 (Orange) slot status) Equal to Is playing
        • Then - Actions
          • Set VariableSet AntiSP = (AntiSP + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 7 (Green) controller) Equal to User
          • (Player 7 (Green) slot status) Equal to Is playing
        • Then - Actions
          • Set VariableSet AntiSP = (AntiSP + 1)
        • Else - Actions
      • -------- Anti SP Check --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AntiSP Less than or equal to 1
        • Then - Actions
          • Trigger - Turn off AutoSave <gen>
          • Trigger - Turn off AutoLoad <gen>
          • Trigger - Turn off DeathRunCheck <gen>
          • Trigger - Turn off DeathCalculate <gen>
          • Trigger - Turn off TimerExpiresCalculate <gen>
          • Trigger - Turn off CheckScore <gen>
          • Trigger - Turn off Calculate <gen>
          • Trigger - Turn off CalKills <gen>
          • Trigger - Turn off KillDino <gen>
          • Trigger - Turn off LoadRewards <gen>
          • Game - Display to (All players) the text: [|cffff0000U|rD|cff...
        • Else - Actions
Basically i want codes to work like this.

Singleplayer = Disabled
Solo but via Online Lobby or LAN Lobby = Enabled

And as u can see this code requires more than one player in the game, but want it not to, but not work in single player.

EDIT: i searched and found this, however again it disabling in a online lobby still

  • AntiSPC
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: if bj_isSinglePlayer then
      • Trigger - Turn off AutoSave <gen>
      • Trigger - Turn off AutoLoad <gen>
      • Trigger - Turn off DeathRunCheck <gen>
      • Trigger - Turn off DeathCalculate <gen>
      • Trigger - Turn off TimerExpiresCalculate <gen>
      • Trigger - Turn off CheckScore <gen>
      • Trigger - Turn off Calculate <gen>
      • Trigger - Turn off CalKills <gen>
      • Trigger - Turn off KillDino <gen>
      • Trigger - Turn off LoadRewards <gen>
      • Game - Display to (All players) the text: [|cffff0000U|rD|cff...
      • Custom script: endif
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Try using a cheat code a moment into the game:
  • Events
  • Time - Elapsed game time is 0.10 seconds
  • Actions
  • Cinematic - Disable user control for (All players)
  • Custom script: call Cheat("greedisgood 100000")
  • Wait 0.20 seconds
  • Cinematic - Enable user control for (All players)
  • // Check gold status of each player

If any player has 100000+ gold then you know it's Singleplayer because the cheat worked.

Also, do NOT check the controller/slot status of a player during Map Initialization. This is prone to cause desyncs because not all players have finished loading in yet. Things like these are best done using an early Elapsed game time Event.
 
 
Level 7
Joined
Nov 6, 2019
Messages
186

ty this worked perfectly, makes sense i didnt find as it called Replay detection i didnt search for a replay system
 
Status
Not open for further replies.
Top