Checking Region ID of a picture?

Eilwyn

Veteran
Veteran
Joined
Mar 13, 2012
Messages
185
Reaction score
35
First Language
English
Primarily Uses
RMMV
Hi All,

I need help checking the Region ID of an item I have created using Pictures and Events.

Basically, I've created a fully functional Boomerang within a Common Event that activates whenever the player presses the appropriate button.

The event goes:

1. Check Player X and Y position on the Screen
2. Check which direction player is facing
3. Change Player X and Y accordingly based on where the boomerang is to start its animation from
4. Place a picture of one of the animation frames of the boomerang and place it at the altered Player X & Y
5. Change Player X and Y again to nudge the boomerang a half a tile over
6. Replace the picture with a different animation frame
7. Repeat steps 5 & 6 re-adjusting the X and Y where they previously were to move the boomerang back to the player.
8. Erase the picture when the boomerang appears back at the player's position.

What I can't figure out is how to tell what region ID the Boomerang picture/Coordinates are currently over, the aim being that if the player fire's the boomerang and it hits the Region ID, the event ends and erases the images prematurely. For example, so they cannot throw the boomerang through a wall or something.

Any help would be greatly appreciated!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
It would be a lot easier if you used an event with a sprite instead of a picture for the boomerang.

Region-IDs are tile properties on the map, and tiles use the mapgrid (like events do).
Pictures are using pixel-coordinates independent of the map.

Basically, to get from a pixel coordinate to a map coordinate, you'll have to divide the pixel numbers by tile size (48 in case of MV) and (if your map is larger than the screen) add the current position offset to the screen pixel numbers.
Then you can use get location info to check the region-ID on those tile coordinates.

Using a sprite would probably mean a less fluent animation and way, but it would allow you to get the ID on the event coordinates without using screen coordinates
 

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,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top