• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Blocking visibility and entrance

Status
Not open for further replies.
Level 8
Joined
Sep 24, 2007
Messages
303
Is there any way I could block a specific region on the map from being revealed and entered? Like a black spot that cannot be seen or entered by ANY unit but it would still be inisde the playable area. If there were only foot units in the map, I could simply create a cliff, but it also has air..

Air units can be blocked from entering with a boundary (or pathing blocker), but their line of sight can reach over the boundary (or blocker). So, what I would need to do is something like boundary+protection from revealing the terrain.

Any ideas?
 
Pathing Blockers/Line of Sight Blockers (as well as all other destructibles) have a value named "Art - Occlusion Height".
This value controls how high above the destructible a unit has to be to look over this destructible.

So if you take a pathing blocker a set it's occlusion height to something like 2000, no unit, flying or not, will be able to see through it. Put those blockers around your region and you're done. :)
 
JASS:
function initVisionModifier takes nothing returns nothing
    // lets say the name of your rect (region) is gg_rct_DoNotEnter (which would be a region placed in the
    // World Editor with the name "DoNotEnter".
    local fogmodifier visibility
    
    // the GUI equivilant of this function does not exist, and you need to be able to input your "true" on
    // the last boolean parameter (because that indicates whether or not its before/after unit-vision).
    
    // Parameters
    //      @ Player(0)             - This can be filled with "GetLocalPlayer()" to have the region masked for
    //                              all players. Either that or you could put this inside a loop.
    //
    //      @ FOG_OF_WAR_MASKED     - This tells the modifier to emit a black mask across the rect/region.
    //
    //      @ gg_rct_DoNotEnter     - The region which "FOG_OF_WAR_MASK" will be emitted across.
    //
    //      @ false                 - Shared Vision (not too sure on this one)
    //
    //      @ true                  - Whether the visibility will be modified before or after unit-vision has
    //                              been calculated. If its 'true' then the area will always be a black mask.
    set visibility = CreateFogModifierRect(Player(0), FOG_OF_WAR_MASKED, gg_rct_DoNotEnter, false, true)
    
    // once you've created your visibility modifier, you can enable it.
    call FogModifierStart(visibility)

endfunction

If you don't know JASS then this may be a little confusing, unfortunately GUI only has access to a limited version of this function.
 
Hm... sorry. I thought it would work, but it seems occlusion height has no effect on flying units.
 
can you please insert the code by yourself? :)
I am really jass noob :/


The region is located in the top-right corner. It must not be revealed by any unit nor entered. It contains a dummy unit which must stay there (neutral hostile).

@meOme: Well, increasing the destructible's height makes sense. Will also experiment in this way. But it seems that flying units have different sight mechanics.
 

Attachments

works perfectly! +rep

One last minor thing I would need. I created a trigger that reveals the playable area when players types a text.
The region get's revealed for like ~0.5 seconds and then turns black again. Could I somehow increase the time of the appearance to 1-2 seconds (with wait action or something), or would this destroy the mask to work properly?


10x again!
 
Just to let know why I need this anyway...

My goal is to create anti-hack "system" that will detect maphackers (maphack=making map visible to cheat) in ladder maps.

For this, I only need few things:
1: A dummy unit for each player that can only target some rare unit type (like ward)
2. A dummy ward
3. A place for the ward where it cannot be revealed by any unit, placed on some unimportant place of the map (corners etc). Dummy is placed nearby.

So, the ward is practically not existing for normal players, but when mh-er turns on the hack, it will reveal the ward, causing his dummy to attack it (ward is neutral hostile). And then simple trigger...ward is attacked...display messege: PlayerX has maphack. Gg, banned...

The problem I wrote above is, that the fog reveal is very short and sometimes dummies do not detect the ward therefore not targeting it. They only detect it in ~50% of tries. That's the only reason why I need that extra second.
 
That won't work, map hack reveals the map sure, but the game still doesn't count the spot as revealed so their dummy will not attack. It does however make it able to select units you normally shouldn't be able to and triggers are able to detect that. What you should do is make a periodic trigger that auto selects the unit within the invisible area for players though I'm not sure if it would still select for those not able to see the area due to trigger forcing.
 
There are conditions like: unit is seen to playerX, unit is fogged/masked etc... these conditions are the exact thing to detect mh.

  • check
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (amh 0021 <gen> is visible to Player 1 (Red)) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of Player 1 (Red)) + is using maphack. Is seen)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (amh 0021 <gen> is visible to Player 2 (Blue)) Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: ((Name of Player 1 (Red)) + is using maphack. Notice)
            • Else - Actions
At time of 0.01 seconds, mh detection was 100%, it actually detected the unit like 10-20 times before it got masked again.
The only problem is, that trigger requiers fast periodic time event, which is quite inefficient. If the remask time could be delayed, I wouldn't need such trigger and could do it through a dummy (more efficient and less "lag").
 
I'm telling you =/ Maphacks doesn't work like that. Even if the maphack reveals something for the user the game will still count it as unrevealed for him, the only possible way I can think of to detect it is the one I mentioned.
 
I saw you posted few seconds after me. Please re-comment.
(don't care for Or-conditions, I removed something out)

edit: So by your theory, the only way is to check if player can select that unit? I will try with mh this time (not inbuilt reveal) and see what happens.
 
Status
Not open for further replies.
Back
Top