• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] I cannot create FOG in specific area.

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,146
As the title says.

  • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across (Entire map)
I can give visibility to players but. How to make opposite? I want to DISABLE visibility.
I was searching topics about that but people we're talking about fog (real fog)
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
As Dr Super Good implies the visibility removal (in-game this is called "black mask", and "fog of war" will show silhouettes in the fog but not actual units) will not be permanent. If a player's units move into that area it will become visible. In order to make it permanently un-discoverable you must constantly repeat that action for all players that could potentially see the area. Note that visibility modifiers are objects that should be saved in variables (in memory) and re-used where applicable.
  • Events
    • Time - Elapsed game-time is 0.10 seconds
  • 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 Black Mask across SomeRegion <gen>
        • Set MapModifier[(Player number of (Picked Player))] = (Last created visibility modifier)
  • Events
    • Time - Every 0.50 seconds of game-time
  • Conditions
  • Actions
    • Player Group - Pick every player in ThisGroupCannotDiscoverTheRegion and do (Actions)
      • Loop - Actions
        • Visibility - Disable MapModifier[(Player number of (Picked Player))] //this line may not be necessary
        • Visibility - Enable MapModifier[(Player number of (Picked Player))]
It may be necessary to use some GetLocalPlayer() bologna in the second trigger but for now I suggest you proceed without needing it.
 
Level 17
Joined
Jun 2, 2009
Messages
1,146
I found something weird.

This works.

  • Events
    • Player - Player 1 (Red) types a chat message containing 2 as An exact match
  • Conditions
  • Actions
    • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Entire map)
    • Set Visibility = (Last created visibility modifier)
  • Events
    • Player - Player 1 (Red) types a chat message containing 1 as An exact match
  • Conditions
  • Actions
    • Visibility - Disable Visibility

But this one does not works. Why?

  • Events
    • Player - Player 1 (Red) types a chat message containing 2 as An exact match
  • 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 (Entire map)
    • Set Visibility = (Last created visibility modifier)
  • Events
    • Player - Player 1 (Red) types a chat message containing 1 as An exact match
  • Conditions
  • Actions
    • Visibility - Disable Visibility
This is what i want.

Event: Reveal the entire map for all players.
few seconds later
Action: Hide the entire map for all players.

But i have managed to do that like yours but i have changed it a bit

  • For each (Integer IntVolcano) from 1 to 12, do (Actions)
    • Loop - Actions
      • Visibility - Create an initially Enabled visibility modifier for (Player(IntVolcano)) emitting Visibility across (Entire map)
      • Set Visibility[IntVolcano] = (Last created visibility modifier)
  • FogAc
    • Events
      • Player - Player 1 (Red) types a chat message containing fog as An exact match
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Visibility - Disable Visibility[(Integer A)]
Thank you @Pyrogasm
 
Last edited:
Level 12
Joined
Jan 10, 2023
Messages
191
I found something weird.

This works.

  • Events
    • Player - Player 1 (Red) types a chat message containing 2 as An exact match
  • Conditions
  • Actions
    • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Entire map)
    • Set Visibility = (Last created visibility modifier)
  • Events
    • Player - Player 1 (Red) types a chat message containing 1 as An exact match
  • Conditions
  • Actions
    • Visibility - Disable Visibility

But this one does not works. Why?

  • Events
    • Player - Player 1 (Red) types a chat message containing 2 as An exact match
  • 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 (Entire map)
    • Set Visibility = (Last created visibility modifier)
  • Events
    • Player - Player 1 (Red) types a chat message containing 1 as An exact match
  • Conditions
  • Actions
    • Visibility - Disable Visibility
This is what i want.

Event: Reveal the entire map for all players.
few seconds later
Action: Hide the entire map for all players.
In the second one you make a visibility modifier for every single player, but then you only have one visibility variable.

In the second one you are making 12 or 24 visibility modifiers and then setting your variable equal to the last one which is either player 12's modifier or player 24's modifier.

When you disable it in the next trigger, player 1 enters a chat, but the variable 'Visibility' is turning player 12's visibility on/off.

You either need to make 12/24 visibility variables, one for each player.
 
Level 17
Joined
Jun 2, 2009
Messages
1,146
In the second one you make a visibility modifier for every single player, but then you only have one visibility variable.

In the second one you are making 12 or 24 visibility modifiers and then setting your variable equal to the last one which is either player 12's modifier or player 24's modifier.

When you disable it in the next trigger, player 1 enters a chat, but the variable 'Visibility' is turning player 12's visibility on/off.

You either need to make 12/24 visibility variables, one for each player.
I have recently solved the issue thanks to the Pyrogasm. Just updated my post and you posted a message.
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
But i have managed to do that like yours but i have changed it a bit
That doesn't exactly do the same thing. You have made the whole map visible for all players, but then want are trying to revoke visibility by disabling the modifiers. That will not return the areas to black mask. They will stay discovered as Fog of War (where you can see trees and doodads and terrain but not any living units, etc.). In order to make that area dark for everyone, you need to turn on a modifier that emits Black Mask across that region.

If you have achieved a result that satisfies you, then simply ignore me. But I think you want to do the opposite of what you've shown here.
 
Status
Not open for further replies.
Top