• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[Solved] Observers as Defoult

Status
Not open for further replies.

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
178
Hello, I would like to make observers in my game as the default option / or referees.

1629454777643.png

I created a trigger that I saw somewhere on the internet but there is one problem.
  • Melee Initialization
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Game - Set Allow observers to On
      • Game - Set Observers on defeat to On
      • For each (Integer A) from 13 to 24, do (Actions)
        • Loop - Actions
          • Set VariableSet TempPlayer = (Player((Integer A)))
          • Player - Hide TempPlayer in the post-game score screen
          • Game - Defeat TempPlayer with the message: <Empty String>
          • Dialog - Show MenuDialog for TempPlayer
          • Dialog - Hide MenuDialog for TempPlayer
          • Custom script: call SetPlayerState( udg_TempPlayer, PLAYER_STATE_OBSERVER, 1)
      • Cinematic - Clear the screen of text messages for (All players).
Dialog isn't initialized anywhere. It is a MenuDialog value with New Dialog (Default) as an initial value.
Let's say everything is fine but I can't see HP BARS.

I've heard of another method that would look like this:
  • Melee Initialization
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Game - Set Allow observers to On
      • Wait 2.00 seconds
      • For each (Integer A) from 13 to 24, do (Actions)
        • Loop - Actions
          • Set VariableSet TempPlayer = (Player((Integer A)))
          • Custom script: call SetPlayerState( udg_TempPlayer, PLAYER_STATE_OBSERVER, 1)
          • Player - Hide TempPlayer in the post-game score screen
Well I'm using
  • Custom script: call SetPlayerState( udg_TempPlayer, PLAYER_STATE_OBSERVER, 1)
in my method to hide player in Allies screen.
1629455573102.png

This one doesn't work because the player can't see anything on the map.

Why do I want to do it this way?
I don't want to make visible area for playable map area coz I want to keep the vision of two teams like it:

1629455714156.png


Also as an observer when I click on a player I can see his resources:

1629455748179.png


My questions are:
1. How to make it work? Or how to create observers as default with vision like above, working hp bars and click on player showing resources?
2. If we find this method somehow is it possible to hide the observer player on the loading screen?

Thanks for the help :D
 

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
178
  • Melee Initialization
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Game - Set Allow observers to On
      • Game - Set Observers on defeat to On
      • Wait 2.00 seconds
      • For each (Integer A) from 13 to 24, do (Actions)
        • Loop - Actions
          • Set VariableSet TempObs = (Player((Integer A)))
          • Custom script: call SetPlayerState( udg_TempObs, PLAYER_STATE_OBSERVER, 1)
          • Player - Hide TempObs in the post-game score screen
          • For each (Integer B) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set VariableSet TempPlayer = (Player((Integer B)))
              • Player - Make TempPlayer treat TempObs as an Ally with shared vision
              • Player - Make TempObs treat TempPlayer as an Ally
Here is solution ^^
 
Status
Not open for further replies.
Top