How to make two events touching activate a switch?

Status
Not open for further replies.

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
73
Reaction score
4
First Language
English
Primarily Uses
RMVXA
This is what I'm trying to make happen:

I have two events, one called "Rock" and the other called "Button", I have made it so that the player can push the rock around. But what I want to happen is for the rock to be able to go on top of the "Button" and then activate a switch. But I cannot figure out how to do this. I have looked it up so many times on the internet but I can't find a tutorial that makes any sense.

Basically, I want to do what this guy's trying to do: http://www.rpgmakervxace.net/topic/12266-help-using-an-event-to-trigger-another-event/

However, the people who responded to that thread don't make any sense to me.

Please help.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
there is no default trigger for events touching each other, you'll have to do it in another way.

For example, you can check the coordinates in event that controls the movement of the rock - if he is on the coordinates with a tile where the button is places, then switch.

This will work because you will not check for another event, but for coordinates.

If your game is too variable and contains too much random positions, then you'll need a script to add more trigger types that don't exist in default.

The are a very few scripts that do this, but I don't know if there is a script that adds event-to-event triggers, you'll have to check the master script list yourself for them.
 

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
73
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Unfortunately that won't work because my game has a lot of randomly placed switches, but thanks anyway.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
define randomly placed? you mean they are automatically placed in random position and does not exist in the map while editing? or they are already in the map during editing and you simple relocate them randomly?

if it's the 2nd, you can still do the position check method... just have two sets of X,Y variables one will be used to store the coordinates of the rock, and the other will store the coordinates of the switches (you check them 1 by 1, so you only need 1 set for them)
 

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
73
Reaction score
4
First Language
English
Primarily Uses
RMVXA
By randomly placed I mean they are already in the map while editing and you can move any of the rocks onto them. If I used the position check method how would I change the picture of the switch to be looking pressed down?

Also, what is the position check method and how do I use it? I can't find it under conditional branch.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
Also, what is the position check method and how do I use it? I can't find it under conditional branch.
A lot of the more advanced checks require a combination of two commands:

1) control variable to get the selected game data stored into a variable of your choice

2) conditional branch to check the new content of the variable.

As for your changing sprite, there are two options:

1) use a general switch and condition the event of the button to that switch (changing sprite when condition switch is ON)

2) use move route command to change the sprite of the button event with a command placed in the rock command
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
position check: basically you check if the position of 1 object is the same as the position of another object...


In RM we do it via saving the X and Y coordinates of the two objects into variables (1 variable for each coordinate, so we need foursince we have two X coordinates and 2 Y coordinates (1 pair for each object)), then compare them to see if the positions collide
 

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
73
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Thank you both for helping me but I'm struggling to understand this.

So what I need to do is set up four variables with each of the positions in them. In my game the rock is at position 006,007 and the button is at position 0010,007. So I have to set up variables with the positions 6x, 7y and 10x. How do I do that? I can't find the option for that in the variables.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
to get each coordinate:


Choose Control Variables


Make sure the setting is on SET


Choose Game Data


Choose Character


Find the event on the drop down list


On the next drop down choose Map X/Y


Basically, you'll do this 4 times


1 for the rock's X


1 for the rock's Y


1 for the button's X


1 for the button's Y


then if you want to check other buttons during the same event, you simply need to set the variables for the button, no need to redo the one for the rock
 
Last edited by a moderator:

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
73
Reaction score
4
First Language
English
Primarily Uses
RMVXA
I set up two four variables. I have "Rock's Map X" and "Rock's Map Y" and "Button's Map X" and "Button's Map Y". In the Button event I made two conditional branches, one that says "Rocks map x" must be equal to "buttons map x" and the other conditional branch says "rocks map y" must be equal to "buttons map y." Then I set for the switch to happen. But this doesn't work. The switch is already activated before the rock even moves. What am I doing wrong?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Show us the event...


You do the settings of the variable in a parallel process event or do it when you move the rock...
 
Last edited by a moderator:

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
73
Reaction score
4
First Language
English
Primarily Uses
RMVXA
This is what I've got inside the Button event. What changes to I need to make?

(Also, I renamed "Button" Switch and "Rock" "Ball"

 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
We need to see where you set those variables too
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I already outlined a few posts back how to set them to the correct values and as I said, do it on a parallel process event... NAMING A VARIABLE DOESN'T PUT A VALUE ON IT... that's why your button becomes pushed already, because all those variables are equal to 0...

If you don't even know how to set variables, you should really read beginner tutorials first and practice the simpler things that the maker can do instead of these things...
 
Last edited by a moderator:

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
73
Reaction score
4
First Language
English
Primarily Uses
RMVXA
I already outlined a few posts back how to set them to the correct values... NAMING A VARIABLE DOESN'T PUT A VALUE ON IT...

If you don't even know how to set variables, you should really read beginner tutorials first and practice the simpler things that the maker can do instead of these things...
I know how to do most of the more advanced stuff but I just don't know variables because I've never used them before. I did set a value but I only set the value to x and y. So for example, "Balls Map X" I just set the value to map x. Do I need to put a specific number like 007,010? If so, how can I do that?

Sorry, I'm just not very good at understanding these things.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
As I said, show me the event where you set those values... We're not psychics here, we cannot know what you have done unless you show it...
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Well yeah, that's faster... but really, he should learn how to use variables...


anyway, the choice is yours... XD
 
Last edited by a moderator:

DeyJay5

Veteran
Veteran
Joined
Oct 28, 2013
Messages
73
Reaction score
4
First Language
English
Primarily Uses
RMVXA
This is a picture of the Ball Map X variable:



Is it missing something? Am I supposed to add numbers in?
 
Status
Not open for further replies.

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