Edael

Regular
Regular
Joined
Jun 6, 2020
Messages
46
Reaction score
10
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

AFK TTYL
Regular
Joined
Apr 25, 2017
Messages
2,262
Reaction score
1,781
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

Regular
Regular
Joined
Jun 6, 2020
Messages
46
Reaction score
10
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

AFK TTYL
Regular
Joined
Apr 25, 2017
Messages
2,262
Reaction score
1,781
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

Regular
Regular
Joined
Jun 6, 2020
Messages
46
Reaction score
10
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

Regular
Regular
Joined
Jul 1, 2014
Messages
663
Reaction score
279
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

Regular
Regular
Joined
Jun 6, 2020
Messages
46
Reaction score
10
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

Regular
Regular
Joined
Jul 1, 2014
Messages
663
Reaction score
279
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

Regular
Regular
Joined
Jul 1, 2014
Messages
663
Reaction score
279
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

Hello everyone im back haha, so im planning to Restart my RPGMAKER project next year when i get new gear to work, But currently im working in Trading card games, if anyone is interested in this world please visit my website :

From there you will be able yo access to my social network profiles or my Discord server.
Good luck to everyone :)
Going back through and fixin' up the dialogue.
Thanks to @Iron_Brew for helping me with this one. Makes you think.
Jaminham.PNG
Experimenting with MV-style spriting, made a round guy :)

image.png
Don’t forget to catch Advent Day #3 compiled right here! Hmm. Let’s make today’s question…what is your favorite dish served at your holiday dinner?
All of the male sprites in New Dawn for the are built off of the third sprite I ever made on top of the first sprite base I made nearly a year ago, and now I'm making the female sprite base, and just by virtue of the amount of elapsed time and the number of sprites I've made since then, I think I'm going to have to revise all of my male sprites at some point.

Forum statistics

Threads
136,727
Messages
1,269,204
Members
180,442
Latest member
ZikaDasAlmas
Top