RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Request: Item at certain position

0 Members and 1 Guest are viewing this topic.

****
MONOCLE MAN
Rep:
Level 89
-::Gone::-
Well, if you've played some game, in some game there are puzzles where you must push a rock, item, or items, to a certain spot or on a button of some sort. For example, in a room, there are three rocks, three buttons, and a door, you have to be on all three switches for the door to open, but you can't go to three places at once. So you have to push a rock onto a button, and when it's on it, the switch will stay down.

Tl;dr:
How can I make it so a movable rock has to be on a certain spot?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Best RPG Maker User (Scripting)2010 Best Use Of Avatar And Signature Space
Just check the position of the event using variables. So, make three events (your rock events) and set aside six variables.

Call one variable Rock 1 X, another Rock 1 Y, etc... for all three rocks. Then in a parallel process event:

Set all variables to the coordinates of their respective names. You'll notice that if you go into Control Variable, one of the options is to set a variable to any character's Map X or Map Y - use those to get the coordinates of all your rocks, and then just check them against the positions of the switches.

****
MONOCLE MAN
Rep:
Level 89
-::Gone::-
Not to be a necroposter, but I still don't quite understand. Could you set me up with a demo of some sort?

********
Furry Philosopher
Rep:
Level 94
Rawr?
2013 Best RPG Maker User (Creativity)Gold - GIAW 11 (Hard)Randomizer - GIAW 11Secret Santa 2013 ParticipantFor frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Mapping)2012 Best RPG Maker User (Programming)Secret Santa 2012 ParticipantGold - GIAW 9Project of the Month winner for September 2008For taking a crack at the RMRK Wiki2011 Best RPG Maker User (Programming)2011 Best Veteran2011 Kindest Member2010 Best RPG Maker User (Story)2010 Best RPG Maker User (Technical)
Firstly, don't worry. It's not a necropost. Second, it's easy enough to do this kind of puzzle if you understand the basic variables of it.

Let's say that your switch is at coordinates 009, 003. Obviously, you want the switch to activate when your rock's coordinates match those of your switch. So, what you need to do is make two variables: Rock X, and Rock Y. Make a parallel process event that sets these two variables to your rock's Map X and Map Y accordingly. Then, in the same event (or a different one, if you prefer), make a conditional branch that checks if Rock X = 9 AND if Rock Y = 3. If so, then you can activate the switch's event and whatnot. There's a lot more you can add to it, but it might be better to just experiment for yourself.

I've attached a mini-demo below with some extras. It has no bugs as far as I can tell. Feel free to use it if you want, as long as you keep in mind that if you move the switches, you have to change the preset coordinates on them.
« Last Edit: July 23, 2008, 02:14:47 AM by Zylos »