Switch to next event page when the player presses the action button (like an action button trigger)?

Status
Not open for further replies.

Zain98

Villager
Member
Joined
May 24, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
I have an event with its trigger set to 'parallel process'. I want to switch to the next event page when the player presses the action button. For this, I need to determine the character's coordinates and whether he is facing the event. So yes, I need this to function just like an 'action button' trigger. How can I do that?
 
Last edited by a moderator:

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,158
First Language
English
Primarily Uses
N/A
How about having this event be separate from the one you want the player to click ("action button"), and instead make the clickable one set a switch to on, and then use that as the requirement for the second page in the parallel process event?
 

Zain98

Villager
Member
Joined
May 24, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
No that won't do unless I can place two events on top of each other (if possible?).

My event represents a lantern. The first part processes a glowing effect which is not possible without the trigger set to 'parallel process'. I want to switch to the next event page when 3 requirements are met:

  • the character has pressed the action button,
  • he is facing the event, and
  • he is right next to the event.
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Is the 'glowing' part of a spriteset? The graphics, I mean? If so, you do not need to set it to parallel process at all, simply check 'stepping animation ON' at the lower left corner.
 

Zain98

Villager
Member
Joined
May 24, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
It does use a spriteset however the glowing effect is processed by a script. The graphic of the event is a lantern. Removing the parallel process trigger will not show the glowing effect. (btw I am using Victor's Lighting Engine)
 

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,158
First Language
English
Primarily Uses
N/A
I'm not sure you need this for Victor's Lighting Engine, but there is a way to do what you want – and overlap two events. I made four images to show the two events:

The first page of the button trigger event that will overlap the lantern (your other, parallel process event) is crucial. You'll need to place this one tile above the other event in the editor:

  • We set Through to On so it can pass through the other solid event
  • We set Speed to highest, so it will move almost immediately
  • We create a parallel process move route event that moves it one tile down, and afterwards turn self switch A to On, so it can switch to its second page.



This second page does whatever you want to happen when you touch and interact with the lantern:



I also included sample lantern pages in case you needed a pointer on using the switch:



 

Zain98

Villager
Member
Joined
May 24, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
I will test this and let you know soon. Thanks for the help.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I don't think that'll work. The first event will move down the first time you enter the map. But when you leave the map and return, it will be back in its original position, and since the self switch is now on, it won't move down again.
 

Zain98

Villager
Member
Joined
May 24, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
I don't think that'll work. The first event will move down the first time you enter the map. But when you leave the map and return, it will be back in its original position, and since the self switch is now on, it won't move down again.
Yes that did happen, thanks for pointing it out. Instead, I figured out a way to manually place those glowing effects as mentioned in the instructions. So yes, my problem is solved.

However, it seems my question remains unanswered. Let it be the use of variables or a script, I asked for a way to deduce whether the player is facing an event, standing right next to it and pressing the action button. Is that even possible? Please let me know because this may help me in the future. Thanks again for all the support.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You can find out what's on the tile the player is facing by doing this:


Control Variables [0001: facing x] = Script: $game_map.round_x_with_direction($game_player.x, $game_player.direction)


Control Variables [0002: facing y] = Script: $game_map.round_y_with_direction($game_player.y, $game_player.direction)


Control Variables [0003: event on facing tile] = Script: $game_map.event_id_xy($game_variables[1], $game_variables[2])


That will give you 0 if there is no event on the tile in front of the player. If there IS an event on the tile in front of the player, it gives you the event id. So if your EV012 is in front of the player, variable 3 will be 12 (even if you've renamed the event).


And there's already a conditional branch to detect whether the action button (C button) is being pressed. So you'd do that first (because there's no point in setting all those variables every frame, if the player is not pressing the button), then set the variables above, then check if variable 3 is the number of the event you're interested in.
 

Zain98

Villager
Member
Joined
May 24, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
Much appreciated, Shaz! You may close this thread now.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
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,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top