Need Help setting up 5 secret doors open sequentially

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
2Four
Posts: 19
Joined: Fri Mar 09, 2012 9:55 pm

Need Help setting up 5 secret doors open sequentially

Post by 2Four »

Hello,

I hope I am posting my question in the correct forum?

I have a question and I have to admit I'm new to dungeon editing, period. Total noob at this.
I bought and played LoG in december 2012 when it first came out and loved it, now I want to build dungeons.
Can't quite get the hang of setting up logic operations and am wondering if what I want to do can simply be done with counters and timers or would I need to do scripting?
If the latter is required, might one be able to offer a sample that I can learn from?

What I want to do:

Have a fireball activated by the party stepping on a pressure plate. This works good.

The fireball travels to the other side of the room where it hits a receptor. This works good.

Along the wall where the receptor is located there is 5 secret doors. What I want is when the fireball(s) hits the receptor, each secret door opens sequentially.

Problem: For some reason, everything I do results in all 5 doors opening at the same time as soon as the first fireball hits the receptor.

I want only one secret door to open at a time. Fireball#1 opens door#1, fireball#2 open door#2 and so on till all 5 doors are open.

Right off the bat a terrible foe will emerge from door#1, then another from secret door#2, so the player quickly realizes they are screwed if more fireballs hit the receptor. heh heh

Setting up a counter on the receptor to trigger the secret doors only results in all four opening at once.

I just can't figure it out! Help!
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Need Help setting up 5 secret doors open sequentially

Post by Skuggasveinn »

Place a counter (lets call it fireballcounter) and set the initial value to 5
Then place a script entity in your level and hook your receptor to the script.
The script will have something like this inside it
SpoilerShow

Code: Select all

function fireballdoors()
	if fireballcounter:getValue() == 5 then
	dungeon_door_iron_1:open()
	fireballcounter:decrement()
	
	elseif fireballcounter:getValue() == 4 then
	dungeon_door_iron_2:open()
	fireballcounter:decrement()
	
	elseif fireballcounter:getValue() == 3 then
	dungeon_door_iron_3:open()
	fireballcounter:decrement()
	
	elseif fireballcounter:getValue() == 2 then
	dungeon_door_iron_4:open()
	fireballcounter:decrement()
	
	elseif fireballcounter:getValue() == 1 then
	dungeon_door_iron_5:open()
	fireballcounter:decrement()
	
	end
end
When the first fireball hits the value of the counter will be 5 and the first door opens, and then we lower the counter value, so when the next fireball hits we open door number 2 and lower the counter etc etc, when the last door opens it lowers the counter to 0 and nothing will happen after that.

try it out, hope it helps.

Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
2Four
Posts: 19
Joined: Fri Mar 09, 2012 9:55 pm

Re: Need Help setting up 5 secret doors open sequentially

Post by 2Four »

Wow! it worked (After a few errors on my part).
This scripting thingy seems not too bad at all.

You're a genius Skuggasveinn!

Thank You so very much :-)
Post Reply