Event colliding with another event

lovemallow

Villager
Member
Joined
Sep 4, 2015
Messages
7
Reaction score
0
First Language
English
Primarily Uses
Hey! I'm stuck trying to solve a problem. In my game my character can casts spells on map and I'm trying to make it when the spell event and enemy event collide they both dissapear.

I thought of solving this problem with using control variable -> game data -> map ID but it still doesn't work.
Both the spell and the enemy have their own seperate variables (spellpos and enemypos) set to map ID. Maybe that's why? I'm unsure if the game would have saved those two variables as their own map IDs.

anyway here's some screenshots



magic blast event page. As you can see there is the variable set to it's map ID



Enemy event page. I made it so that when the magic blast and enemy touch (basically the conditional is when their map ID matches) It will dissapear or it's control switch will go to A.



This happens instead where the spell just sits next to the enemy and then disappears. The enemy doesn't disappear either.

I hope that makes what I have a problem with clear! Also I'm really really sorry if an answer like this has been asked before. This is my first time ever on these forums and I have been searching for a few hours and didn't find anything.

 
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Why are you interested in map id? You can't cast a spell on an event on a different map, so they are going to be the same anyway.


Player Touch will not work as a trigger, because the player is not touching either event. There is not a trigger for an event touching another event.


What you want to do is set your spell event to through, and set the trigger to parallel process. In your event commands, compare one event's x and y values to those of the other event. When they are the same, show an animation if desired, then erase both events.
 

lovemallow

Villager
Member
Joined
Sep 4, 2015
Messages
7
Reaction score
0
First Language
English
Primarily Uses
oh lol I thought map ID for some reason meant where they were located on the map. Whoops.
So I now made variables for both the spell's xy and the enemy xy and set up conditions so when they match the enemy will dissapear.
The only confusion I'm having is when you said ' you want to set your spell event to through' I'm unsure what that means? (still new to this engine)
I did set the spell's trigger to parallel process.

Also thanks for your help so far!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
"through" means it will be able to move onto the other event, rather than just stop beside it. You need it to be able to move ONTO the other event before their x and y positions will match.


There will be a checkbox below the image box on the event page.
 
Last edited by a moderator:

lovemallow

Villager
Member
Joined
Sep 4, 2015
Messages
7
Reaction score
0
First Language
English
Primarily Uses
Ok I found the Through option.
Only thing that's happening now is that the spell isn't showing up I believe cause it's on parallel process?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
nope. Show a screenshot of your new event page - for each event.


When you say you made variables, do you actually set them to the x and y positions of the spell event and the enemy event?
 
Last edited by a moderator:

lovemallow

Villager
Member
Joined
Sep 4, 2015
Messages
7
Reaction score
0
First Language
English
Primarily Uses
Here is some updated screenshots of the two event pages.
The spell works and runs through the monster when they are both on event touch its just that none of them dissapear. On parallel process the spell doesn't show up for some reason.



Sorry for being such a bother but thanks so much by the way
 

lovemallow

Villager
Member
Joined
Sep 4, 2015
Messages
7
Reaction score
0
First Language
English
Primarily Uses
also yes I did set the variables to each event's X and Y. (Boom is the temporary name for the spell) so the spell's X and Y is boomx boomy
enemyx and enemyy is where the enemy is.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
lovemallow, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


In the projectile event, there is no condition when to control the switch - which means that it will be switched ON on first processing of that event.


That is what makes the projectile disappearing and why it won't work - the coordinated won't update again either since that page won't be processed again if the switch activates the second page.
 

lovemallow

Villager
Member
Joined
Sep 4, 2015
Messages
7
Reaction score
0
First Language
English
Primarily Uses
Sorry about that. And thanks! I added a 'wait' for a few seconds and it shows up now.
The only thing not working is the collision. The spell is still on 'parallel process' and on 'through' and the variables are the same.
Did I mess something up in my conditional branch? I don't know why it's not working ;-;
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
The conditional branch for checking the coordinates is now in a parallel process? It cannot work if it waits on player interaction (like event touch, that is triggered only when the event touches the player)...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You are also using variable 4 for 2 things.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
#----------------------------------------------#Hit_Box by Bex#----------------------------------------------b = 1 #<--Bullet Event_Idfor a in (2..50) #<--Enemy_Idsif $game_map.events[a] != nilif Math.hypot($game_map.events[a].screen_x - $game_map.events.screen_x , $game_map.events[a].screen_y - $game_map.events.screen_y) <= 20 #<--Enemy on same Tile?$game_self_switches[[$game_map.map_id, a, 'A']] = true end ; endendHow about a Hitbox that checks if one of the Enemie IDs is on the Same Field as the Projectile?

There are different ways to slightly edit it to build it in your Game.

This is RGSS3 Snippet you could use in Eventcommand Script on the 3rd Eventcommand Page.

Every Time this Snippet is called it asks if the Projectile is on a Pixel Radius, of 20Pixels (circa 1 Map Tile),

of one of the enemie ids. if yes it turns on the Self Switch of the Enemie ID.

It would be best to call the snippet only once if the Projectile moved one step and than repeat.

Or if your Game is small it could check every frame as long as the projectile is active.

Event Touch means, the Event can touch the Player and Activate.
 
Last edited by a moderator:

lovemallow

Villager
Member
Joined
Sep 4, 2015
Messages
7
Reaction score
0
First Language
English
Primarily Uses
Major Edit:

First I'd like to thank everyone that has helped me!!
I solved the issue using the first solution of checking with conditional branches if the two events X and Y met. The problem is that both were not on the parallel process.

Thanks! It's been solved!
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
No, you don't need them both on parallel process.
 

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