Sight Change (Unit can only see in front, not behind)

MP®

Member
Reaction score
11
Hi I'm making a stealth map, a bit like Ninja vs Samurai and in order to make it possible to backstab someone from behind without being seen, I want the sight to be changed by the units, like this:

naamloosdc9.png


Every player has only 1 unit/hero to control, so no big armies, only 12 units must have this type of sight.

I thought about a way to make everything behind the unit 'black' again, and do this every 0,10 second or something. But I dont know how to get this to work.

Another idea I thought of was by placing a dummy right in front of the actual unit every 0,10 sec or something.
Then make the actual unit with occlussion (this is somehow possible, right? so that you can't see through units neither? Like with trees?)
Then make sight range of the actual unit about 30 and make sight range of the dummy normal. Now the dummy does the looking for the actual unit, and because the dummy can't see through the actual unit, it will only show the area in front of the unit.

Here a drawing to make it more clear:
lineofsightwc3.png

(dark blue circle is the actual unit, light blue circle is the dummy)

The dark blue circle is the actual unit. The light blue circle is the dummy. [not really relevant: the green circle is a tree :)]

As you can see, the actual unit will have a bit more sight than I initially wanted, but this is OK too :)
Will this work you think? And how should I do this without huge memory leaks etc?

How much the units cant see behind them isnt that important, I think the best way is something like 180 degrees in front of them visible and the 180 degrees behind invisible.

Does someone know how to do this? Or is JASS the only way to do this? (I dont know anything about jass)
 

evilwolf

Member
Reaction score
11
Hi I'm making a stealth map, a bit like Ninja vs Samurai and in order to make it possible to backstab someone from behind without being seen, I want the sight to be changed by the units, like this:

naamloosdc9.png


Every player has only 1 unit/hero to control, so no big armies, only 12 units must have this type of sight.

I thought about a way to make everything behind the unit 'black' again, and do this every 0,10 second or something. But I dont know how to get this to work.

Another idea I thought of was by placing a dummy right in front of the actual unit every 0,10 sec or something.
Then make the actual unit with occlussion (this is somehow possible, right? so that you can't see through units neither? Like with trees?)
Then make sight range of the actual unit about 30 and make sight range of the dummy normal. Now the dummy does the looking for the actual unit, and because the dummy can't see through the actual unit, it will only show the area in front of the unit.

Here a drawing to make it more clear:
lineofsightwc3.png

(dark blue circle is the actual unit, light blue circle is the dummy)

The dark blue circle is the actual unit. The light blue circle is the dummy. [not really relevant: the green circle is a tree :)]

As you can see, the actual unit will have a bit more sight than I initially wanted, but this is OK too :)
Will this work you think? And how should I do this without huge memory leaks etc?

How much the units cant see behind them isnt that important, I think the best way is something like 180 degrees in front of them visible and the 180 degrees behind invisible.

Does someone know how to do this? Or is JASS the only way to do this? (I dont know anything about jass)
Use a visiblity modifier...
That is all...
 

MP®

Member
Reaction score
11
but that reveals everything, so the unit will be able to look through trees etc, thats not what I want..
 

MP®

Member
Reaction score
11
Oh you mean: use a visibility modifier to make it black again? Yes I already tried that, but it didnt work.. It was quite a while ago, so i don't remember exactly how I tried it, but i really didnt succeed.. How should the trigger be then?
 

Whisky

New Member
Reaction score
45
Click this. It should be what you are looking for, remember to thank Weep for it.

And evilwolf, for god's sake please don't quote pagefulls of text, at least if you are the first replier in the thread.
 

evilwolf

Member
Reaction score
11
Click this. It should be what you are looking for, remember to thank Weep for it.

And evilwolf, for god's sake please don't quote pagefulls of text, at least if you are the first replier in the thread.
"And evilwolf, for god's sake please don't quote pagefulls of text, at least if you are the first replier in the thread"
Its not all text...
Actually its mostly pictures...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top