hi,
I would like to ask, what is the best way to make a "blocker" for the party (not for monsters) ?
I mean, something invisible but acting like a wall. The party can't walk, but the monsters can.
Code: Select all
onMove = function(self, dir)
if self.x == 1 and self.y == 13 and self.level == 3 and dir == 0 then
return false
end
end
Good idea but I need to place a lot of these... not easy to use this way...Phitt wrote:I guess the best way to do this would be a party hook. You use an onMove hook, check for x, y , level and the direction the player tries to move to and then you cancel it if necessary. Like this (not tested):
Which would cancel any movement in north direction if the player is standing on the specified tile on level 3.Code: Select all
onMove = function(self, dir) if self.x == 1 and self.y == 13 and self.level == 3 and dir == 0 then return false end end
Code: Select all
function realwall(trigger)
local dir0 = string.sub(trigger.id, 11, 11)
local dir1 = string.sub(trigger.id, 12, 12)
local dir2 = string.sub(trigger.id, 13, 13)
local dir3 = string.sub(trigger.id, 14, 14)
if (dir0=="1") then
spawn("ast_skull_secret_door", party.level, party.x, party.y, 0, "rw0")
end
if (dir1=="1") then
spawn("ast_skull_secret_door", party.level, party.x, party.y, 1, "rw1")
end
if (dir2=="1") then
spawn("ast_skull_secret_door", party.level, party.x, party.y, 2, "rw2")
end
if (dir3=="1") then
spawn("ast_skull_secret_door", party.level, party.x, party.y, 3, "rw3")
end
end
function destrealwall()
if findEntity ("rw0") then rw0:destroy() end
if findEntity ("rw1") then rw1:destroy() end
if findEntity ("rw2") then rw2:destroy() end
if findEntity ("rw3") then rw3:destroy() end
end
Pandafox wrote:I made it![]()
That's really cool to see the ghosts walk through the walls !![]()
The method to make it (using the skull wallset) :
1. make your way
2. place "false" walls where you want to have a wall the ghosts can walk through
3. place pillars (to make it good looking)
4. place pressure plates hidden on the way you have these walls
Pressure plates must be named like this :
" real_wall_1010_1 "
where 1 means place a WALL and 0 means don't place a WALL
1010 = a wall on facing 0, no wall onfacing 1, a wall on facing 2, no wall on facing 3
the last number is a unique ID (1, 2, 3, 4.........)
Make a script and copy this code :Then, each pressure plate have :Code: Select all
function realwall(trigger) local dir0 = string.sub(trigger.id, 11, 11) local dir1 = string.sub(trigger.id, 12, 12) local dir2 = string.sub(trigger.id, 13, 13) local dir3 = string.sub(trigger.id, 14, 14) if (dir0=="1") then spawn("ast_skull_secret_door", party.level, party.x, party.y, 0, "rw0") end if (dir1=="1") then spawn("ast_skull_secret_door", party.level, party.x, party.y, 1, "rw1") end if (dir2=="1") then spawn("ast_skull_secret_door", party.level, party.x, party.y, 2, "rw2") end if (dir3=="1") then spawn("ast_skull_secret_door", party.level, party.x, party.y, 3, "rw3") end end function destrealwall() if findEntity ("rw0") then rw0:destroy() end if findEntity ("rw1") then rw1:destroy() end if findEntity ("rw2") then rw2:destroy() end if findEntity ("rw3") then rw3:destroy() end end
- on activate : realwall()
- on deactivate : destrealwall()
I tried to be more clear as possible to explain this... But maybe it was not very very clear... sorry
EDIT: The result is very very cool ! Running into the maze to escape the ghosts and seeing them walking through the walls to catch you is awesome !
Leki wrote: Heh - I have the same trick in my ToW --> one less surprise / I must find something else now