Multiple activation elements...

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
RyNo
Posts: 3
Joined: Thu Sep 13, 2012 7:38 pm

Multiple activation elements...

Post by RyNo »

Hi guys and girls :D

I'm trying out the dungeon editor and wanted to set up a puzzle where for example two empty torch holders require torches to activate something... I can set it up so they both activate something individually, but I want the holders to all need torches before the activation occurs.

Any ideas? Hope I've explained this well enough.

Cheers.
Aazlan
Posts: 13
Joined: Thu Sep 13, 2012 6:59 pm

Re: Multiple activation elements...

Post by Aazlan »

Use the counter thingy... attach the torch holders to the counter, then attach the counter to whatever should be activated. Hope that helps =)
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: Multiple activation elements...

Post by Magus »

Or you create simple scripts like:

Code: Select all

function secretdoorevent01()
	 if torch01:hasTorch() == true and
	    torch02:hasTorch() == true then
			secretdoor01:open()
		else
			secretdoor01:close()
	end
end
You need to rename torch01, torch02 and secretdoor01 of course.
You can find more about scripting here: http://www.grimrock.net/modding/how-to- ... tion-lock/
RyNo
Posts: 3
Joined: Thu Sep 13, 2012 7:38 pm

Re: Multiple activation elements...

Post by RyNo »

Couldn't get the counter to work, but I managed to get a script running... First time I've messed about with that so I'm happy I eventually got it working. Thanks for pointing me in the right direction Magus :)

I've used the following to achieve activation, but I'd like deactivation if the torches are removed which I can't seem to get working... Any suggestions? Sorry if it's a stupid question, I'm new to scripting.

function teleporterevent()
if torch_holder_10:hasTorch() == true and
torch_holder_11:hasTorch() == true then
teleporter_3:activate()
end
end


I did try using " else teleporter_3:deactivate() " but that didn't seem to deactivate the teleporter when torches were removed :?:
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Multiple activation elements...

Post by Montis »

imho it should work when you use this script in a lua script entity (with the "else" part) and you connect both torch holders to the script entity with an "any" event.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Multiple activation elements...

Post by antti »

RyNo wrote:I did try using " else teleporter_3:deactivate() " but that didn't seem to deactivate the teleporter when torches were removed :?:
It could be because the function is triggered only when the torch holders are activated (eg. when a torch is inserted into them). Check the inspectors of the torch holders and set the actions to "any".

The trusty print() is your friend when trying to figure out problems like these. :)
Steven Seagal of gaming industry
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: Multiple activation elements...

Post by Magus »

Ah yeah sry i forgot about that^^

Like antti said, always use print() for debugging, thats a wisdom for your life^^
RyNo
Posts: 3
Joined: Thu Sep 13, 2012 7:38 pm

Re: Multiple activation elements...

Post by RyNo »

Thanks for the replies both... I put the "else" part of my script back in and changed the "Event" on the torch holders to "any" like you said Antti and it now works perfectly :) Much appreciated. Starting to get to grips with this now :geek:
Post Reply