1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. The 15th Mini-Mapping Contest came to an end. The Secrets of Warcraft 3 are soon to be revealed! Come and vote in the public poll for your favorite maps.
    Dismiss Notice
  4. The 12th incarnation of the Music Contest is LIVE! The theme is Synthwave. Knight Rider needs a song to listen to on his journey. You should definitely have some fun with this theme!
    Dismiss Notice
  5. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

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,031
    Resources:
    57
    Models:
    52
    Icons:
    2
    Packs:
    3
    Resources:
    57
    Why is the preview image: "You are viewing a replay"?
     
  2. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,631
    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,234
    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,631
    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:
    306
    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:
    348
    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,491
    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:
    348
    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.