PDA

View Full Version : ~Sliding Puzzle~ - 12pce


LJ©
04-05-2007, 06:10 PM
Turn a palace room into a slide puzzle.

------------------
| 1 | 2 | 3 | 4 |
------------------
| 5 | 6 | 7 | 8 |
------------------
| 9 | 10 | 11 | 12 |
------------------
You can make your own pic by carefully CUTTING your Room Pic into 12 -> 128 x 128 sized pieces.

*The attachment file "Sliding_Puzzle.ZIP" contains the GIFs used in this script. [sample puzzle pieces]



ROOM
ID 639
NAME "~Sliding Puzzle~ - 12pce"
PICT "black.gif"
PICTURE ID 14 NAME "sp_one.gif" ENDPICTURE
PICTURE ID 15 NAME "sp_two.gif" ENDPICTURE
PICTURE ID 16 NAME "sp_three.gif" ENDPICTURE
PICTURE ID 17 NAME "sp_four.gif" ENDPICTURE
PICTURE ID 18 NAME "sp_five.gif" ENDPICTURE
PICTURE ID 19 NAME "sp_six.gif" ENDPICTURE
PICTURE ID 20 NAME "sp_seven.gif" ENDPICTURE
PICTURE ID 21 NAME "sp_eight.gif" ENDPICTURE
PICTURE ID 22 NAME "sp_nine.gif" ENDPICTURE
PICTURE ID 23 NAME "sp_ten.gif" ENDPICTURE
PICTURE ID 24 NAME "sp_eleven.gif" ENDPICTURE
PICTURE ID 25 NAME "sp_blank.gif" ENDPICTURE
PICTURE ID 26 NAME "sp_twelve.gif" ENDPICTURE
DOOR
ID 33
OUTLINE 0,0 5,0 5,5 0,5
LOC 192,192
SCRIPT
ON ENTER
{
Moveblank GLOBAL
{;start def
{
ME GETSPOTSTATE MBvarAA SETSPOTSTATELOCAL
11 ME SETSPOTSTATELOCAL } 11 MBvarAA GETSPOTSTATE == IF
{
ME GETSPOTSTATE MBvarBB SETSPOTSTATELOCAL
11 ME SETSPOTSTATELOCAL } 11 MBvarBB GETSPOTSTATE == IF
{
ME GETSPOTSTATE MBvarCC SETSPOTSTATELOCAL
11 ME SETSPOTSTATELOCAL } 11 MBvarCC GETSPOTSTATE == IF
{
ME GETSPOTSTATE MBvarDD SETSPOTSTATELOCAL
11 ME SETSPOTSTATELOCAL } 11 MBvarDD GETSPOTSTATE == IF
14 SELECT
} MoveBlank DEF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 1
OUTLINE 0,0 128,0 128,128 0,128
LOC 64,64
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT
ON OUTCHAT {tempf GLOBAL
{0 tempf =
0 ME SETALARM
"" GREPSUB CHATSTR = } CHATSTR LOWERCASE "^info$" GREPSTR IF }
ON ALARM {
tempf GLOBAL
tempf ++
{"^If I gave you the answer it wouldnt be a puzzle now would it?" LOCALMSG } 2 tempf == IF
{"^This 11 piece puzzle is here for your enjoyment....." LOCALMSG } 3 tempf == IF
{"^Have fun. :o)" LOCALMSG } 4 tempf == IF
{ 1 tempf = } { 410 ME SETALARM } 5 tempf == IFELSE
}
ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
2 MBvarAA =
5 MBvarBB =
33 MBvarCC =
33 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
playinga GLOBAL
13 playinga =
"Instructions are in your message log..." 10 10 SAYAT
"INSTRUCTIONS______________________________________ _____" LOGMSG
"This Puzzle can be played by any number of people." LOGMSG
"Each person in the room has a DIFFERENT view of the puzzle." LOGMSG
"You are each on your own at solving the puzzle." LOGMSG
"The first person to finish, will conclude that game." LOGMSG
"Type \"start\" to be puzzled, and have fun... " LOGMSG
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 0 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 2
OUTLINE 128,0 256,0 256,128 128,128
LOC 192,64
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT
ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
1 MBvarAA =
6 MBvarBB =
3 MBvarCC =
33 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 1 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 3
OUTLINE 256,0 384,0 384,128 256,128
LOC 320,64
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT

ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
2 MBvarAA =
4 MBvarBB =
7 MBvarCC =
33 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 2 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 4
OUTLINE 384,0 512,0 512,128 384,128
LOC 448,64
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT
ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
3 MBvarAA =
8 MBvarBB =
33 MBvarCC =
33 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 3 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 5
SHADOW
OUTLINE 0,128 128,128 128,256 0,256
LOC 64,192
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT
ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
1 MBvarAA =
9 MBvarBB =
6 MBvarCC =
33 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 4 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 6
SHOWNAME
OUTLINE 128,128 256,128 256,256 128,256
LOC 192,192
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT

ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
2 MBvarAA =
10 MBvarBB =
5 MBvarCC =
7 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 5 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 7
OUTLINE 256,128 384,128 384,256 256,256
LOC 320,192
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT
ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
3 MBvarAA =
11 MBvarBB =
6 MBvarCC =
8 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 6 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 8
OUTLINE 384,128 512,128 512,256 384,256
LOC 448,192
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT
ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
4 MBvarAA =
12 MBvarBB =
7 MBvarCC =
33 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 7 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 9
OUTLINE 0,256 128,256 128,384 0,384
LOC 64,320
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT
ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
10 MBvarAA =
5 MBvarBB =
33 MBvarCC =
33 MBvarDD =
{ "Click a sqaure beside the blank. " SAY
0 oops = } 1 oops == IF
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 8 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 10
OUTLINE 128,256 256,256 256,384 128,384
LOC 192,320
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT

ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
11 MBvarAA =
9 MBvarBB =
6 MBvarCC =
33 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 9 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 11
OUTLINE 256,256 384,256 384,384 256,384
LOC 320,320
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 ENDPICTS
SCRIPT
ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
12 MBvarAA =
10 MBvarBB =
7 MBvarCC =
33 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 10 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 14
OUTLINE 384,256 512,256 512,384 384,384
LOC 448,320
SCRIPT
ON SELECT {
playinga GLOBAL
sayita GLOBAL
0 fina =
{ fina ++ } 1 GETSPOTSTATE 0 == IF
{ fina ++ } 2 GETSPOTSTATE 1 == IF
{ fina ++ } 3 GETSPOTSTATE 2 == IF
{ fina ++ } 4 GETSPOTSTATE 3 == IF
{ fina ++ } 5 GETSPOTSTATE 4 == IF
{ fina ++ } 6 GETSPOTSTATE 5 == IF
{ fina ++ } 7 GETSPOTSTATE 6 == IF
{ fina ++ } 8 GETSPOTSTATE 7 == IF
{ fina ++ } 9 GETSPOTSTATE 8 == IF
{ fina ++ } 10 GETSPOTSTATE 9 == IF
{ fina ++ } 11 GETSPOTSTATE 10 == IF
{ fina ++ } 12 GETSPOTSTATE 11 == IF
{ ;the end
0 fina =
13 playinga =
;this unscrambles puzzle for EVERYONE because you have finished
0 1 setspotstate
1 2 setspotstate
2 3 setspotstate
3 4 setspotstate
4 5 setspotstate
5 6 setspotstate
6 7 setspotstate
7 8 setspotstate
8 9 setspotstate
9 10 setspotstate
10 11 setspotstate
11 12 setspotstate
"!Congratulations, " USERNAME & " has completed the puzzle first." & ROOMMSG
0 fina =
CLEARPROPS
[ 922949467 ] SETPROPS

} fina playinga == IF
{ 1 sayita ++ }
{
{ 0 sayita = } 12 playinga == IF
} 13 playinga == IFELSE
{
"^Type \"Start\" to begin the puzzle " USERNAME & "." & SAY
0 sayita =
} 2 sayita == IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 13
OUTLINE 384,256 512,256 512,384 384,384
LOC 448,320
SCRIPT

ON OUTCHAT {
playinga GLOBAL
{
;scramble at random
;OK there are only 12 variations here....
;some smart cookie could make this more random...
;my brain was hurting
12 RANDOM randyaa =
randyaa ++ ;0 correction
2 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
4 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
0 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
1 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
3 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
5 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
8 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
11 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
7 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
6 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
9 randyaa setspotstateLOCAL
{0 randyaa =} 12 randyaa == IF
randyaa ++
10 randyaa setspotstateLOCAL
;scramble at random
"^You can move pieces beside the blank by 'clicking' them." GREPSUB CHATSTR =
12 playinga =
NAKED
}
CHATSTR LOWERCASE "^start$" GREPSTR IF
}
ENDSCRIPT
ENDDOOR
DOOR
ID 12
OUTLINE 384,256 512,256 512,384 384,384
LOC 448,320
PICTS 14,0,0 15,0,0 16,0,0 17,0,0 18,0,0 19,0,0 20,0,0 21,0,0 22,0,0 23,0,0 24,0,0 25,0,0 26,0,0 ENDPICTS
SCRIPT
ON SELECT
{
MoveBlank GLOBAL
;set values of adjacent tiles
11 MBvarAA =
8 MBvarBB =
33 MBvarCC =
33 MBvarDD =
MoveBlank EXEC
}
ON ENTER
{
ME GETSPOTSTATE ME SETSPOTSTATELOCAL
{ 11 ME SETSPOTSTATELOCAL } NBRROOMUSERS 1 == IF
}
ENDSCRIPT
ENDDOOR
ENDROOM

Finna
04-07-2007, 04:25 AM
Ok first off I really enjoyed working with this today, thank you LJ.

I did find a couple of issuse though one being the ^ before speach,
"^Type \"Start\" to begin the puzzle " USERNAME & "." & SAYthis will activate the away if you have that plugin installed.

Also when Spirit and I was playing with it when I solved it it didn't show right to her when it auto fixed.

I have however reworked it to be half the size and do not move here on the doors so people can sit in the room in their own avs while playing.

LJ©
04-08-2007, 02:45 PM
Hi Finna, I'm glad you enjoyed working on that one.

Sorry about the bugs in it though.

My scripting can be rather ad-hoc at times, occasionally inept [or confused], but usually it ends up doing what I wanted.

I never realised that the [^] speech sticky was used by plug-ins. I test on a plug-in less WIN-doze PServer. I also agree the "don't move here" option is a great idea, but way back in '98 when I first did it, peer pressure had every1 prefer to bounce around the screen like nit-wits than be frozen at the point they bounced in the room. [every1 didn't know about cursor keys]

I'm glad you were able to squeeze the size down more. My head was getting sore trying to shrink it. I tried to change several things [and test] before posting - I shrunk it some by adding "moveblank DEF", used "ME" spotstate where I could, added the randomising start [which made it fatter] , and added the variables for checking the adjacent sqaures/doors. [also made it fatter] The variable idea being if someone wanted to add more squares to the script [say 16 pces] it'd be easier for them to do so.

With the problem with Autofix.... Well, I can't see a problem with that section of script in Door14. The string of Setspotstate's (not being Local) SHOULD affect all users. However, over the years thats always been buggy. Sometimes it works, most times it don't. I have never worked out why ?

But a different angle at it might be to try -- A word that is spoken by the winner, obviouslly 'not normal' easily typed text -- then an INCHAT handler to look out for it, obviouslly delete it so no-one can cut n paste the cheat, and then run the string of setspotstates [which could then be LOCAL], etc.
As everyone would hear the 'winner', everyone in the room should have their INCHAT section trigger.

I hope that helps. -LJ©

Finna
04-09-2007, 04:08 AM
ok for the full sized puzze I agree the having them bounce around the room is the best option, but then I said I made it smaller I wasn't meaning the script but the size of the puzzle area. I cut it down to half the size it was which allows for people to have an area to sit around the puzzle making the do not move here a good choice. And yea its only the away plug in that uses the ^ as its an update for the ^brb so many already use