Pushing objetcs for puzzles?

Sora-to-Mikki

Tell me Sora~
Member
Joined
Nov 17, 2018
Messages
14
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
hi, everyone!

I'm looking for some help... I want to do a puzzle pushing an object. Let me explain with a example...
Imagine a box, in the middle of a room with two doors; one open, where u come from, and the second closed. I want that when it moves to an especific spot, sounds a "click" and the door's open.

I already know how to "push" that box, but my dilema is with the event that I want to happend. Any help, please...?


Sorry my bad english, btw~​
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
On the box event, after it's pushed, check the X and Y coordinates (control variables to put the X and Y into two variables, then do a nested conditional branch to see if the X is correct and the Y is correct), and if the match the spot where it's meant to go, make the sound and turn on a switch, and give the door event a second page conditioned by that switch.

It's very difficult to read centered text. You're better off just leaving it as the default and not trying to make it fancy. We don't care if your post is pretty - just that it's readable.
 

Sora-to-Mikki

Tell me Sora~
Member
Joined
Nov 17, 2018
Messages
14
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
ok, i'll try it ^^ Thank u!

And i'll fix this too, jeje :DUu Thanks for that!
 

Sora-to-Mikki

Tell me Sora~
Member
Joined
Nov 17, 2018
Messages
14
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
Btw... I can't understand really much what I have to do. Sorry, I'm learning 'about the conditions and variables yet, that's why.
 

Ebanyle

açspasl~d~dfflass
Veteran
Joined
Sep 2, 2016
Messages
338
Reaction score
200
First Language
Portuguese
Primarily Uses
RMVXA
Try doing it like this:
upload_2019-5-18_0-49-2.png
Where the "== 5" is the coordinates of the place you want the object to be above.
You can check de coordinates of the map by clicking in the place you want the object to be and look at the bottom-right corner:
upload_2019-5-18_0-50-53.png

To get the the event's coordinates go to "Control Variables..." command in page 1, then in "Game Data" and them select Character > This Event > Map X/Y
Like this:
upload_2019-5-18_0-52-27.png

Remember to set a separate variables each for the X coordinate and the Y coordinate.
 

Sora-to-Mikki

Tell me Sora~
Member
Joined
Nov 17, 2018
Messages
14
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
Wah! It's works! Thank u so much! ^^
But, I have another cuestion now... How could I make the object stay in its place, even if I left the room? Is there a way, or not?
 

Sora-to-Mikki

Tell me Sora~
Member
Joined
Nov 17, 2018
Messages
14
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
Oh holy crabs(?) Okno, but, sheet, scripts.... Jeje, I don't know how to use them ^^Uu I think that I'll manage with others options, I don't wanna bother anyone. Anyways, thanks for all help <3

And sorry my bad english uwu
 

Ebanyle

açspasl~d~dfflass
Veteran
Joined
Sep 2, 2016
Messages
338
Reaction score
200
First Language
Portuguese
Primarily Uses
RMVXA
When the object is at it's designed place, make a parallel event with a page condition being the switch that is activated once the puzzle is complete. Then make this event retrieve the same variables coordinates you used and use "Set Event Location..." to teleport the object into the coordinates from the variables.
If you do that way, remember to use a third variable to store the Map's ID.

If it's a only one room puzzle I recommend doing it the way I said; if not, try using Shaz's script that roninator2 linked.
Though it can be complicated, since usually puzzle objects can get stuck if you're only able to push them... Though I don't know if Shaz script can make certain exceptions.
I'm on mobile atm, but if you want I can print the instructions tomorrow :kaoswt:
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
My script will allow you to 'forget' an event location as well, if you want to put it back to its original spot. Or you could just do a Set Event Location command to move it where you want, and call the script to remember the location again.

@Sora-to-Mikki you'll probably have to use scripts at some point, but good on you for trying to do as much as you can without them first. If you only use a few, it's pretty easy. Hit F11 to open the script editor, then scroll down to the bottom to see the Main section. There'll be a section just above that with (insert here). Click on that then hit the Insert button. Add a name to the name box so you can easily see what scripts you have and where they are, then copy the script text from the link provided and paste it into the large script window.

After the move route, add a Script event command (bottom of tab 3), and just paste this:
$game_map.events[@event_id].save_pos()
 

Sora-to-Mikki

Tell me Sora~
Member
Joined
Nov 17, 2018
Messages
14
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
My script will allow you to 'forget' an event location as well, if you want to put it back to its original spot. Or you could just do a Set Event Location command to move it where you want, and call the script to remember the location again.

@Sora-to-Mikki you'll probably have to use scripts at some point, but good on you for trying to do as much as you can without them first. If you only use a few, it's pretty easy. Hit F11 to open the script editor, then scroll down to the bottom to see the Main section. There'll be a section just above that with (insert here). Click on that then hit the Insert button. Add a name to the name box so you can easily see what scripts you have and where they are, then copy the script text from the link provided and paste it into the large script window.

After the move route, add a Script event command (bottom of tab 3), and just paste this:
$game_map.events[@event_id].save_pos()
WAAAAH!!! It works!! :D Thank u so much! I didn't know that I have to "declarate" the script before use it... Well, I know it now ^^

So, if I want to use another script, I'll have to create another page for that scrip, or I can put two in the same page?
 

Sora-to-Mikki

Tell me Sora~
Member
Joined
Nov 17, 2018
Messages
14
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
When the object is at it's designed place, make a parallel event with a page condition being the switch that is activated once the puzzle is complete. Then make this event retrieve the same variables coordinates you used and use "Set Event Location..." to teleport the object into the coordinates from the variables.
If you do that way, remember to use a third variable to store the Map's ID.

If it's a only one room puzzle I recommend doing it the way I said; if not, try using Shaz's script that roninator2 linked.
Though it can be complicated, since usually puzzle objects can get stuck if you're only able to push them... Though I don't know if Shaz script can make certain exceptions.
I'm on mobile atm, but if you want I can print the instructions tomorrow :kaoswt:
Thanks! And don't worry, i've solved the problem with the script ^^ Thank u sooo much for all your help <3
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
So, if I want to use another script, I'll have to create another page for that scrip, or I can put two in the same page?
ALWAYS keep your scripts separate, and name the slots so you know what script is where. This will make it easy to troubleshoot if you start getting any script errors. And that's not "declaring" a script - it's just the way you add it to your project. MV does it differently, but all the other engines that have scripts (XP, VX, VX Ace) all do it this wayl.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top