Move Route And Event Touch???

Neo_Kum0rius_6000

Not Your Ordinary Guy!
Veteran
Joined
Nov 8, 2017
Messages
196
Reaction score
349
First Language
english
Primarily Uses
RMVXA
So I was making my game and you can hit a button to make the character dash using
a move route. the dash is supposed to be able to break blocks. Like I wan't to know if theres
a way to activate a if "touching event" trigger while the player is touching it in a move route...

NOTE: this event works if the player is just touching it using the keyboard...
 

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
You could activate a switch before the move route, then check if the switch is ON on your boulder event. If the switch is ON, break the boulder, else do nothing. Make sure you turn off the Switch at the end of the route.
 

Neo_Kum0rius_6000

Not Your Ordinary Guy!
Veteran
Joined
Nov 8, 2017
Messages
196
Reaction score
349
First Language
english
Primarily Uses
RMVXA
You could activate a switch before the move route, then check if the switch is ON on your boulder event. If the switch is ON, break the boulder, else do nothing. Make sure you turn off the Switch at the end of the route.
I already did that, it checks with a switch and touching player...
but my player just stops when it dashes into the bolder using a move route...
 

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 of course it would because your block is not passable, I thought your problem was that it always activates instead of just when using the move route because of your note...

One way to go around this is instead of the touch event being in the boulder itself, put it one tile away from the boulder, then break the boulder from that event
 

Neo_Kum0rius_6000

Not Your Ordinary Guy!
Veteran
Joined
Nov 8, 2017
Messages
196
Reaction score
349
First Language
english
Primarily Uses
RMVXA
Well of course it would because your block is not passable, I thought your problem was that it always activates instead of just when using the move route because of your note...

One way to go around this is instead of the touch event being in the boulder itself, put it one tile away from the boulder, then break the boulder from that event
That dosn't work either what I'am trying to do here.
The player can hit a button then it dashes you down via moveroute.
when you dash you break the bolder the problem is the touching event
won't register if the player moves with a move route...
 

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
If putting it one tile away doesnt work, you could also opt to have a parallel process checking the position of the player itself that runs when the switch is ON.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Event triggers do not work when the player runs into an event due to a move route.

You would need to have a script mod to do the same check during a move route that is done when the player uses the keyboard, or as above, use a parallel process that's active while the player is dashing, that checks the player's and event's position.

If you want the first option (script mod), post a thread in the RGSS3 Script Requests forum. But you'll need to state what should happen with the move route if the event triggers - does it pause while the event is running? - does the player continue to move? - what if the event does a Set Move Route on the player (there can only be one move route, so it would have to be ignored, or would have to overwrite the in-progress move route which would then be lost and could not continue).
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
If you do not want to go the script way you can fake a player touch using regions. If you use a different region ID for the tile before the boulder you can have a parallel process event break the boulder when the player steps in a tile with the said region ID.

This does not use any player touch but it works in a similar way. Another way to do it is to use a second event page for the boulder that activates once you turn on the switch and just compare player coordinates with event coordinates using a parallel process event. It goes without saying that the boulder page should have ''through'' on while your parallel process should also activate only when the said switch is on.

The first method breaks the boulder as soon as the player steps close to it so you should use some sort of animation or it will look weird, the second one breaks the boulder as soon as the player steps on it and it is more like a player touch.
 

Neo_Kum0rius_6000

Not Your Ordinary Guy!
Veteran
Joined
Nov 8, 2017
Messages
196
Reaction score
349
First Language
english
Primarily Uses
RMVXA
Event triggers do not work when the player runs into an event due to a move route.

You would need to have a script mod to do the same check during a move route that is done when the player uses the keyboard, or as above, use a parallel process that's active while the player is dashing, that checks the player's and event's position.

If you want the first option (script mod), post a thread in the RGSS3 Script Requests forum. But you'll need to state what should happen with the move route if the event triggers - does it pause while the event is running? - does the player continue to move? - what if the event does a Set Move Route on the player (there can only be one move route, so it would have to be ignored, or would have to overwrite the in-progress move route which would then be lost and could not continue).
I've given up posting on the script boards... Everytime I post something I rarely get a response,
well I guess I'll try...
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
I've given up posting on the script boards... Everytime I post something I rarely get a response,
well I guess I'll try...
You can always use the parallel process option I wrote above. If you write it properly it should be no different than a player touch.
 

Neo_Kum0rius_6000

Not Your Ordinary Guy!
Veteran
Joined
Nov 8, 2017
Messages
196
Reaction score
349
First Language
english
Primarily Uses
RMVXA
You can always use the parallel process option I wrote above. If you write it properly it should be no different than a player touch.
Lemme try to use this could you make me a demo
or something or take a picture for an example
thanks... Edit: Oh I figured this out
it works but its really tedious...
I also have to use a new region for every boulder...
 
Last edited:

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
If you use a different region with the same id as the boulder event ID it should not be that tedious. That makes things extremely fast and you can just do this:
Code:
$game_self_switches[[$game_map.map_id, $game_player.region_id, 'A']] = true if ($game_player.region_id > 0)
To me it does not look tedious at all.

EDIT:
If it does not fit in your script box just change it like this:
Code:
if ($game_player.region_id > 0)
  $game_self_switches[[$game_map.map_id, $game_player.region_id, 'A']] = true
end

EDIT 2:
As a side note if you do it that way you do not even need to put commands in your boulder second page, just using the common event should be enough to remove your boulders if the second page has "Self Switch A is ON" as a condition and has no graphic.

Of course if you want to add a small animation then you have to put something in that page but otherwise it is safe to have it blank.

EDIT 3:
If you cannot afford to have every tile in your map with region 0 because you have to spawn different enemies based on the region itself then you have to use a less efficient way (but still not tedious at all).

Code:
$game_map.events.each do |e|
  $game_self_switches[[$game_map.map_id, e.event_id, 'A']] = true if (e.region_id == $game_player.region_id)
end
This one just checks each event region ID to see if it is the same as player region id. Note: this checks each single event. While the other option only changes the self switch of the event with same ID as region ID.

Long story short: the other option does one check and a single operation each time, this one does N checks where N is the number of events in your map (not just boulders).
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,975
Members
137,563
Latest member
cexojow
Top