osgrid.org
https://forums.osgrid.org/

jigsaw puzzle
https://forums.osgrid.org/viewtopic.php?f=5&t=6192
Page 1 of 1

Author:  marshall genord [ Fri Aug 10, 2018 9:16 am ]
Post subject:  jigsaw puzzle

Hi again !
I've got another idea that I think is pretty simple to carry out
for someone with advanced scripting knowledge,
but I just can't figure it out.

Djphil was so kind to make a bilingual vocabulary memory game for me once:

Two matching words in the respective two languages must be matched by clicking them.
When the two words match, one of the two is moved on top of the other one.

The game is here: https://forums.osgrid.org/viewtopic.php?f=5&t=6116


On the basis of that script I think it should be possible to make a jiggsaw puzzle.
It can already be done through the above mentioned script:

One piece is the actual puzzle piece, with a texture of a piece from a photo /text /painting etc.
The other piece lies on the ground as a background for that picture, with no texture.
Several of these background pieces lie next to each other on the ground.

The script of each background piece matches one of the puzzle pieces.
When the two to matching ones are clicked,
the puzzle piece is moved onto its corresponding background piece,
and thus, it is in the correct place.

This is repeated with all other puzzle pieces until the puzzle is finished.


The problem is the following:
This makes it possible to randomly click pieces together,
without thinking.


What I would like to have is this:

Each puzzle piece can be matched with each background piece
and no correct solution is given in the script.
When a piece is clicked a second time, it moves back to its original position.

This means the player must solve the puzzle through looking and thinking.


Do you maybe have any ideas for this?
There might also be completely different approaches for this.

Thank you very much in advance!

Author:  dj phil [ Sat Aug 18, 2018 9:11 am ]
Post subject:  Re: jigsaw puzzle

This could made you happy! :) Source code available in github.

Author:  marshall genord [ Sun Aug 26, 2018 8:44 am ]
Post subject:  Re: jigsaw puzzle

Thanks, mate, this is exactly what I've been looking for.
I'm still having some trouble rebuilding it using the files from github,
since the Secondlife package is not transferable to OSGrid.
So, I'm still trying.
If you have any groundbreaking ideas of how to make it transferable to OSGrid
or what is important building it,
let me know.
But thanks very much, either way.

Author:  dj phil [ Mon Aug 27, 2018 9:26 am ]
Post subject:  Re: jigsaw puzzle

Well, the simplest thing I think is to start from the main script (puzzlefun.lslp) and to progressively go back up actions in the script.
But hey, 20 scripts to make this puzzle, it seems to me a lot of scripts. In my opinion, 2 or 3 scripts would be enough ...

Author:  dj phil [ Thu Sep 27, 2018 4:57 pm ]
Post subject:  Re: jigsaw puzzle

So how are things going?
Did you manage to make this puzzle work?

Author:  marshall genord [ Sat Oct 13, 2018 6:54 am ]
Post subject:  Re: jigsaw puzzle

Hi again,
thanks for asking.

I haven't been successful so far.

I sort of managed to reverse-engineer it in Second Life and make it work.
But I haven't been able to rebuild it on OpenSim, and I can't really tell why.

Maybe there are some differences between the structure of Second Life and OSgrid that cause this.

edit: When saving the main script, there is the following error message:

Error CS0236: A field initializer cannot reference the nonstatic field 'SecondLife.XEngineScript.CLOSED'.



If you happen to have a ground-breaking idea, I'm always grateful.

Cheers!

Author:  dj phil [ Tue Oct 16, 2018 7:41 am ]
Post subject:  Re: jigsaw puzzle

To fix the compilation problem, you can proceed like this:
remplace:
{L_CODE}:
integer screenState=CLOSED;
by:
{L_CODE}:
integer screenState;
and add:
{L_CODE}:
screenState = CLOSED;
in the main default state_entry()

Same for:
integer gameState=GAME_OVER;
list randColors=[RED,ORANGE,PINK,PURPLE,BABYBLUE,YELLOW];

Author:  marshall genord [ Tue Oct 23, 2018 11:48 am ]
Post subject:  Re: jigsaw puzzle

Hi and thanks again for your time.

I'm getting closer.
The tool tray is opening and the puzzle pieces are rezzed on top of the base.
Only the texture isn't displayed on them, but on the underlying pieces and they don't scatter yet.

I'll have another look at it in Second Life.
Hopefully I'll find some clues there.
Otherwise, I'll come back here for help, again :) .

Thanks very much again!

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/