HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Grand Undertaking...the 9 button puzzle

08-28-2003, 04:08 AM#1
Uratoh
I've decided to undertake a project to recreate the nine button puzzle for Warcraft 3 use...for those not familiar, it goes like this:

you have nine buttons,

X X X

X X X

X X X

the goal is to change them all to O. pressing one will change it, but will change all adjacent, as well, so if you hit upper left:

O O X

O X X

X X X

and if you hit the lower left one...

O O X

X X X

O O X

so basicly you need to figure out what to hit when. not that hard in concept, but im gonna try and make it as clean as possible and then make the trigger publicly available.
08-28-2003, 05:07 AM#2
Raptor--
relatively simple if you use a boolean array, i whipped this up in about 12 minutes, bear in mind that there are many many ways to go about making the puzzle


by all means, don't stop making it cause i posted this, good to learn from
08-28-2003, 05:11 AM#3
Uratoh
you're right, it was good practice...just got a bit monotonous near the end....I'd post the entirety but it's fairly big...here's a sample:

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VA1 Equal to 0
Then - Actions
Destructible - Kill SA1
Set VA1 = 1
Else - Actions
Destructible - Resurrect SA1 with (Max life of (Last created destructible)) life and Show birth animation
Set VA1 = 0

I had each button represented as A, B, or C and as 1, 2, or 3. it was also represented by a numeric variable, V, the Region, R, and the doodad S. I used this same action over and over, changing the numbers as pertinant. I forgot how fun this puzzle is!
08-28-2003, 05:15 AM#4
Raptor--
well, take a look at the way i did it, its done in 2 concise triggers

as for the actual puzzle, its too easy to hit the 4 corners than the center
08-28-2003, 05:20 AM#5
Uratoh
Well if you stick too difficult a puzzle into the game, the player will feel frustrated, ya know? This puzzle always bugged me before I figured out the trick.
08-28-2003, 05:21 AM#6
Raptor--
depends how smart a player is...

whats harder is the 9 button puzzle, but there are 3 different colours to the buttons, alternate in order - and one block starts off-colour (i forget which one), makes it a lot more challenging to get it to a specific colour
08-28-2003, 05:24 AM#7
Uratoh
glancing over...your trigger is based on the player selecting a circle...my trigger is designed for the player to move a hero unit over the button, it's the 'Test Of Logic' he must overcome. there's also a Test of Strength (combat) and one other test i duknow what yet....in any case, i dont know how I'd easily adapt it to clean up my triggers...
08-28-2003, 05:32 AM#8
Raptor--
add another array of regions, and set the equal to the locations of the circles

create a loop (1 to 9) to add 'unit enters reg[intA]' as events to the trigger

replace the initial loop of the Activate trigger to identify which region was stepped into and get the number of it

everything else should work the same, since its broken down into parts
08-28-2003, 05:35 AM#9
Uratoh
That just went right over my head....I guess I just have a lot to learn about triggers, still....
08-28-2003, 05:55 AM#10
Raptor--
hmm, sorry i took a bit longer to get this version out because apparently you cannot create regions out of thin air and then add events for units entering them

also theres no 'region comparison' so i had to do a little boolean workaround

this version uses the hero to activate, and this is how i would accomplish it
08-28-2003, 06:41 AM#11
battins72
you should make it bigger then just the 3x3 one...
in the 3x3 you just gotta hit the 4 corners, then the middle
08-28-2003, 06:31 PM#12
Uratoh
hmm...if the middle button is already pressed when it starts, does that make the puzzle unsolvable or just make it more challenging?
08-29-2003, 02:41 AM#13
strung
challenging. After i made it all green i wanted to see if i could make it back to red with out doing it in reverse order. eventually i made it so there was only 1 green spot, proving it can be done that way.