• 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.

[General] Occluder Height - Bug

Status
Not open for further replies.
Level 13
Joined
Sep 11, 2013
Messages
467
Greetings!
I have a new idea and a new problem.:peasant-work-work:

I want to create a building tower that has the property to create a vision barrier for enemies in order to not let them see in my base.

A worker must build many of those building in the main map, but as you can see in the video below, there is a bug and the enemy can see through the building in the left side if is near towers.

I just changed Occluder Height to 230 for towers like a normal tree, but this is not enough. Those towers will be destroyed and recreated in a normal game (if that information helps).

Is there another way to do this in order to work properly?

The help will be appreciated!

 

Attachments

  • Shade Tower 2024.w3m
    18.1 KB · Views: 4
Last edited:
Level 23
Joined
Dec 4, 2007
Messages
1,558
Sadly this is an ancient problem.
It works properly when facing north/east/south, but somehow not west.
  • at least when getting very close to the model, so you might get away with increasing the pathing.
  • nope, that's a bad solution and cumbersome

edit: Now it also sometimes misbehaves when facing south.
edit2: tried creating a new line of sight blocker model, bigger extents, larger body - no avail
edit3: increased size in the editor - no use
edit4: triggered occlusion height, doesn't seem to work at all
edit5: found a/the culprit:
WC3ScrnShot_012824_145355_000.jpg

inside those quadrants vision behaves like expected, but not if bodies are overlapping!
Check the map for more examples.

Sadly, this doesn't really help buildable structures, only preplaced walls/hedges (i'm using a hedgemaze in my map and now i at least know how to properly place them).
 

Attachments

  • Shade Tower 2024 edits.w3m
    20.6 KB · Views: 7
Last edited:
Level 13
Joined
Sep 11, 2013
Messages
467
Sadly, this doesn't really help buildage structures, only preplaced walls/hedges (i'm using a hedgemaze in my map and now i at least know how to properly place them).
Thanks for help, but this is not a good solution for me..

Can you place some kind of visibility modifier / line of sight blocker on top of the building, then link them together using an array + indexing. If the tower is destroyed you can proceed to destroy it's linked vis/los as well.
It is a very good idea. A friend helped me to do what you said and it seems to be working very well. Thanks!
 
Level 23
Joined
Dec 4, 2007
Messages
1,558
I applied visibility modifiers, but that didn't really help, how did you fix it?
Also my finding isn't foolproof.
Even when aligning to the grid, units outside of it can look through occluder obstacles (what a weird mess).
 
Last edited:
Level 13
Joined
Sep 11, 2013
Messages
467
I applied visibility modifiers, but that didn't really help, how did you fix it?
Also my finding isn't foolproof.
Even when alining to the grid, units outside of it can look through occluder obstacles (what a weird mess).
  • SBT FIN build
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructing structure)) Equal to Scout Tower Z
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SBTIndex Less than or equal to 1000
            • Then - Actions
              • Set VariableSet SBTIndex = (SBTIndex + 1)
              • Unit - Set the custom value of (Constructing structure) to SBTIndex
              • Hashtable - Save Handle Of(Constructing structure) as 0 of SBTIndex in SBTHash.
              • Set VariableSet SBTTempPoint[0] = (Position of (Constructing structure))
              • Set VariableSet SBTTempPoint[1] = (SBTTempPoint[0] offset by (-32.00, -32.00))
              • Set VariableSet SBTTempPoint[2] = (SBTTempPoint[0] offset by (32.00, -32.00))
              • Set VariableSet SBTTempPoint[3] = (SBTTempPoint[0] offset by (-32.00, 32.00))
              • Set VariableSet SBTTempPoint[4] = (SBTTempPoint[0] offset by (32.00, 32.00))
              • For each (Integer B) from 1 to 4, do (Actions)
                • Loop - Actions
                  • Destructible - Create a Line of Sight Blocker Tower at SBTTempPoint[(Integer B)] facing (Random angle) with scale 1.00 and variation 0
                  • Hashtable - Save Handle Of(Last created destructible) as (Integer B) of SBTIndex in SBTHash.
                  • Custom script: call RemoveLocation(udg_SBTTempPoint[GetForLoopIndexB()])
              • Custom script: call RemoveLocation(udg_SBTTempPoint[0])
            • Else - Actions
              • For each (Integer A) from 1 to SBTIndex, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Load 1 of (Integer A) in SBTHash.) is alive) Equal to True
                    • Then - Actions
                    • Else - Actions
                      • Unit - Set the custom value of (Constructing structure) to (Integer A)
                      • Hashtable - Save Handle Of(Constructing structure) as 0 of (Integer A) in SBTHash.
                      • Set VariableSet SBTTempPoint[0] = (Position of (Constructing structure))
                      • Set VariableSet SBTTempPoint[1] = (SBTTempPoint[0] offset by (-32.00, -32.00))
                      • Set VariableSet SBTTempPoint[2] = (SBTTempPoint[0] offset by (32.00, -32.00))
                      • Set VariableSet SBTTempPoint[3] = (SBTTempPoint[0] offset by (-32.00, 32.00))
                      • Set VariableSet SBTTempPoint[4] = (SBTTempPoint[0] offset by (32.00, 32.00))
                      • For each (Integer B) from 1 to 4, do (Actions)
                        • Loop - Actions
                          • Destructible - Create a Line of Sight Blocker Tower at SBTTempPoint[(Integer B)] facing (Random angle) with scale 1.00 and variation 0
                          • Hashtable - Save Handle Of(Last created destructible) as (Integer B) of (Integer A) in SBTHash.
                          • Custom script: call RemoveLocation(udg_SBTTempPoint[GetForLoopIndexB()])
                      • Custom script: call RemoveLocation(udg_SBTTempPoint[0])
        • Else - Actions
I can't explain how it works because i am not a trigger expert.
 
Level 23
Joined
Dec 4, 2007
Messages
1,558
Oh i get how to index it, or use a hashtable.
What i'm asking is:
Are you certain that the vision is getting blocked properly? Because, on my end it's still dysfunctional?!

So in your trigger you are creating 4 custom line of sight blockers (without pathing), slightly offset in all diagonal directions.
You could simply use a big line of sight blocker instead? Or is using 4 smaller ones the fix we'd hoped for?
Like i said, still misbehaving for me.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
So your friend was on the right track with that trigger, but there's some unnecessary stuff:

1) You should either use a Hashtable or Custom Value, in this case you don't need both.
2) You should never set Custom Value yourself, instead, rely on a Unit Indexer.
3) Everything in the Else - Actions section doesn't make sense to me. Why is it necessary?
4) The SBTIndex doesn't make sense to me either. Why is it necessary?

So with that in mind, let's fix it up, luckily your friend got us 90% of the way there:
  • SBT Build
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Set VariableSet SBTTempPoint[0] = (Position of (Constructing structure))
      • Set VariableSet SBTTempPoint[1] = (SBTTempPoint[0] offset by (-32.00, -32.00))
      • Set VariableSet SBTTempPoint[2] = (SBTTempPoint[0] offset by (32.00, -32.00))
      • Set VariableSet SBTTempPoint[3] = (SBTTempPoint[0] offset by (-32.00, 32.00))
      • Set VariableSet SBTTempPoint[4] = (SBTTempPoint[0] offset by (32.00, 32.00))
      • For each SBTLoop from 1 to 4, do (Actions)
        • Loop - Actions
          • Destructible - Create a Line of Sight Blocker Tower at SBTTempPoint[SBTLoop] facing (Random angle) with scale 1.00 and variation 0
          • Hashtable - Save Handle Of(Last created destructible) as SBTLoop of Key(Constructing structure) in SBTHash.
          • Custom script: call RemoveLocation(udg_SBTTempPoint[udg_SBTLoop)
      • Custom script: call RemoveLocation(udg_SBTTempPoint[0])
  • SBT Destroy
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is a Structure) Equal to True
    • Actions
      • For each SBTLoop from 1 to 4, do (Actions)
        • Loop - Actions
          • Destructible - Destroy (Load SBTLoop of Key(Triggering unit) from SBTHash)
1) This will properly surround a constructed structure with Line of Sight blockers and then destroy them when the structure dies (SBT Destroy).
2) I added a new Integer variable called SBTLoop. You should never rely on (Integer A) or (Integer B) in your For Loops.
3) This all assumes that you've created and setup SBTHash in some Initialization trigger, which you obviously have.

To help better understand Hashtables:

A Hashtable essentially gives us an Array with an extra [index]. Additionally, it allows us to use an object's Handle id as an [index], which you can see being done twice in the SBT Build trigger with the (Last created destructible) and the (Constructing structure):
  • Hashtable - Save Handle Of(Last created destructible) as SBTLoop of Key(Constructing structure) in SBTHash.
Understand that every single object in the game (Unit, Item, Point, etc) has what's called a Handle id, which is a unique Integer used for identifying that object. In this case, we're using the Handle id of our (Constructing structure) as one of our two [indexes]. This allows us to Save data to our (Constructing structure) which we can then reference at a later time. This data can be just about anything. We take advantage of this in the SBT Destroy trigger which Loads the saved data from our dying structure in order to Destroy it's four Saved line of sight blockers.

In more simplified terms, here's what our Hashtable is doing:
  • For each SBTLoop from 1 to 4, do (Actions)
    • Loop - Actions
      • Destructible - Create a Line of Sight Blocker Tower at SBTTempPoint[SBTLoop] facing (Random angle) with scale 1.00 and variation 0
      • Set Variable SightBlocker[(Constructing structure)][SBTLoop] = (Last created destructible)
It's just a more powerful Array with an extra [index]. It also has the special feature of being able to use Handle ids instead of just standard Integers like 0, 1, 2, etc.
 
Last edited:
Status
Not open for further replies.
Top