Re-enable SelfDisabling Pressureplates.

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Re-enable SelfDisabling Pressureplates.

Post by Emera Nova »

So what I'm wanting to do is when the party steps on a pressure plate it will then disable itself so that you have to move on and use the others around the room as well. Then once they are all pressed you can go to the center of the room step on a seperate plate and have all of them reset so that they can repeat their functions.

I'm wanting to use it for a boss fight where you try to damage the boss with firepits that are triggered by the self disabling pressureplates. To prevent the player from just spamming the same plate I want to be able to shut it off and then later turn it back on.

ideas for the script?
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: Re-enable SelfDisabling Pressureplates.

Post by Azel »

Sure thing.

For a test, start by going to your map and laying down 3 Castle Pressure Plates. Name them castle_pressure_plate_1, castle_pressure_plate_2, and castle_pressure_plate_3.

Plate_3 will be used to re-enable all the plates. Plates 1 and 2 will disable themselves after a single Activation.

Step 1) Add a Script Object, and Paste the following code in it:

Code: Select all

function DisablePlate(plate)

	plate:disable();

end

function EnableAllPlates()

	castle_pressure_plate_1.floortrigger:enable();
	castle_pressure_plate_2.floortrigger:enable();
	-- etc

end
Step 2) Add a Connector to castle_pressure_plate_1, and connect it to the Script Method named, DisablePlate(plate)

Step 3) Repeat that for castle_pressure_plate_2

Step 4) Add a Connector to castle_pressure_plate_3, but this time connect it to the Script Method named, EnableAllPlates()

Step 5) Run the game and test it out. This should do exactly what you need. Now simply update it to match your own dungeon and pressure plate names.

:mrgreen:
Post Reply