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

[Solved] Line of Sight problems

Status
Not open for further replies.
Level 5
Joined
Feb 3, 2012
Messages
107
Alright, I have a big problem. I'm working on this project, and the hero has an ability to blink. Now the problem is, the player can blink behind doors, when they're not supposed to! I've tried placing line of sight blockers, but any little gap is enough to blink through. Does anyone have any ideas how to block the line of sight of the player, so that he cannot see through the door? Thanks for any replies!
 
Try this
  • T
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(blink))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (X of (Target point of issued order)) Less than 0.00
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
        • Else - Actions
or even better something like this:

JASS:
struct Blink extends array

    public static method stop takes nothing returns nothing
        local location l = GetOrderPointLoc()
        if GetIssuedOrderId() == OrderId("blink") then
        
            if GetLocationX(l) < 0.00 then //Here you set cordinates of area where will you block blink
            
                call IssueImmediateOrder( GetTriggerUnit(), "stop" )
                call DisplayTextToPlayer(GetOwningPlayer(GetTriggerUnit()), 0. , 0. , "Forbidden Action!")
            endif
        endif
        call RemoveLocation(l)
        set l = null
    endmethod

    private static method onInit takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        loop
            call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER, null)
            set i = i + 1
            exitwhen i == bj_MAX_PLAYER_SLOTS
        endloop
        call TriggerAddAction( t, function thistype.stop)
        set t = null
    endmethod
    
endstruct
 

Attachments

  • sdfsdfsdfd.w3x
    15.9 KB · Views: 53
Level 5
Joined
Feb 3, 2012
Messages
107
Thank you guys for your replies. They are both very good ideas. I'll try both of them and see if my tester can get through XD. And how do you make doors have thicker line of sight pathing? I didn't find it in the object editor. Anyways, thanks for the replies!
 
Level 5
Joined
Feb 3, 2012
Messages
107
Im sorry Dr Super Good but I don't understand what you are trying to say. How do you change their pathing map? It's not in object editor. Sorry I'm new to this sort of thing.

EDIT: Never mind guys, I found a way. While I was testing Kobas' triggers, I found a gate which I could not see through. It turns out that if you put a line of sight blocker inside the gate, it will block the vision of the unit. Creating a minimum range for blink also helped me make sure my tester could not go through. Thx for all the reply, you've all been very helpful! XD
 
Level 5
Joined
Feb 3, 2012
Messages
107
The fields...
Pathing - Pathing Texture (Dead)
Pathing - Pathing Texture

For the gate's destructable object entry control the pathing map it uses.

The field
Art - Occlusion Height

Controls how high the line of sight blocking goes (a field in a unit entry defines how high the unit is).

OH LOLOLOL I found it atlast. Thanks Dr Super Good i should put u in special thanks. For so long trying to find it. lol it was actually in front of me. now how do u do the +rep thingy
 
Status
Not open for further replies.
Top