An issue with events, trying to set a switch or variable based on where an event currently is.

Donavon

Villager
Member
Joined
Nov 11, 2015
Messages
10
Reaction score
1
First Language
English
So I'm making a chunk of the game where the player can load a minecart with dirt and then dump it into a pit to make the pit passable. The problem I'm currently having with this is that I don't know how to get the game to check if the cart is at x,y. I actually can't find any way for the game to pull where an event is at.

To be more specific, I found the 'get location info', set it to event ID, and set it to the spot next to the pit. Then set an event with the trigger of that variable=event ID, but the second event, set to trigger off of that variable, does not function. It's possible I'm misunderstanding what 'get location info->event ID' means. If somebody could enlighten me as to:

A: What the function 'get location info->event ID' does, what it's use is.

B: How I can set this up so the game will recognize event X has been moved to position Y, so that event Z can function. 

Thanks a ton in advance, and my apologies if the question is poorly worded or too vague, would gladly provide whatever detail's needed to be understood.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
We would need to see your event to understand exactly what you're doing. Sounds like you just need to run it in a parallel process or something so it will continue checking.


If you post a screenshot of your event commands (include the whole event window, not just the list of commands), we can take a look and see.
 

RyokuHasu

Developer
Veteran
Joined
Jun 23, 2012
Messages
274
Reaction score
38
First Language
English
Primarily Uses
I made this example for a different support question but it applies here as well, it's an example of how to get and how to compare an Event's location using variables to get the X and Y of the event

What this exact example does is gets th X and Y coordinates of the event and determins if the event is within a set boundry.

Map X and Y is calculated from top-left to bottom-right where top left is 0,0 and bottom right is the maximum for each. you need both X and Y to find the location of an event and compare it.

NPC Zoning Example.png
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
The way the OP is trying to do it would be much easier though - only a single command. Get Location Info, put the event id at that location into the specified variable, then test to see if the variable contains that value. I really suspect it's just a matter of not being called at the right time.
 

Donavon

Villager
Member
Joined
Nov 11, 2015
Messages
10
Reaction score
1
First Language
English
Thanks for the confirmation that get location info-event id does work how I thought it did originally, it was definitely just a mis-step at some point. I rebuilt it and everything works correctly now. Thanks a ton for the help.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
It occurs to me that that function will only return a single event id. If you happen to have two events on the same tile (which can happen if one of them is set to Through), your event MIGHT be on that tile, but it might give you a different event id - like a boulder and a switch being on the same tile.


If that's a possibility, it would be more reliable to use Control Variables to get the event's X and Y position, then Get Location Info to get the region ID of the tile at that position (and of course, draw a Region 1 on the tile where the mine cart can empty out) - it's a matter of checking where the event is and if that's a valid tile, than looking at the valid tile and seeing what event is on it.
 

Donavon

Villager
Member
Joined
Nov 11, 2015
Messages
10
Reaction score
1
First Language
English
That may have been part of the issue as well, I did originally have events in the same location, but they were autorun/parallel, and when re-making the event I moved them out of the way.

Though I'm having some confusion with your recent message. Why would you need to check twice, once with event's position, and once with get location info? 
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
You're not checking twice. 

You're setting variables to the event's position, and then you're using Get Location Info to get the region at that position contained in those variables.

It's a different way of using the Get Location Info (you're getting the region on a certain tile, not an event id), but unfortunately the only options are to set a fixed location, or to use variables.  It would be nice to have a dropdown and be able to choose a player or event and just have it use their x/y coordinates, but you can't.
 

Donavon

Villager
Member
Joined
Nov 11, 2015
Messages
10
Reaction score
1
First Language
English
Alright, I'm just not following the utility of that in comparison to getting the event's location through variables, and then checking that those variables match the location you need the event to be in. I suppose the region thing would be more useful if there were multiple tiles that would work as a requirement for whatever the event was. Thanks again for the help, though.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
Checking that the variables match the location means you have to have two conditional branches, and if you're doing an "else" something, you have to cater for one of them being the same, but not both.

Regions is good if you have several - say you have 3 switches and you want to move 3 boulders onto them, but you don't care which boulder goes onto which switch.  You can just do the above for all 3 events, and as long as all 3 are on the correct region ids, the puzzle is solved.
 

Donavon

Villager
Member
Joined
Nov 11, 2015
Messages
10
Reaction score
1
First Language
English
Ahh, thanks for the explanation. Appreciated, sir.
 

Latest Threads

Latest Posts

Latest Profile Posts

Who's a fan of firearms? The 5 on the bottom row (not including the green laser ones) I made pretty recently. I plan for most of these to be in my project.

Screenshot 2021-09-28 165924.png
Doing RPG Maker News for 28th September 2021

RMMV - Skip script errors:

For game developer testing purposes.
You know, I really get to farm likes since I post all of @Avery and @hiddenone 's blog tutorials on the forums...
Back from a very long hiatus with a new project woo
This is my battler placeholder image trying out art styles too I want to fake a backview battle system
I think I will want portraits and battle sprites to be 2D and stick to pixel art for overworld not 100%sure but pretty sure its easier to make pixel art for overworld sprites, events and maps and stuff.
Placeholder.png

Forum statistics

Threads
115,441
Messages
1,089,938
Members
150,222
Latest member
Spacer789
Top