# Why invisible units are able to walk over on this?

Status
Not open for further replies.

#### JFAMAP

Level 17
Hello everyone. I have a skill called Frost Prison that creates unwalkable ice blocks around the caster. Both the caster and victims trapped inside are not able to left this prison.
But somehow they are able to walk over prison.
First question is why invisible disables this one?
Second is how can we solve this?
By the way i don't have a knowledge about Jass coding. If you have a solution please tell me "exactly" what should i do.

JASS:
``````function Trig_Prison_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0CO' // Büyünün Raw Value si
endfunction

function Trig_Prison_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local real r = 350. // Büyünün AOE'Si
local integer dum = 'e00Q'  //Dummy nin Raw Value'si
local integer level = GetUnitAbilityLevel(u, dum)
local real t = 4 //Buzlar1n kalma süresi (saniye cinsinden)
local integer count = 36 // Buz sayisi
local integer z = 360 / count
local integer i = 1
local real angle = -10
local real array x
local real array y
local player p = GetOwningPlayer(u)

set x[1] = GetUnitX(u)
set y[1] = GetUnitY(u)

call SetTerrainPathable(GetUnitX(GetDyingUnit()), GetUnitY(GetDyingUnit()), PATHING_TYPE_WALKABILITY, true)

loop
exitwhen i == count+2
set i = i + 1
set angle = angle + z
set x[i] = x[1] + r * Cos(angle * bj_DEGTORAD)
set y[i] = y[1] + r * Sin(angle * bj_DEGTORAD)
call UnitApplyTimedLife(CreateUnit(p, dum, x[i], y[i], 0), 'BTLF', t)
call SetTerrainPathable(x[i], y[i], PATHING_TYPE_WALKABILITY, false)
endloop
endfunction

function InitTrig_Prison takes nothing returns nothing
local trigger Prison = CreateTrigger(  )
call TriggerRegisterAnyUnitEventBJ( Prison, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( Prison, Condition( function Trig_Prison_Conditions ) )
call TriggerAddAction( Prison, function Trig_Prison_Actions )
endfunction``````

Ok just figured it out, blockers are units. But is there a way to disable it with jass codes?

Last edited:

#### Pyrogasm

Level 40
`call SetTerrainPathable(GetUnitX(GetDyingUnit()), GetUnitY(GetDyingUnit()), PATHING_TYPE_WALKABILITY, true)`
This line makes no sense and does nothing useful because there is no 'dying unit' here. It makes the terrain at the map center (0,0) unwalkable. Permanently, because it never sets it back.

Anyway, now we get to the actual problem which is that setting pathability only works on the grid, affecting whole squares at a time. It sets the pathabilty at (x[_i], y[_i]) in a circle made of 36 different units, but for each call to that pathabilty set function, it will only change the square that the given point belongs to. It's possible there are holes in this because you miss the important connecting square.

That aside, there is the problem that the pathabilty is never set back to normal (which might have its own problems with making previous unwalkable terrain newly walkable)... so little bits of the map will be permanently unwalkable.

So do the dummy units with collision work? If so get rid of all the pathability lines.

Last edited:

#### JFAMAP

Level 17
`call SetTerrainPathable(GetUnitX(GetDyingUnit()), GetUnitY(GetDyingUnit()), PATHING_TYPE_WALKABILITY, true)`
This line makes no sense and does nothing useful because there is no 'dying unit' here. It makes the terrain at the map center (0,0) unwalkable. Permanently, because it never sets it back.

Anyway, now we get to the actual problem which is that setting pathability only works on the grid, affecting whole squares at a time. It sets the pathabilty at (x, y) in a circle made of 36 different units, but for each call to that pathabilty set function, it will only change the square that the given point belongs to. It's possible there are holes in this because you miss the important connecting square.

That aside, there is the problem that the pathabilty is never set back to normal (which might have its own problems with making previous unwalkable terrain newly walkable)... so little bits of the map will be permanently unwalkable.

So do the dummy units with collision work? If so get rid of all the pathability lines.
Thank you for your reply but read my post. "Ok just figured it out, blockers are units. But is there a way to disable it with jass codes?"
I just want to make them not passable if it is possible

#### Pyrogasm

Level 40
That's why I asked this:
So do the dummy units with collision work?

I don't know what you're referring to when you say
First question is why invisible disables this one?

If you're using the ability "Ghost (visible)" that disables collision for that unit so it would not be stopped by the blocker units. If you're using Wind Walk for invisibility that would work the same way and disables unit collision for the caster.

#### JFAMAP

Level 17
That's why I asked this:

I don't know what you're referring to when you say

If you're using the ability "Ghost (visible)" that disables collision for that unit so it would not be stopped by the blocker units. If you're using Wind Walk for invisibility that would work the same way and disables unit collision for the caster.
But how can i create spell like this? I just want to create unpassable circle that blocks units entering or leaving. I have tried to change this dummy unit with doodad and it works but barrier is invisible and it is not removes after 4 seconds.

#### leandrotp

Level 9
Not sure if I'm late to party, but in old Warcraft versions WindWalk would change a unit's pathability to "ITEM", which means that invisible units are unable to walk over items.

You said you were using dummy units to delimit the prison, try using both units AND items, such that both visible and invisible units won't be able to escape. I'm not sure if the latest versions of WC3 still work like this though.

#### JFAMAP

Level 17
Not sure if I'm late to party, but in old Warcraft versions WindWalk would change a unit's pathability to "ITEM", which means that invisible units are unable to walk over items.

You said you were using dummy units to delimit the prison, try using both units AND items, such that both visible and invisible units won't be able to escape. I'm not sure if the latest versions of WC3 still work like this though.
I don't know. Still i am thinking about it and still i haven't figured it out yet..

Status
Not open for further replies.

Replies
10
Views
769
Replies
12
Views
1K
Replies
9
Views
1K
Replies
7
Views
1K
Replies
3
Views
608