| 03-15-2007, 05:27 PM | #1 |
Ability: Entrapment Description: Creates a circle of dummy units around the caster (for effects only) and converts the ground under those units to be unpathable. The function then waits (level of ability + 6 ) seconds before going through and converting the terrain to be repathable. Problem: The terrain isn't actually pathable at the end of the function. JASS:function Trig_Entrapment_Actions takes nothing returns nothing local integer a = 0 local unit u = GetTriggerUnit() local player p = GetOwningPlayer( u ) local integer level = GetUnitAbilityLevel( u, 'A01I') local location aloc = GetUnitLoc( u ) local real ax local real ay local unit aunit loop exitwhen a >= 361 set ax = GetLocationX(aloc) + 400.00 * Cos(a * bj_DEGTORAD) set ay = GetLocationY(aloc) + 400.00 * Sin(a * bj_DEGTORAD) if not IsTerrainPathable(ax, ay, PATHING_TYPE_WALKABILITY) then set aunit = CreateUnit( p, 'o001', ax, ay, bj_UNIT_FACING ) call SetUnitX( aunit, ax) call SetUnitY( aunit, ay) call SetTerrainPathable( ax, ay, PATHING_TYPE_WALKABILITY, false) call UnitApplyTimedLife( aunit, 'BTLF', (level + 6) ) endif set a = a + 5 endloop call TriggerSleepAction( level + 6 ) loop exitwhen a >= 361 set ax = GetLocationX(aloc) + 400.00 * Cos(a * bj_DEGTORAD) set ay = GetLocationY(aloc) + 400.00 * Sin(a * bj_DEGTORAD) call SetTerrainPathable( ax, ay, PATHING_TYPE_WALKABILITY, true) set a = a + 5 endloop call RemoveLocation( aloc ) call RemoveUnit( aunit ) set u = null set p = null set aloc = null set aunit = null endfunction |
| 03-15-2007, 06:05 PM | #2 |
SetTerrainPathable may actually be the wrong way round. The get function is (so flip true to false and false to true). |
| 03-15-2007, 06:18 PM | #3 | |
Quote:
Am i the only one who stumbles over bits of information AFTER you spend an hour figuring it out? ![]() And, in my sleep deprived state, I see nothing wrong with that fucntion. Especially, if i understand correctly, its setting the terrain to be unpathable. |
| 03-15-2007, 06:25 PM | #4 |
Everything works well: JASS:if not IsTerrainPathable(ax, ay, PATHING_TYPE_WALKABILITY) then Returns correctly if the terrain is pathable and whatnot. The issue is that: JASS:call SetTerrainPathable( ax, ay, PATHING_TYPE_WALKABILITY, true) Does not set the terrain to be pathable as it aught to. |
| 03-15-2007, 07:14 PM | #5 |
i think i found the problem, you forget to set the value for the integer a after the first Loop, so it will exit the loop instantly. |
| 03-15-2007, 07:19 PM | #6 |
ROFL...yep, that might be a problem...I'll test it later on, but i'm sure that'll fix it..thanks Fire. |
| 03-09-2008, 07:17 PM | #7 |
hmm i don't understand how the SetTerrainPathable work. I mean it takes only X and Y, so what is the size of the (rect, circle ?) . I can't believe the terrain will change only on a location ... |
| 03-09-2008, 08:00 PM | #8 |
How come no one ever told me about this? Could I preload code like this at the start of a map to make the terrain under a tree appear unpathable? What is the size of the spot? Could this be created under moving units? |
| 03-09-2008, 09:14 PM | #9 |
hmm i've tested and it's a rect. JASS:Xmin = 32*R2I (X/32) Ymin = 32*R2I (Y/32) Xmax = Xmin + 32 Ymax = Ymin + 32 Also the pathing will be done for : JASS:Xmin <= X < Xmax and Ymin <= Y < Ymax In fact we can see them on the terrain editor. View -> Grid -> Small |
| 03-09-2008, 09:40 PM | #10 |
The pathable functions are a nightmare. Besides the logic being inverted, they mess with pathing in unexpected ways. For example, I tried dividing a TD into 4 player sections by turning off air pathing (but not ground) along the X and Y axises. It worked great, except that it messed with the ground pathing. I don't mean in a consistent way, either. Sometimes the runners would run across the boundaries, sometimes they would avoid parts of the boundaries, and sometimes they would just stop at the boundaries. Placing towers at key points would apparently block off huge swaths of terrain to the runners. Sometimes they would run into a spot, then be unable to leave. |
| 03-14-2008, 07:07 PM | #11 |
i've edited my post R2I =! I2R ![]() |
