Edael

Villager
Member
Joined
Jun 6, 2020
Messages
22
Reaction score
7
First Language
English
Primarily Uses
RMMV
Any chance anyone knows of a plugin that can trigger common events when a picture is over or touching another picture? I feel like I've seen a plugin that does that before, but trying to find it is yielding nothing... Miss the master plugin list...
 

JohnDoeNews

Mod on Steam (MV/MZ)
Veteran
Joined
Apr 25, 2017
Messages
1,673
Reaction score
1,231
First Language
Dutch
Primarily Uses
RMMV
I don't know a plugin for this, but you could do this with eventing. However, this wouldn't be too easy. It would help if the pictures are all of the same size and you know at least the basics in math.

But it kind of depends on what you try to do exactly. If you want the pictures to move around a lot, it won't be much easier. In that case you will most likely end up being able to check if they touch when the picture starts moving, and when it reached its targeted destination, but not halfway trough. (Well, that too is possible, but the math with just be way much harder.)

For example:

We take to images of 300×200 pixels (300 wide, 200 high)
Then we take the position of both pics, in 4 variables:

- Pos X of pic A
- Pos Y of pic A
- Pos X of pic B
- Pos Y of pic B

Check if pos X of A is less then or equal to 300 pixels away from pos X of B.
Check if pos Y of A is less then or equal to 200 pixels away from pos Y of B.

(Pos = Positions in pixels counted from the left-top corner of the screen)

If BOTH conditions mentioned above are true, the pictures touch.

This works the same no matter if you choose left top corner or center as picture placement anchor, as long as both pictures have the same anchor.
 

Edael

Villager
Member
Joined
Jun 6, 2020
Messages
22
Reaction score
7
First Language
English
Primarily Uses
RMMV
I was thinking about using Variable Sectors for pictures, and while it is doable as you mentioned it's rather hard, also it's limiting to being box unless you add even more variable to form a more circular shape, like an octagon (forget trying to make a sector in the shape of the picture), so having a plugin to do the heavy lifting would be preferable. If I can't a plugin of the sorts this will be my last resort tho, thanks :)
 

JohnDoeNews

Mod on Steam (MV/MZ)
Veteran
Joined
Apr 25, 2017
Messages
1,673
Reaction score
1,231
First Language
Dutch
Primarily Uses
RMMV
I guess any kinds of solution would be box related. The thing with round images is... They are actually square images with transparent parts.

I agree a plugin would be a much easier solution, specially if it can tackle the moving parts, but I don't think there would be any that ignores the transparent parts of your pictures.

For your sake I hope I am wrong, though. I hope you find what you're looking for.
 

Edael

Villager
Member
Joined
Jun 6, 2020
Messages
22
Reaction score
7
First Language
English
Primarily Uses
RMMV
depends on how you want it. There's both Picture Drag and Picture Collision in japanese forums.
Basically, I would have 2 pictures, Picture A and B,
If A moves into and touches B, run common event.
Picture drag even with translate is hard to understand, and collision seems to only support picture to event, that can be helpful tho.
 

xabileug

Veteran
Veteran
Joined
Jul 1, 2014
Messages
600
Reaction score
210
Basically, I would have 2 pictures, Picture A and B,
If A moves into and touches B, run common event.
Picture drag even with translate is hard to understand, and collision seems to only support picture to event, that can be helpful tho.
I use picture drag for what you want. just follow the example, you will get it.

Code:
  * Common use cases:
  * P_DRAG 15 (picID)
  * P_DRAG_RESTRICT_REGION 15 x 0~816 (CEID x x1~x2)
  * P_DRAG_RESTRICT_REGION 15 y 0~624 (CEID y y1~y2)
  * P_DRAG_CALL_CE 15 1 10  (picID CEID frames)
  * P_DRAG_CALL_CE_REGION 15 x 204~612 (x1 to x2)
  * P_DRAG_CALL_CE_REGION 15 y 156~468 (y1 to y2)
  *
  * Make picture 15 draggable and set the draggable range to (0,0)~(816,624).
  * When entering (204,156)~(612,468), call common event number 1 every 10 frames.

it's working on my end, the Picture Drag, just comment out this line
1666744485699.png
 
Last edited:

Edael

Villager
Member
Joined
Jun 6, 2020
Messages
22
Reaction score
7
First Language
English
Primarily Uses
RMMV
I use picture drag for what you want. just follow the example, you will get it.

Code:
  * Common use cases:
  * P_DRAG 15 (picID)
  * P_DRAG_RESTRICT_REGION 15 x 0~816 (CEID x x1~x2)
  * P_DRAG_RESTRICT_REGION 15 y 0~624 (CEID y y1~y2)
  * P_DRAG_CALL_CE 15 1 10  (picID CEID frames)
  * P_DRAG_CALL_CE_REGION 15 x 204~612 (x1 to x2)
  * P_DRAG_CALL_CE_REGION 15 y 156~468 (y1 to y2)
  *
  * Make picture 15 draggable and set the draggable range to (0,0)~(816,624).
  * When entering (204,156)~(612,468), call common event number 1 every 10 frames.

it's working on my end, the Picture Drag, just comment out this line
View attachment 243596
Okay so I can't really test or check anything atm, at job, but when I see picture drag I think mouse, this isn't restricted to a mouse dragging pictures around is it? Game I'm making has no mouse functionality nor is it planned to include it, so just making sure.
 

xabileug

Veteran
Veteran
Joined
Jul 1, 2014
Messages
600
Reaction score
210
I see, so you need a different application. this is how i thought you needed picture collision from Picture Drag. maybe you can try the call common event via moving the picture
ezgif-4-5a2b358afd.gif
 

xabileug

Veteran
Veteran
Joined
Jul 1, 2014
Messages
600
Reaction score
210
I see, so you need a different application. this is how i thought you needed picture collision from Picture Drag. maybe you can try the call common event via moving the picture
View attachment 243597

you can use the center coordinates of the objects, having the edges touch will need a pixel overlap check plugin
 

Latest Threads

Latest Posts

Latest Profile Posts

It was fun while it lasted, but guess it's time to say goodbye to my antidepresants. My body is immune to their good effects and only bad effects would remain.
Character in the game lore: An individual with exceptional skills.
Players: Slip through the cliff and die.
You know.. I... I kinda lost my interest in living a long time ago. What sustains me is a lack of interest in dying.
Like a star that is balanced between the forces of gravity and outward pressure, I feel like the energy to produce that outward pressure is weakening. I feel like I should pull a Stardew Valley and revert to a more primitive lifestyle, away from others. :(

Forum statistics

Threads
131,586
Messages
1,221,276
Members
173,285
Latest member
tnt3927
Top