Batch Collision Detection

chaucer

Veteran
Veteran
Joined
Aug 6, 2014
Messages
272
Reaction score
433
First Language
English
Primarily Uses
RMMV
Batch Collision Detection : v - 2.0.0


Creator : Chaucer



Introduction :


This plugin will allow you to check if the player or events are colliding with eachother, technically this could be done with eventing. The only difference is this can check 1 event vs multiple events, or multiple events vs multiple events, while saving you time.

Features:

  • check collision of multiple events against other events, or the player or a single event.

  • save time compared to purely eventing.



How to Use
The instructions are inside the plugins help file, but here's the basics of it.


To create a batch group of events to compare just add <batch_id:id>(id being a number value) to each event you want to be part of this groups note tag.


Once you have a group, you call the following in a conditional branch (or wherever else you might want to call it) via script call, $gameMap.checkBatchCollision(a,[id]), and that's it.
Here's an example of it in use.

don't question the name, batty is sensitive about it T_T


BatchCollisionExample1.png




and in this event, we run it on parallel process and use a conditional branch to check the collision between player, and our batch. you can run anything you'd like inside the conditional branch :D


BatchCollisionExample2.png


Script:
Download link below.
Click Here.



Terms:


Free for commercial and non-commercial use, just don't forget to credit. :D
 
Last edited:

DerMig

Warper
Member
Joined
Mar 23, 2016
Messages
3
Reaction score
0
First Language
German
Primarily Uses
Hi and first of all: Thank you for the script...  :) But unfortunately: i can't get it working in my project. Can you maybe add an example? Or some screenshots? That would be very helpful. Thanks in advance!
 

chaucer

Veteran
Veteran
Joined
Aug 6, 2014
Messages
272
Reaction score
433
First Language
English
Primarily Uses
RMMV
Definitely I can add some screenshots to it ^^ but I'll have to wait till a bit later to do it sorry I hope you don't mind. ^^;

Edit: Added example screenshots as requested. Also updated the plugin. I didn't realize it was only calculating exact X and Y locations, therefor if could not determine detection if both events were not passable, this issue's been resolved. :D
 
Last edited by a moderator:

DerMig

Warper
Member
Joined
Mar 23, 2016
Messages
3
Reaction score
0
First Language
German
Primarily Uses
Thank you so much! I was a little confused about the brackets - but now i got it and it works like charme :D


Very nice work! Thanks again, it will save me a lot of work
 

Sethorion

Villager
Member
Joined
May 8, 2015
Messages
19
Reaction score
7
First Language
English
Primarily Uses
Firstly, Chaucer, thank you very much for creating this script. I've been struggling to find something usable after Ramiro's Pixel perfect Collision system proved to difficult for me to implement.

Here's what I've done with it: I found that if an event with a batch number approaches the player and makes contact, I can have the batch deal damage at intervals until the player moves away. I can also have the player Spacebar at the event to lower it's HP (via variable) and get the event to delete itself after the variable reaches zero.

Three Questions:
- If the player and the batch are making contact, but the player changes the direction he is facing, the batch event suddenly stops dealing damage. I've messed with the event's custom move route and stuff, but it seems that I have to change the player's actual X.Y coordinates before the batches begin dealing damage again. How do I fix this?
- If two events with <batch:100> both encounter the player, only the first event does damage and the second is ignored. Do I have to make separate batches for each individual enemy, and not just each enemy type?
- Lastly, am I taking the long way round to do this? I have to set the Enemy 1 HP, Enemy 2 HP, etc variables for each individual monster on the map and set a Batch:collision event for each batch on the given map to determine damage and atack speed, etc. Is there an easier way to accomplish this?
 

chaucer

Veteran
Veteran
Joined
Aug 6, 2014
Messages
272
Reaction score
433
First Language
English
Primarily Uses
RMMV
Hmmm... this plugin is quite old, I almost forgot i wrote it ^^; I'll take a look into this when I find some spare time @Sethorion I'll be sure to notify you when I update the plugin.
 

chaucer

Veteran
Veteran
Joined
Aug 6, 2014
Messages
272
Reaction score
433
First Language
English
Primarily Uses
RMMV
@Sethorion I've updated the plugin( also rewrote it, it was a bit more complicated than it had to be, and lacking in comments ). The new plugin works a little bit different, but achieves the same effect, and it should work with detecting collision without having to change the players actual X, Y coordinates!

Unfortunately it's not possible to determine how many events are colliding at this point, this plugin was only created to determine how if ANY collision between groups was happening, not to determine how many collisions were happening, I might try to add this later, if i get time, but for now, it's not possible. I apologize.

The last Question you had I'm afraid I couldn't answer this, I know it could be done quicker through scripting than eventing, but I'm not sure if theres a faster way to handle it in eventing. Sorry bro :(

Edit : I've also added the ability to use comments, instead of note tags, so that events can only batch check on specific pages if needed.
 

Sethorion

Villager
Member
Joined
May 8, 2015
Messages
19
Reaction score
7
First Language
English
Primarily Uses
It's all cool. Thanks for all your hard work, man! The world needs more people who create things, like you do.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Stream will be live shortly! Going to do another art stream tonight so that I can finish my Fauna Focus piece~ Feel free to drop by!
Humans are fallible creatures, we all know that. It's when we're forced to look at ourselves that we start to disagree. :p
Expectation: Working on boss battle.
Reality: "Look at how awful are these code and database organization. Let me clean this mess", *yet, casually adding more modules that I have no idea if I would use it later*
Trying to learn to read Japanese so I read my manga. I like to buy them without all the edits made during translation.
The only thing getting me through today so far is coffee. And lots of it.

Forum statistics

Threads
97,852
Messages
947,384
Members
129,079
Latest member
DerLaPux
Top