Pushing objetcs for puzzles?

Discussion in 'RPG Maker VX Ace' started by Sora-to-Mikki, May 18, 2019.

  1. Sora-to-Mikki

    Sora-to-Mikki Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Venezuela
    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: May 18, 2019
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,113
    Likes Received:
    10,987
    Location:
    Australia
    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.
     
    #2
    Zeriab likes this.
  3. Sora-to-Mikki

    Sora-to-Mikki Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Venezuela
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    ok, i'll try it ^^ Thank u!

    And i'll fix this too, jeje :DUu Thanks for that!
     
    #3
  4. Sora-to-Mikki

    Sora-to-Mikki Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Venezuela
    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.
     
    #4
  5. Ebanyle

    Ebanyle Curse Diva Veteran

    Messages:
    220
    Likes Received:
    99
    Location:
    Brazil
    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.
     
    #5
    Sora-to-Mikki and Shaz like this.
  6. Sora-to-Mikki

    Sora-to-Mikki Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Venezuela
    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?
     
    #6
  7. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,416
    Likes Received:
    284
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
  8. Sora-to-Mikki

    Sora-to-Mikki Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Venezuela
    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
     
    #8
  9. Ebanyle

    Ebanyle Curse Diva Veteran

    Messages:
    220
    Likes Received:
    99
    Location:
    Brazil
    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:
     
    #9
    Sora-to-Mikki likes this.
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,113
    Likes Received:
    10,987
    Location:
    Australia
    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()
     
    #10
    Sora-to-Mikki and Ebanyle like this.
  11. Sora-to-Mikki

    Sora-to-Mikki Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Venezuela
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    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?
     
    #11
  12. Sora-to-Mikki

    Sora-to-Mikki Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Venezuela
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Thanks! And don't worry, i've solved the problem with the script ^^ Thank u sooo much for all your help <3
     
    #12
    Ebanyle likes this.
  13. Shaz

    Shaz Veteran Veteran

    Messages:
    37,113
    Likes Received:
    10,987
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    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.
     
    #13

Share This Page