Acid Bucket Door Trap

By LadylexUK (Feb 2015)
Copied from ProjectSpark.com

In response to x Quick Revive’s request for help with a door/boolean problem.

The scenario. There are various acid buckets scattered around. If you pick one up and go to a door you can choose to set a trap. Set a trap and the bucket of acid is set above the door. You are safe to walk through the door, but if anyone else tries they get a bucket of acid on their head. Here is my solution.

IN the player brain

Move all the controls as child lines to:

Code:

WHEN [boolvar:door interact][not equal to][true]

This will ensure that when you are interacting with the door you don’t fire a fireball or jump (you can do a similar thing with turning the brain on and off instead if you wish)

Create 2 buckets and a door.
Place one at an angle above the door as if it has been tipped up. Make it invisible.
Create the contents of your bucket. I used an asteroid crater painted green. Make 2. Place one in your bucket on the floor, the other in the tipped bucket. Make the tipped bucket one invisible.

Glue together the bucket and contents that is on the floor. Rename it Acid bucket.
In Acid bucket brain

Code:

WHEN [interacted] DO
…WHEN DO [it][numvar:acid buckets][incremented by 1]
…/…WHEN [destroy]

Add a waterfall painted green to the tipped bucket so that it flows over the entrance of the door. Turn the power off.

In its brain

Code:

WHEN [has power] DO
…WHEN [countdown timer][2] DO [power off]
…/…WHEN [destroy][IWP:Acid in bucket]
…/…WHEN DO [destroy]

IN the door brain

Code:

WHEN [page entered] DO [boolvar:not set][=][false]
…WHEN DO [objvar:opener][=][nothing] // sets everything to neutral
WHEN [once] DO [boolvar:lethal][=][false] // starts with a non lethal door
…WHEN DO [boolvar:door complete][=][false]
WHEN [not][has power]
…WHEN [interacted] DO [power on]
…/…WHEN DO [objvar:opener][=][it] // establishes who interacted with the door
…/…WHEN [boolvar:lethal][=][false] DO // checks to see if a trap has been set already
…/…/…WHEN [boolvar:door complete][=][false] // checks if a trap has already gone off
…/…/…/…WHEN [objvar:opener][numvar:acid buckets][>=][1] DO [switch page][2] // checks to see if the opener has an acid bucket
…/…/…/…WHEN [else] // if the door is lethal
…/…/…/…/…WHEN [boolvar:door complete][=][false] //and has not already been set off
…/…/…/…/…/…WHEN [objvar:opener][not equal to][joker] // checks to see if the opener is not the person who set the trap
…/…/…/…/…/…/…WHEN DO [IWP:Acid in bucket][visible][=][true]
…/…/…/…/…/…/…WHEN DO [IWP:Bucket over door][visible][=][true]
…/…/…/…/…/…/…WHEN [started to] DO [IWP:Waterfall effect][power on]
…/…/…/…/…/…/…/…WHEN DO [objvar:opener][health][decrement by][50] // or you can kill them or set a different result
…/…/…/…/…/…/…/…WHEN DO [boolvar:door complete][=][true]

WHEN [has power]
…WHEN [countdown timer][5] DO [power off]
…/…WHEN DO [objvar:opener][=][nothing] // closes and resets the door

page 2

Code:

WHEN [page entered] DO [objvar:opener][boolvar:door interact][=][true] // stops player controls working
WHEN DO [display][Do you want to set a trap Y or X][screen center][x large font]
WHEN [X][pressed] DO [boolvar:not set][=][true]
WHEN [boolvar:not set][=][true]
…WHEN [countdown timer][2][in frames] DO
…/…WHEN DO [objvar:opener][boolvar:door interact][=][false]
…/…WHEN DO [switch page][1]
WHEN [Y][pressed DO [switch page][3]

page 3

Code:

WHEN DO [objvar:joker][=][objvar:opener] // this tells the door who set the trap
WHEN DO [boolvar:lethal][=][true]
WHEN DO [objvar:opener][numvar:acid buckets][decremented by][1] // removes bucket.
…WHEN DO [objvar:opener][door interact][=][false]
…WHEN DO [switch page][1]

Now in the Kode above, once a door has been booby trapped and used it cannot be booby trapped again.Once the contents have been dropped it is done. The door has an empty bucket above.

Comments are closed.

Powered by WordPress.com.

Up ↑

%d bloggers like this: