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.

Can i make an event trigger by touching another event?

Well. My friend, I think we need a bit more. If its a cut scene, then thats really easy. You just program that in....

If its a random thing, such as an Event acting on its own...

Basicly we need more before we can help. :smile:
 
conditional branch:
scrn.bmp

write in the box:

Code:
$game_map.events[number].x == $game_map.events[number2].x

New conditional branch inside the first one:
Code:
$game_map.events[number].y == $game_map.events[number2].y

Exchange "number" with the ID of the first event and "number2" with the ID of the second event.

click at set move route:
scrn.bmp

then click cancel
 
That only works if the events go on top of each other. Try this:
Code:
if ($game_map.events[id].x - $game_map.events[other id].x).abs <= 1 and ($game_map.events[id].y - $game_map.events[other id].y).abs <= 1

Or if you don't want it to include diagonals:
Code:
if (($game_map.events[id].x - $game_map.events[other id].x).abs <= 1 and $game_map.events[id].y == $game_map.events[other id].y) or (($game_map.events[id].y - $game_map.events[other id].y).abs <= 1 and $game_map.events[id].x == $game_map.events[other id].x
 
Leadbelly you still haven't told us if your using XP or VX or really anything to be honest. I can help with events, its simple. But we just need more info. Tell us what your doing (or want to do). :smile:
 
im using rpg maker xp
and im this is what im trying to do:

in this one map your supposed to make this rock hit an NPC so you have to like aim it which i already have done.
But i dont know how to make it so that when two events touch something happens, you know ??

-REX! :barf:
 
Well if you want to do it with Events, like I said its simple. You should name the Rock Event, Rock.

First Part
Ok so this is the first thing you do. You need to make Two Variables. The first Varible is for the Rock's X tile and the second is for the Rock's Y tile. If you don't know how to do that, then I'll tell you. Go to the variables window. Pick the Variable you want, name it Rock's X. Then go down to the Operator Section and click on Set. This will make somethign be Equal to something else. That something else is the Rock's X tile. To set it equal to that, go down to the Operand Section. Click on Sprite, choose Rock and then X tile. Repeat this for the second Variable, call it Rock Y.

Second Part
Alright now what you need to do is make a condition branch (two actually). The first one reading the Rock's X, the second reading the Rock's Y. Find out what the NCP's X and Y's are. Thats easy when out of test play, click on the event once. Look down and to the right. It will tell you the X and Y of the event. Back to the Rock. Make the X and the Y conditional Branchs equal to the NCP's x and y. This way the game will know if the Rock's X and Y are the SAME as the NCP's X and Y. If that happens, THEN BOOM! SMASH! WHOA YOU SUNK MY BATTLE SHIP!

Last thing to look at
If you do everything right it should look like this.

Code:
Variable[Rock's X] = Rock X Tile

Variable[Rock's Y] = Rock Y Tile

Condition Branch: Variable[Rock's X] = (x)

Conditional Branch: Variable[Rock's Y] = (y)

Message: LOL GOTTCHA!

 

Else

 

End

 

Else

 

End

The (x) and the (y) are what ever the X and Y are for your NCP. Also if the NCP is moveing, and thats why you have to aim the rock...Then You'll have to make two Variables for the NCP's X and Y. But other than that, you wouldn't have to.

I really Hope I helped. I hope you got what you needed. Sounds like and interesting Situation you got going on. :biggrin:
 
Haha, sorry about that. if you need help ask. I can break it down farther. I'll try to get imagines if you need them. But I didn't before because my computer was being lame. Basicly your reading the location of the events and if they're at the same place as each other, then they're touching. Which would trigger what ever you want it to trigger. :cheers:
 
Thats wonderful! I'm glad! As a side note, you should edit this post's title to say Resolved. It's just helpful to do so after your helped. That way people know you were helped before they click on this topic to see if they could lend aid!! :toot: :cheers: :thumb: :smile: :grin: :biggrin: :shades:
 

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