• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Why invisible units are able to walk over on this?

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,183
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:
Level 40
Joined
Feb 27, 2007
Messages
5,090
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:
Level 17
Joined
Jun 2, 2009
Messages
1,183
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 :(
 
Level 40
Joined
Feb 27, 2007
Messages
5,090
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.
 
Level 17
Joined
Jun 2, 2009
Messages
1,183
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.
 
Level 9
Joined
Jul 30, 2012
Messages
156
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.
 
Level 17
Joined
Jun 2, 2009
Messages
1,183
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.
Top