blocker for party?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Pandafox
Posts: 268
Joined: Wed Apr 11, 2012 11:25 pm
Location: France
Contact:

blocker for party?

Post by Pandafox »

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.
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: blocker for party?

Post by Phitt »

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):

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
Which would cancel any movement in north direction if the player is standing on the specified tile on level 3.
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: blocker for party?

Post by Komag »

Yeah that should do the trick very nicely. And it should be accompanied by a good fair explanation, because as a player I usually hate invisible walls unless there is a good plausible reason!
Finished Dungeons - complete mods to play
User avatar
Pandafox
Posts: 268
Joined: Wed Apr 11, 2012 11:25 pm
Location: France
Contact:

Re: blocker for party?

Post by Pandafox »

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):

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
Which would cancel any movement in north direction if the player is standing on the specified tile on level 3.
Good idea but I need to place a lot of these... not easy to use this way...

Explanation of why I want to do that :
SpoilerShow
I want to make my ghost monsters walk through the walls.
I can make false walls monsters can walk through but the party also can... :? That's why I want to block the party same as if there is a real wall.
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: blocker for party?

Post by Phitt »

The only thing I could think of to make this work for more than just a few special occasions would be to place hidden pressure plates that set a counter to 1 when activated and set it back to 0 when deactivated. You'd need one for north, east, west and south and could place them properly (I hope multiple pressure plates on the same spot activate all at once). Then you could check for the counters in the script instead of a specific position. Would still be a lot of work to place all the pressure plates, but it would be doable at least unless you plan to have your ghost warriors everywhere in the whole dungeon.
User avatar
Pandafox
Posts: 268
Joined: Wed Apr 11, 2012 11:25 pm
Location: France
Contact:

Re: blocker for party?

Post by Pandafox »

Phitt you gave to me an idea ;)
I will code that the same way I coded one of my wall puzzles, by creating secret doors and destroy them on activate and deactivate hidden plates!
If you are interesting about that I can copy here the code I will do.
User avatar
Pandafox
Posts: 268
Joined: Wed Apr 11, 2012 11:25 pm
Location: France
Contact:

Re: blocker for party?

Post by Pandafox »

I made it :D

That's really cool to see the ghosts walk through the walls ! :mrgreen:

Image

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.........)

Image

Make a script and copy this code :

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
Then, each pressure plate have :
- 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 :roll:


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 ! :lol:
Last edited by Pandafox on Wed Jan 23, 2013 1:01 am, edited 3 times in total.
hyteria
Posts: 266
Joined: Sat Dec 29, 2012 8:22 pm

Re: blocker for party?

Post by hyteria »

how realllllllllllly great idea panda ! thx for sharing ! :p
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: blocker for party?

Post by Leki »

SpoilerShow
Pandafox wrote:I made it :D

That's really cool to see the ghosts walk through the walls ! :mrgreen:

Image

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.........)

Image

Make a script and copy this code :

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
Then, each pressure plate have :
- 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 :roll:


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 ! :lol:
Heh - I have the same trick in my ToW --> one less surprise / I must find something else now :-)
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
Pandafox
Posts: 268
Joined: Wed Apr 11, 2012 11:25 pm
Location: France
Contact:

Re: blocker for party?

Post by Pandafox »

Leki wrote: Heh - I have the same trick in my ToW --> one less surprise / I must find something else now :-)
:D oh sorry !
Post Reply