Aeri_Sicher

Rookie Programmer! >.
Veteran
Joined
Jun 3, 2013
Messages
74
Reaction score
10
First Language
English
Primarily Uses
Hello!

Recently, All I've been doing was making small puzzles for my games just for fun... but now, I've started getting serious about the puzzles and tried making something "new" for one of our serious projects...

So, the puzzle I'm aiming to create looks like this:

[IMG]http://i702.photobucket.com/albums/ww25/emperor24/Sample1_zpse61657d3.png[/IMG]
All the tiles and buttons seen on that image are seperate pictures with different picture numbers so that later on I could "select" two tiles and swap their positions! The problem is... After creating the cursor controls, I can't seem to find a way to get the pic ID inside a variable which is required for me to swap both the image positions.

So I guess my question is this: Is there any way to store the picture number ID inside a variable? I really don't mind if it's via script call or just normal eventing... or even if you have an alternative mean of getting two pictures to swap positions! Hopefully someone knows something about this and can help me out a bit =]
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,744
Reaction score
15,884
First Language
English
Primarily Uses
RMMV
It would be easier if your pictures were formed of 32x32 sprites and you were using events instead of pictures.


Can you give an example of the names of the files you're using? Looks like each digit needs 6 tiles, and some of them could be shared by different digits (top right and left corners of 6 and 8, middle right piece in 4 and 8, middle left piece in 6 and 8, for example).


If we know what you have to work with, it'll be easier.


Also, what are you trying to do, exactly? Why do you want the picture id in the variable? Are you just wanting to know what picture is under the cursor when a button is pressed, and when a button is pressed a second time, get the id of the NEW picture under the cursor and swap their positions? Can you explain the mechanics a bit more? Why are they swapping? What is the goal? Is the above image the completed puzzle or one in progress? Is the above the result of a script (are you in a scripted scene) or is it all done on the map?
 
Last edited by a moderator:

Aeri_Sicher

Rookie Programmer! >.
Veteran
Joined
Jun 3, 2013
Messages
74
Reaction score
10
First Language
English
Primarily Uses
It took some time, But I've re-created the exact same system that I used for this... I had to do this so that it does not sound confusing while trying to explain. I also didn't want to send the actual file because it download size is kinda big, so this here is simple and low on the memory(I hope)!: download

Before start: This is the first puzzle I'm making, and I don't have too much experience with RPGMaker VX Ace... So you may see a lot of code that is repetitive, I hope I didn't make too many useless program in it... Also, I made some variables to keep track of the cursor location (checks "which tile is it currently over?") while other variables are for checking where the cursor should be when a button is pressed, I made this picture showing how the up/down and left/right variables keep track of the cursor position:

[IMG]http://i702.photobucket.com/albums/ww25/emperor24/Sample2_zps0c1e8906.png[/IMG]
The top numbers represent left/right movements while the side numbers represent up/down movements

 
Goal: create a puzzle using pictures that requires the player to select two tiles and swap their positions to reveal the solution code, every time the player exits, the scene will remain the same (not yet programmed) until the reset button is pressed (not yet programmed)... when the solution is found, they may enter the code in the solution box on the bottom right of the puzzle (also not programmed) and unlock a switch.
 
How I did it: First, I had to make an event that would activate and load all the pictures when started... the second page is the processor that takes all the players button inputs and returns a result depending on the button pressed. After making all the button controls, I had to make a common event with all the information that can be gathered and used (such as updating the highlight cursor and changing tile positions (not yet programmed, stuck on this)... After finishing the common event and making all the proper requirements (using conditional switches), I began working on what would happen if "spacebar" is pressed the first time... what this does is that it gathers the data on that certain tile and saves it in a variable so that the cursor can remain there until the second tile is selected. the second time "spacebar" is pressed, the parallel processor changes it's instructions and should begin the "swap picture position" function... but I cant do that without storing the picture number ID inside a variable first.
 
I want to store the picture ID inside a variable so that later on I can use a script call to show a picture in the proper spot using this script call function to show images "screen.pictures[index].show(file_name, upperleft/center, x, y, x zoom, y zoom, opacity, blend type)" and all I would have to do is make the picture index the variable with the previous picture selected... that's why I asked if anyone knew how to store a picture ID inside a variable, I needed some kind of way to make the system remember which was the last picture selected so that I can program something to make them swap positions.

EDIT: added mechanics

- when the scene is accessed, the player can move the cursor and select two tiles to swap with eachother

- the first time you select a tile, the system should display a cursor on that spot, and also store information on the picture ID number (we will know what picture the player is currently on because of the two variables that keep track of the location.. to keep track of picture location after swapping, I would have to make variables store information about each tile)

- the second time you select a tile, the system should remove the first cursor and begin processing the swap function

- the solution to this puzzle is that you can only create one possible answer 486 which you may enter into the passcode box (the answer can actually just be entered without solving the puzzle). In order to prevent the player from creating a wrong solution such as "684" or "846", I would have to lock 1 tile on each number.

EDIT 2: I forgot to say:

- the puzzle you are looking at is already solved, I was planning to manually re-arrange each block so that the player would have to solve the puzzle to show the code, and enter that into the code box

- everything is done on the map, in the demo I used 4 events (1 event for the processor and the other 3 to lock the player from moving), 1 common event (for all the functions to be called by the processor), and a lot of variables and switches.

I hope that I covered everything and made it easier to understand what I was trying to accomplish in this system...
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

ScreenShot_7_1_2022_11_41_55.png
When the Panic gauge is full, Mike will turn into Omar in a state of actual panic. his move list changes and until the meter depletes completely, he'll be able make use of this alter ego.
So unbelievably excited for IGMC this year! First public game was for the original one and I'm just so pumped!!
Sometimes I am amazed at how relentless spam bots are. I would clear the que and then see 800~5k more depending on their mood.
Work on UD is already so delayed but I gotta drop everything so that I have something ready for IGMC!
Messed up the chains... :kaoback:
Sw7U8dA.jpg

Character: Jeanne D'Arc from Fate/Apocrypha.

Forum statistics

Threads
123,255
Messages
1,155,244
Members
161,636
Latest member
qixxi
Top