1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Join Texturing Contest #30 now in a legendary battle of mythological creatures!
    Dismiss Notice
  3. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice
  4. Melee Mapping Contest #3 - Results are out! Congratulate the winners and check plenty of new 4v4 melee maps designed for this competition!
    Dismiss Notice
  5. The winners of our cinematic soundtrack competition have been decided! Step by the Music Contest #11 - Results to check the entries and congratulate the winners!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice

GameStatus - Replay Detection

Submitted by TriggerHappy
This bundle is marked as approved. It works and satisfies the submission rules.
This map allows you to detect if the game is online, offline, or a replay. Based on: [vJASS] - GameStatus (Replay Detection)

System
  • GameStatus
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Initialize --------
      • Set GAME_STATUS_OFFLINE = 0
      • Set GAME_STATUS_ONLINE = 1
      • Set GAME_STATUS_REPLAY = 2
      • -------- Find a playing player --------
      • Set GameStatus_Temp = 1
      • For each (Integer GameStatus_Temp) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set GameStatus_TempPlayer = (Player(GameStatus_Temp))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (GameStatus_TempPlayer controller) Equal to User
              • (GameStatus_TempPlayer slot status) Equal to Is playing
            • Then - Actions
              • Set GameStatus_Temp = 99
            • Else - Actions
      • -------- Find out the game status --------
      • Unit - Create 1 Footman for GameStatus_TempPlayer at (GameStatus_TempPlayer start location) facing Default building facing degrees
      • Selection - Select (Last created unit) for GameStatus_TempPlayer
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Last created unit) is selected by GameStatus_TempPlayer) Equal to True
        • Then - Actions
          • Custom script: if (ReloadGameCachesFromDisk()) then
          • Set GameStatus = GAME_STATUS_OFFLINE
          • Custom script: else
          • Set GameStatus = GAME_STATUS_REPLAY
          • Custom script: endif
        • Else - Actions
          • Set GameStatus = GAME_STATUS_ONLINE
      • Unit - Remove (Last created unit) from the game
      • Set GameStatus_Initialized = True


Example
  • Test
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- Make sure the system was initialized --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GameStatus_Initialized Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: GameStatus has not ...
          • Skip remaining actions
        • Else - Actions
      • -------- Display the game status --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GameStatus Equal to GAME_STATUS_OFFLINE
        • Then - Actions
          • Game - Display to (All players) the text: This game is offlin...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GameStatus Equal to GAME_STATUS_ONLINE
        • Then - Actions
          • Game - Display to (All players) the text: This game is online.
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GameStatus Equal to GAME_STATUS_REPLAY
        • Then - Actions
          • Game - Display to (All players) the text: You are viewing a r...
        • Else - Actions
Contents

GameStatus - Replay Detection (Map)

Reviews
KILLCIDE
System works as intended. Not much else to say about it! Needs Fixed Nothing Suggestions Not sure why you're setting GameStatus_Temp = 1 right before the loop. The GUI loop function automatically sets the integer variable to whatever your lower...
  1. Mister_Haudrauf

    Mister_Haudrauf

    Joined:
    Mar 14, 2014
    Messages:
    1,022
    Resources:
    51
    Models:
    46
    Icons:
    2
    Packs:
    3
    Resources:
    51
    Why is the preview image: "You are viewing a replay"?
     
  2. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,555
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    The system is entitled GameStatus - Replay Detection. I think the answer to your question is very obvious.

    (and THW requires a screenshot)
     
    Last edited: Apr 15, 2017
  3. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,178
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    Maybe better to cover the user interface as well so it's clear that it's indeed taken in replay mode.
     
  4. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,555
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    ..what? Who cares about the screenshot?
     
  5. Lord_Earthfire

    Lord_Earthfire

    Joined:
    Oct 5, 2008
    Messages:
    304
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Thats a simple, yet great system ( which also tells me i need to look more into wc3's structure. I haven't worked much with replays, so i could look to open up a leaderboard so reviwers of a game have more infornation about the game state.
    Will test it soon and give then a rating :) .

    edit: It works ingame and gives a bit flexibility when working on improving someones play. so i can give it a full star rating.
     
    Last edited: Apr 21, 2017
  6. puffdragon

    puffdragon

    Joined:
    Jul 10, 2008
    Messages:
    339
    Resources:
    0
    Resources:
    0
    I just comment to rate it, I tested it in jass and works like a charm.

    Offtopic, make a trigger recycler/utils next :)
     
  7. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,479
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20
    System works as intended. Not much else to say about it!

    Needs Fixed

    • Nothing

    Suggestions

    • Not sure why you're setting GameStatus_Temp = 1 right before the loop. The GUI loop function automatically sets the integer variable to whatever your lower bound value is
    • Instead of breaking out of the loop by setting the loop integer to some arbitary value, you can just use
      exitwhen true
    • Instead of calling (Last created unit) 3 times, you should just store it into a variable

    Status


    Approved
     
  8. puffdragon

    puffdragon

    Joined:
    Jul 10, 2008
    Messages:
    339
    Resources:
    0
    Resources:
    0
    I need to add, I develop my map on 1.27b and I have this tested fully for up to 1.27b.