Make an event end when it gets to a certain spot RPG MV (SOLVED)

Status
Not open for further replies.

Toxicmage38

Villager
Member
Joined
Dec 22, 2018
Messages
5
Reaction score
0
First Language
english
Primarily Uses
RMMV
Ive been googling and searching these forms and cant seem to find an exact answer to what im trying to do so im sorry if this is a repost...

But what im trying to do is make a statue moveable by character actions and when it hits a certain spot on the map it stops and will trigger an event when the others are moved to their spots as well.

I have the movement down i just cant figure out how to make the event hit the right spot and stop.

Any and all help is much appreciated! Thank you in advance!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,154
Reaction score
14,652
First Language
English
Primarily Uses
RMMV
So it's a puzzle where you have to move certain objects onto certain tiles? Do you move it once and it continues in that direction until it hits the right spot (or a wall)? Or do you have to push it every tile you want it to move?
 

Toxicmage38

Villager
Member
Joined
Dec 22, 2018
Messages
5
Reaction score
0
First Language
english
Primarily Uses
RMMV
I have it set to where it moves one spot depending on which side of it you are on

and having it hit the certain tiles is what im aiming for
 

BishoujoHelper

Veteran
Veteran
Joined
May 6, 2017
Messages
54
Reaction score
46
First Language
English
Primarily Uses
RMMV
Sounds like all you have to do is check in the statue's event what its current X & Y coordinate on the current map is, and if its at the correct values then don't allow the "push" to change the statue's position anymore. (Event Commands / tab 1 "Game Progression" Control Variables / "Operand" Game Data / "Character" This Event - Map X, and another variable for Map Y)
Personally, I'd allow the player to mess up and push the statue anywhere they want, and have your autorun event that's checking for all the statues in the correct locations just wait patiently until they get it right. I hope you have some way to reset all the statues in case they get pushed into places where they can't be retrieved.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,154
Reaction score
14,652
First Language
English
Primarily Uses
RMMV
You wouldn't use an autorun event, because if you did, the player wouldn't be able to push the statues at all. I wouldn't even use a parallel process event.

If you have X number of statues and X spots to put them, and it doesn't matter which statue goes on which spot, do something like this:

Use the Region layer to draw the same region id on all the spots.
On each event, have the movement followed by a Common Event command - all events will call the same common event.
On each event, add a second page conditioned by self switch A, with the statue, but no movement commands (this is so when the event is on the correct spot, you can activate that event page and the player can't push it any more).
In the common event, use Control Variables > Game Data > Character > This Event's > X to put the X coordinate into a variable. Do the same with the Y coordinate.
Then use Get Location Info with those two variables to put the region id into a third variable.
Finally use Conditional Branch to see if the third variable is equal to the region id you put onto the spots - if it is, turn on self switch A.
 

BishoujoHelper

Veteran
Veteran
Joined
May 6, 2017
Messages
54
Reaction score
46
First Language
English
Primarily Uses
RMMV
I was thinking of an autorun or parallel "watcher" event to see if all X number of statue events were in their own correct X and Y positions, with no need for any regions. But the @Shaz way avoids the need for a "watcher," as long as something is checking for all X number of those self switch A being turned on, to do whatever is supposed to happen when the statue(s) are correctly placed. Go with Shaz, it's explained in more detail.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,130
First Language
English
Primarily Uses
RMMV
Another advantage to Shaz's solution is that the logic is being executed only when it needs to be executed - when the statue location changes. A parallel event (again, an autorun would not work here) would execute 60 times per second. While I doubt that checking the X and Y position would cause any noticeable lag, it's good to have in mind whether something needs to be done 60 times a second or not - enough of these small things could add up and start to slow down a game.
 

Toxicmage38

Villager
Member
Joined
Dec 22, 2018
Messages
5
Reaction score
0
First Language
english
Primarily Uses
RMMV
I appreciate all the help!

Shaz im trying to follow your way but im getting a little lost at the get location part... could you elaborate a little bit the way ive been trying to do it either one move and it activates whether its in the right spot or not or it just keeps being able to move
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,516
Reaction score
8,147
First Language
German
Primarily Uses
RMMV
get location info needs three variables. one variable to store the info you want, and two variables to give the coordinates of the mapposition you want to see info from.
The two coordinate variables need to get the x and y of the current position of the statue - that is done by control variable before you use the get location info command.

then you use the get location info command with these two variables to get the info about the position into the third variable - in this case the region ID of that position.
And then you check the number you gained from the region ID. If that is the number you placed on the target position then you know that the statue is placed where it is supposed to trigger something.
 

Toxicmage38

Villager
Member
Joined
Dec 22, 2018
Messages
5
Reaction score
0
First Language
english
Primarily Uses
RMMV
Im sorry Andar i dont think im fully understanding... how do i define the region id as the 3rd variable or am i misunderstanding what the 3rd variable should be...
ive been working on it but the only thing i can get it to do is move on the y soon as i move it on the x it activates right spot or not

edit: idk if this will help but this is what i have so far from my understanding.
(the common event is just a move up/down/left/right)
20181222143000_1.jpg
 
Last edited:

Toxicmage38

Villager
Member
Joined
Dec 22, 2018
Messages
5
Reaction score
0
First Language
english
Primarily Uses
RMMV
So after reading about regions i was able to find this video
I have been able to get my event to work finally!
Thank you all you magnificent and wonderful people!!!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,154
Reaction score
14,652
First Language
English
Primarily Uses
RMMV
Glad you got it sorted. Your event in the previous post had a LOT of issues - I didn't watch the video, but I hope going through that helped you understand why your event would not work.

If your problem is solved, you can report your first post and let the mods know, and they'll close the thread.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,374
Reaction score
5,534
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

I want to work on my reboot, but I don't have time to do it. ;_;
4y195n.png
big image so i posted it as a spoiler
Just a reminder to back your projects up. Do it now! :yamero:
If there was an award for best game dev procrastination, I'd say 'meh, I'll pick it up tomorrow' >_>
Honestly though, I've been staring at the same half-made map for a while now haha! Ahhh, I'm so tired of mapping!
Time to add the support for import/export default RMXP maps. Maybe there will be customized tileset support later. In theory, I can reimplement the entire RMXP inside this RMXP-made game to make more RMXP games. :kaojoy:RMXPFORMATSUPPORT.jpg

Forum statistics

Threads
111,269
Messages
1,059,776
Members
144,566
Latest member
Loltoheaven777
Top