Simple enough,
Is there a way I can check hero wall for multiple tiles away?
Check hero wall (me,right,2)
that won't work will it?
You want to check for a wall without having th hero walk over to it?
Yes, that can be done, but it is pretty complicated.
you have to use the "read map block" "read pass block" command, and you have to check two tiles to be sure you found the wall. It would be possible to wrap all that complexity into a simple script like the "check hero wall" command you are envisioning.
EDIT: I am writing some scripts that do this
Yes, that can be done, but it is pretty complicated.
you have to use the "
EDIT: I am writing some scripts that do this
If you want to check for a wall, that's read pass block. If you want to check for the tile, that's read map block.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Code:
include, plotscr.hsd
script, check distant hero wall, who, direction, distance=0, begin
exit returning(check wall relative to tile(hero x(who), hero y(who), direction, distance))
end
script, check distant NPC wall, who, direction, distance=0, begin
exit returning(check wall relative to tile(npc x(who), npc y(who), direction, distance))
end
script, check wall relative to tile, x, y, direction, distance, begin
switch(direction) do(
case(north) do(y -= distance)
case(south) do(y += distance)
case(west) do(x -= distance)
case(east) do(x += distance)
)
exit returning(check wall at spot(x, y, direction))
end
script, check wall at spot, x, y, direction, begin
variable(tile1, tile2)
tile1 := read pass block(x, y)
switch(direction) do(
case(north) do(
tile2 := read pass block(x, y -- 1)
if (tile1 ,and, northwall) then(exit returning(true))
if (tile2 ,and, southwall) then(exit returning(true))
)
case(south) do(
tile2 := read pass block(x, y + 1)
if (tile1 ,and, southwall) then(exit returning(true))
if (tile2 ,and, northwall) then(exit returning(true))
)
case(west) do(
tile2 := read pass block(x -- 1, y)
if (tile1 ,and, westwall) then(exit returning(true))
if (tile2 ,and, eastwall) then(exit returning(true))
)
case(east) do(
tile2 := read pass block(x + 1, y)
if (tile1 ,and, eastwall) then(exit returning(true))
if (tile2 ,and, westwall) then(exit returning(true))
)
)
exit returning(false)
end
include, plotscr.hsd
script, check distant hero wall, who, direction, distance=0, begin
exit returning(check wall relative to tile(hero x(who), hero y(who), direction, distance))
end
script, check distant NPC wall, who, direction, distance=0, begin
exit returning(check wall relative to tile(npc x(who), npc y(who), direction, distance))
end
script, check wall relative to tile, x, y, direction, distance, begin
switch(direction) do(
case(north) do(y -= distance)
case(south) do(y += distance)
case(west) do(x -= distance)
case(east) do(x += distance)
)
exit returning(check wall at spot(x, y, direction))
end
script, check wall at spot, x, y, direction, begin
variable(tile1, tile2)
tile1 := read pass block(x, y)
switch(direction) do(
case(north) do(
tile2 := read pass block(x, y -- 1)
if (tile1 ,and, northwall) then(exit returning(true))
if (tile2 ,and, southwall) then(exit returning(true))
)
case(south) do(
tile2 := read pass block(x, y + 1)
if (tile1 ,and, southwall) then(exit returning(true))
if (tile2 ,and, northwall) then(exit returning(true))
)
case(west) do(
tile2 := read pass block(x -- 1, y)
if (tile1 ,and, westwall) then(exit returning(true))
if (tile2 ,and, eastwall) then(exit returning(true))
)
case(east) do(
tile2 := read pass block(x + 1, y)
if (tile1 ,and, eastwall) then(exit returning(true))
if (tile2 ,and, westwall) then(exit returning(true))
)
)
exit returning(false)
end
Let me know if this works for you.



