There is nothing that you HAVE to do in a certain way - it's always up to you, and there are certainly different solutions.
I have just described what I have done once - this was a solution that I have been able to figure out myself after struggling with it for probably hours. There are other ways to create a jigsaw puzzle, but I didn't know how to do it, so I chose a way how I could implement this puzzle myself back then.
Things that you'll need to add to the Hotspot Properties of the hotspot that is there to check if the puzzle has been put together correctly:
To reset a variable, just use "
MyVariable = 0"
(You'll need to do this for all the variables of your jigsaw pieces)
To "empty" a hotspot, either make it transparent
Action.LoadAPicture Hotspot(Hotspot_Number), ""
(but in this case the players won't know where to drag the pieces because the hotspot is transparent), or just load a certain default background image into them (for example a white image)
Action.LoadAPicture Hotspot(Hotspot_Number), "White.jpg"
(Again, you'll need to do this for all hotspot images of your jigsaw puzzle)
To add items (puzzle pieces) to the inventory to give them back to the player:
First you need to remove all pieces from the inventory (for the case that the player didn't put all pieces yet - otherwise giving them all pieces back may result in having certain pieces double)
Action.RemoveAllItems
(attention, if you have inventory items other than the jigsaw puzzles, you may need to find another way of removing the pieces that the player has not used yet, otherwise those items will be removed, too).
Then add the pieces to the inventory using:
Action.AddItem "Item_Name"
(Again, you need to give the player all jigsaw pieces back)
In order not to make it too complicated for myself, I only let the player play the jigsaw puzzle after collecting ALL pieces. If pieces were missing, they got a message that they need to search for more pieces first.
But this is also just one of the options - you could do it differently.
As I said there may be many different ways to create a jigsaw puzzle, what I have described is just one of them.
I'm sure that our "VBScript professionals" would have a better and maybe even easier solution