• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Visbility

Status
Not open for further replies.
Level 14
Joined
Nov 30, 2013
Messages
926
Hello.
I'm making a map when I get a problem about the visbility modifier.
How I can make my visibility disable?

My 1st trigger where I created the visibility modifier
  • Visibility
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Soul Area <gen>
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set Soul_Area_Visibility[(Integer A)] = (Last created visibility modifier)
          • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Resting Chamber <gen>
Then my 2nd Trigger
  • Soul Area Disable
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Visibility - Disable Soul_Area_Visibility[(Integer A)]
Nothing happen. How I can disable the visibility?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
You create visibility modifier for 1 player, then you save it in 12 variables (in Soul_Area_Visibility[1 up to 12].
Then you repeat this process 16 times (since All players contains all Neutral players).

In the end, what is saved inside those 12 variables is only one visibility modifier for player 16 (== one of the Neutral players).
 
Level 14
Joined
Nov 30, 2013
Messages
926
Alright. Maybe this should be work by now, right?

1st Trigger
  • Visibility
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Soul Area --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Soul Area <gen>
          • For each (Integer Soul_Area_Visibility_Integer) from 1 to 16, do (Actions)
            • Loop - Actions
              • Set Soul_Area_Visibility_Integer = (Player number of (Picked player))
              • Set Soul_Area_Visibility[Soul_Area_Visibility_Integer] = (Last created visibility modifier)
      • -------- Resting Area --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Resting Chamber <gen>
and my 2nd Trigger

  • Soul Area Disable
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Soul_Area_Visibility_Integer) from 1 to 16, do (Actions)
        • Loop - Actions
          • Visibility - Disable Soul_Area_Visibility[Soul_Area_Visibility_Integer]
I left the event loop for 5 seconds on 2nd trigger coz is just a test.
 
Level 11
Joined
Nov 15, 2007
Messages
800
You don't need the loop. Just do your looped actions inside of the "Pick every player" block. "Pick every player" is already a loop, because it does all of those actions for each player.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Do something like this:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer int_var) from 1 to 12, do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for (Player(int_var)) emitting Visibility across *Your region*
          • Set Soul_Area_Visiblity[int_var] = (Last created visibility modifier)
This creates visiblity for players 1-12, since there's no reason to create visiblity modifier for neutrals.
 
Level 14
Joined
Nov 30, 2013
Messages
926
Do something like this:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer int_var) from 1 to 12, do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for (Player(int_var)) emitting Visibility across *Your region*
          • Set Soul_Area_Visiblity[int_var] = (Last created visibility modifier)
This creates visiblity for players 1-12, since there's no reason to create visiblity modifier for neutrals.
Works great. Thx :grin:
 
Status
Not open for further replies.
Top