PDA

View Full Version : Multi-Switch/Block set-up



The_Amaster
04-27-2008, 12:13 PM
Okay, two people now have suggested that I do this by scripting, so here goes. Now there are two variations on this script, whichever is easier to do is fine.

1.) You have a room divided in two down the middle. On either side is a block and a block trigger. You enter from one side, push a block onto a trigger, then leave, go around enter the other side and the block hasn't reset so that you can push the other block onto it's trigger and activate the room.

2.)You have a room divided in two down the middle. On either side is a switch that you activate by hitting with the sword. You enter from one side, hit the switch, then leave, go around the other side and the first switch hasn't reset so you hit the second and activate the room.

C-Dawg
04-29-2008, 11:14 AM
1. This is probably possible without scripting, actually, but with scripting it's pretty straightforward. Psuedocode would look like this:




ffc script two_block_trigger(){

// This part executes just as you enter the room.

If screen variable 1 is 1, then draw a floor combo where the first block is and draw a block combo on top of the first switch.

If screen variable 2 is 1, then draw a floor combo where the second block is and draw a block combo on top of the second switch.

// This part executes constantly

while(true){

If screen variable 1 is 0, then:
If the first block is sitting on the block trigger, set screen variable 1 to 1.
If screen variable 1 is 1, then:
If the first block is NOT sitting on the block trigger, set screen variable 1 to 0.

If screen variable 2 is 0, then:
If the second block is sitting on the block trigger, set screen variable 1 to 1.
If screen variable 2 is 1, then:
If the second block is NOT sitting on the block trigger, set screen variable 1 to 0.

If both block triggers are filled with unwalkable combos then:
Change the combos of your closed door / wall / whatever to be and open door. Maybe play a sound effect.

}

}


2. Your switch question is identical, but even simplier. Here you don't move blocks, you just draw to the combo based on the screen variables. And instead of checking for solidity, check the combo on the screen.

The_Amaster
05-08-2008, 05:29 PM
Hmmm, okay, anyone maybe able to make this a reality?
I don't think I know quite enough.