Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to push 2 events to each other, explode and dissappear?

I want to make a puzzle where the hero will push event A into event B, or event B to event A, after the 2 events touch each other, both events will explode and disappear, clear the way for the Hero to walk throught.

Well I can make the hero push the event, but after that I pretty much stuck. Can someone show me how to do this. Thanks. :heart:
 
Note one of the events should be Through, or the 2 events cannot be on top of each other.

1.Detecting when 2 events touch:
make new 'parallel process' event. inside it save the 2 event's x and y in 4 variables, then have a conditional branch:
if x=x and y=y, pull a switch 'explode' ON.
2.show explosion
Add another page to your 2 events, set the page condition to: switch 'explode' is ON.
RMXP has a default 'explosion' charset- 197-support05, select that as the page's graphic and set it to 'stop animation'. wait a few frames, then erase the event.

You can also use my New Event Methods script to check if event 1 touches event2.
Make a cond. branch, script: event_touch?(1,2)
 
@ Darth

I can't use "event touch" as a trigger because the player have to be able to push the events. So it have to be action button press.

@ silver wind

On detecting when 2 events touch. I test it and it doesn't work with event editor (variable, conditional branch), but it does work with your script, that is a very good script. Is this script work well with other scripts, especially the SDKs ?

BTW can silver or someone explain more specifically how to use event to detect when 2 events touch, thanks. :grin:

Basicallly I tried this and it doesn't work:

Objective: event Rock1 and Rock2 touch, both of them disappear.

In the first test, I created 2 variables and placed this on top of the event editor:

Rock1 (Name of the variable) ::: Rock1 - Map X
Rock1 ::: Rock1 - Map Y
Rock2 ::: Rock2 - Map X
Rock2 ::: Rock2 - Map Y

Conditional Branch:

If variable Rock1 = variable Rock2
Switch "EndRock" on (When switch on, the other page on the event Rock1 and Rock2 would activate and EraseEvent)

When I tried this, some how the 2 events disappear right in the beginning before the player has any chance to push it.

Test 2:

I created 4 variables:

Rock1Y ::: Rock1 - Map Y
Rock1X ::: Rock1 - Map X
Rock2Y ::: Rock2 - Map Y
Rock2X ::: Rock2 - Map X

and 2 conditional branchs:

If Rock1X = Rock2X
... If Rock1Y = Rock2Y
Switch "EndRock" on

When I tried this, I push the rocks into each other and nothing happen. :(

PS/ And yes I did test it in a separate parallel process event.
 
If your boulders aren't set to through, the events won't actually have the same x/y variables (they have to be on top of each other). It will take a little more work, but if you check all 4 directions of the rock and add or subtract 1 to the value of the variables it should work.

e.g.
Conditional Branch: Rock1 is facing Right
Control Variables: Rock1X += 1
Conditional Branch: Rock1X == Rock2X and Rock1Y == Rock2Y
Switch "EndRock" on
End
End


And repeat for all four directions.
 
Event Touch actually checks if the event touches the player, rather than event-to-event handling. A bit confusing when they translated it over to English, but there's always workarounds.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top