Vision of flying units

SwedishChef

New Member
Reaction score
32
Hi! How do I change the vision type of the flying units so that they see like ground units? Flying have on standard unobstructed vision so they see everything undependant of the trees and such. Basically I just want them not to be able to see past my Line of sight blockers.
 

mapguy

New Member
Reaction score
46
try this.

set the vision of all flying units to 0.
for each flying unit created you create a dummy with the vision you want. then you create a periodic dummy that is always moved to the position of flying units.
 

SwedishChef

New Member
Reaction score
32
try this.

set the vision of all flying units to 0.
for each flying unit created you create a dummy with the vision you want. then you create a periodic dummy that is always moved to the position of flying units.

Too advanced there is an easier way and I know it. It is an setting on the unit.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
you cannot change the "vision type" of units. flying units can see above any obstacles.
what you can do is make them ground units however thence they cannot fly, too bad. you could for example make them ground units but toggle their collision off but they might fly out of the map bounds then i guess.

what mapguy said is plainly bad, it would cause tremendous lag for many flying units, what is unnecessary.

if you dont want them to see into a specific region and not in general you can use visibility modifiers like setting black mask across the area you like.
 

the_ideal

user title
Reaction score
61
try this.

set the vision of all flying units to 0.
for each flying unit created you create a dummy with the vision you want. then you create a periodic dummy that is always moved to the position of flying units.

To the naysayers in this thread: the quoted suggestion DOES work. I used the opposite in my map: I wanted ground units to have flying sight, so I periodically moved flying dummy units with vision to the positions of my heroes. It did not cause lag, and I do not have a cutting edge computer.

The only problem with the above suggestion is that if a flying unit went over ground that is unpathable for ground units, the dummy units wouldn't be able to get there.

But the trigger actually isn't hard at all. This is what I used in my map. You'll have to tweak it a little.

Trigger:
  • Flyer Vision
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set point1 = (Position of Hero[(Integer B)])
          • Unit - Create 1 Flying Vision Dummy for (Player((Integer B))) at point1 facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_point1)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)

*Note: you're not going to be able to use the integer loop. You'll need to pick every flying unit. If you need help doing that, just post again and I (or someone else) will help you.
 

Moridin

Snow Leopard
Reaction score
144
To the naysayers in this thread: the quoted suggestion DOES work. I used the opposite in my map: I wanted ground units to have flying sight, so I periodically moved flying dummy units with vision to the positions of my heroes. It did not cause lag, and I do not have a cutting edge computer.

The only problem with the above suggestion is that if a flying unit went over ground that is unpathable for ground units, the dummy units wouldn't be able to get there.

But the trigger actually isn't hard at all. This is what I used in my map. You'll have to tweak it a little.

Trigger:

* Flyer Vision
o Events
+ Time - Every 1.00 seconds of game time
o Conditions
o Actions
+ For each (Integer B) from 1 to 10, do (Actions)
# Loop - Actions
* Set point1 = (Position of Hero[(Integer B)])
* Unit - Create 1 Flying Vision Dummy for (Player((Integer B))) at point1 facing Default building facing degrees
* Custom script: call RemoveLocation (udg_point1)
* Unit - Add a 1.00 second Generic expiration timer to (Last created unit)


*Note: you're not going to be able to use the integer loop. You'll need to pick every flying unit. If you need help doing that, just post again and I (or someone else) will help you.

Accname didn't say it doesn't work. It just causes tons of lag if you want it to accurately slide the sight dummies along with the flying unit's position.

For example, your trigger has an event of Time - Every 1.00 second of game time. This is a little too long for accurate vision, seeing as a unit (especially a flying unit) can move a whole lot in a single second.

As you pointed out, if a flying unit moved over deep water or other unwalkable terrain, the dummies would get displaced.

Finally, the trigger you use would create 1 unit per flying unit per second. Creating units takes a lot more processing than moving them, so I would suggest creating them once and then periodically shifting their position.
 

Azylaminaz

Vox Populi
Reaction score
91
Occlusion Height is the field that controls how "high" something is in terms of flying units. If you set the Occlusion Height to something higher than the flying unit, they won't be able to see over it.

Seeing over cliffs, though, is another story. It is natively always possible to see over cliffs if you are a flying unit. A wonderful thing about cliffs, though, is that they never change. This means you can put LoS (Line of Sight) blockers around cliffs. Problem here, though, is that they aren't two way. IE, you won't be able to see down cliffs, then....

Cliffs are the problem... Occlusion height fixes many things (hell, technically, if you wanted, you can even make super high destructs via triggers on some things if you don't want to be able to see through buildings).

An occlusion height of zero means ground units can see past it.

Only destructables have occlusion height fields, BtW.



Edit (apparently
isn't a BBC?):
You can use JASS to make it so ground units can be placed anywhere, including on cliffs or in water (even if land is a millimeter away).
Trigger:
  • Actions
    • Custom script: call SetUnitX(<your unit>, <x coordinate>)
    • Custom script: call SetUnitY(<your unit>, <x coordinate>)
 

SwedishChef

New Member
Reaction score
32
Occlusion Height is the field that controls how "high" something is in terms of flying units. If you set the Occlusion Height to something higher than the flying unit, they won't be able to see over it.

Seeing over cliffs, though, is another story. It is natively always possible to see over cliffs if you are a flying unit. A wonderful thing about cliffs, though, is that they never change. This means you can put LoS (Line of Sight) blockers around cliffs. Problem here, though, is that they aren't two way. IE, you won't be able to see down cliffs, then....

Cliffs are the problem... Occlusion height fixes many things (hell, technically, if you wanted, you can even make super high destructs via triggers on some things if you don't want to be able to see through buildings).

An occlusion height of zero means ground units can see past it.

Only destructables have occlusion height fields, BtW.



Edit (apparently
isn't a BBC?):
You can use JASS to make it so ground units can be placed anywhere, including on cliffs or in water (even if land is a millimeter away).
Trigger:
  • Actions
    • Custom script: call SetUnitX(<your unit>, <x coordinate>)
    • Custom script: call SetUnitY(<your unit>, <x coordinate>)



Good post! Thing is that I have line of sight blockers but still flying units see over them.
 

Moridin

Snow Leopard
Reaction score
144
Open the object editor. Under Destructible -> Pathing Blockers -> Line of sight blocker there is a field called:

Art - Occlusion Height

Try changing that to a very high number, (something higher than the flying height of your units. That should stop them from seeing over it.

Edit: Tested it, doesn't work :(.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
@swedishchef: if possible try just using regions and visibility modifiers. that would be an easy and fast way to do it.
 

mapguy

New Member
Reaction score
46
easy to put a ground dummy in a non-ground place

Code:
remove collision from dummy[841]
move dummy[841] to x
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
easy to put a ground dummy in a non-ground place

Code:
remove collision from dummy[841]
move dummy[841] to x

as Azylaminaz posted this:
Trigger:
  • Custom script: call SetUnitX(<your unit>, <x coordinate>)
    • Custom script: call SetUnitY(<your unit>, <x coordinate>)

is way better and performs perfectly fine.
 

mapguy

New Member
Reaction score
46
as Azylaminaz posted this:
Trigger:
  • Custom script: call SetUnitX(<your unit>, <x coordinate>)
    • Custom script: call SetUnitY(<your unit>, <x coordinate>)

is way better and performs perfectly fine.

I didn`t see his post...
sorry:p
 
General chit-chat
Help Users
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man

      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