MODULE: JigsawModule 1.0 (for AGS 3.0+)

Started by GarageGothic, Fri 04/07/2008 22:50:50

Previous topic - Next topic

GarageGothic

I'm glad you found my module useful. Let me know if you have any problems with it, as I haven't really tested the module with the native hi-res coordinates of AGS 3.1+.

RedBlob

This is brilliant -- thanks!

We did find it didn't work when we set "use low res coordinates in script" to false, in AGS 3.1.1. However, setting it to true worked fine. :)

You saved us TONS of work.


GarageGothic

I'm glad you found it useful. I'll have to fix the coordinate issue when I get the time, thanks for letting me know about it. Unfortunately the module was written just a week or two before hi-res coordinate support was introduced in AGS, so I never really tested it for compatibility.

rbaleksandar

 :o :o :o That is soo awesome. I've just found that module. The thing with the letter - quite useful for some kind of a game with a crime plot or/and treasure huntin' with a map torn to pieces.  ;D
Thanks!

PS: Can we use it to make a puzzle game. I mean the same like the demo but with more options and more puzzles of course? :)
I am a mighty pirate. Arrrrgh!

GarageGothic

Of course you can. There's no limit on how many jigsaw puzzles you can use in a single game - you just need to initialize a new one from a different set of puzzle pieces. The only problem would be that the state of the previous puzzle would be lost, so the player can't move back and forth between puzzles in different stages of completion. This could be solved by moving the module code to the room script and using a different room for each puzzle. But if each puzzle needs to be solved before moving on to the next, this won't be necessary. Feel free to modify the module in any way you want.

rbaleksandar

:P Thanks. I didn't quite get the thing with "the state of the previous puzzle would be lost". ??? Can't the state of puzzle X be stored (like saving the game state) and then restored by the player with a load function?
I am a mighty pirate. Arrrrgh!

GarageGothic

What I meant is that if the player has half-completed one puzzle and decides to leave it and start another, the position of the pieces in the first one will be reset if he returns to that later. This is because the module was only scripted to keep track of one puzzle at a time. If you move the code to your room scripts however, the code in each room will keep track of one puzzle, allowing you to move freely between them.

rbaleksandar

I am a mighty pirate. Arrrrgh!

RedBlob

I wanted to add -- I've made a game with 26 puzzles included (36 pieces each puzzle), and it still works just perfectly.

8kai

I love this module, and thanks a lot for creating this great module. However, I've encountered some problems trying to incorporate the torn letter in my game. When I used my cursor to pick up the pieces, the pieces could only be picked up if I clicked somewhere above the piece and when I released it, it fell to a location one or two inches under my cursor.  I couldn't figure out how to solve the problem. Please help. Also, does the position of the pixelperfect object in the room matters? and what if I don't have any shadow sprites for the puzzle?

GarageGothic

#30
I'm happy to hear that you're finding the module useful. As for your problems, are you running AGS with the "Use low-res co-ordinates in script" property set to true or false? I haven't had time to test the module since the hi-res screen coordinates option were introduced, so there's likely to be some conflict - I will fix this as soon as I can. I don't think the shadow sprite is necessary for the module to work, nor should the original coordinates of the pixelperfect object make any difference.

8kai

#31
 ;D ;D
I changed "Use low-res co-ordinates in script" to true and everything works perfect now!!! Thank you so much!

The debug functionality to find coordinates of the puzzle pieces is extremely helpful. All I need to do is to drag the pieces in debug mode to the proper positions and press Ctrl+J to get the coorindates.


maraki_ang3l

Why when i am running my game it says undefined symbol "lblPuzzleScore"  at
 
Jigsaw.SetupScoreLabel(lblPuzzleScore, "@SCORE@% complete.", "Congratulations, you completed the puzzle!");

NsMn


GarageGothic

Well, you could export the GUI from the demo game and import it into your own. But it would be easier to either create a GUI with a label named lblPuzzleScore, or change "lblPuzzleScore" to the name of your own label where you want the score to be displayed.

joelphilippage

I have a strange problem. I am making my game were there is a puzzle during the whole game with pieces added as you go along. The Puzzle is working fine, but you can not click on anything in the game. Also if I add a puzzle piece in the middle of the game and click on anything, it shows the error "SetObjectPosition: Invalid Object Number" and cites this portion of the script:
Code: ags
line 207      jigsaw_pixelperfectobject.X = spritedetectx;

The puzzle is in one room separate from the others.
I hope I've made my problem clear.



AGD2

Hey, GG. This module is excellent and seems like it could be very useful!

Sadly, I, too, have run into the glitch when using hi-res coordinates. A quick check of the forum time/date stamp reveals that it's been quite some time since you last touched this module, and I was just curious whether you still intended to address that particular bug?

Either way, Nice job.  ;D

GarageGothic

Sorry, didn't notice you reply until now, AGD2. Yeah, the whole module needs an overhaul now that AGS has true high-res coordinates. It was scripted during the brief period when DrawingSurface.UseHighResCoordinates could be used as a workaround, and apparently some of the double-pixel multiplications are now creating problems.

I'll get around to it eventually, but please DO let me know if you need the module for a game in active development, then I'll bump fixing it to the top of my priority list. 

cubehouse

Quote from: GarageGothic on Sun 28/03/2010 12:10:42
Sorry, didn't notice you reply until now, AGD2. Yeah, the whole module needs an overhaul now that AGS has true high-res coordinates. It was scripted during the brief period when DrawingSurface.UseHighResCoordinates could be used as a workaround, and apparently some of the double-pixel multiplications are now creating problems.

I'll get around to it eventually, but please DO let me know if you need the module for a game in active development, then I'll bump fixing it to the top of my priority list. 

I would adore a bump to get this working on the latest AGS. Starting development on a game course with a young theatre company to create a video game and this module would fit perfectly =)

GarageGothic

#39
Sorry I keep missing your posts guys - I don't normally follow the module and plugins forum, but if the "notify of replies" feature works I should  get PMs whenever someone posts in this thread from now on.

I'll start working on an AGS 3.2 version of the module very soon. But before I begin scripting, I'd like to hear if there are any more feature requests? It's always good to have all features in mind from the get-go rather than have to use hacks to add them on later.

Some things I plan on adding:
* Rotation of puzzle pieces (user can decide whether they want full 360 degree rotation or only allow 90-degree increments)
* Slider puzzle support - pieces can only move where there isn't already a piece. Randomization of initial position will be limited so the puzzle is always solvable.
* State-saving for multiple puzzles without having to move module code to room script.
* Easier triggering of scripts from win event.
* Adding puzzle pieces during gameplay - e.g dragging pieces from your inventory onto the board.

Anything else you can think of?

SMF spam blocked by CleanTalk