Move Route And Event Touch???

Discussion in 'RPG Maker VX Ace' started by Neo_Kum0rius_6000, Feb 21, 2019.

  1. Neo_Kum0rius_6000

    Neo_Kum0rius_6000 Not Your Ordinary Guy! Veteran

    Messages:
    181
    Likes Received:
    341
    Location:
    Russia
    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...
     
    #1
  2. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,471
    Likes Received:
    2,862
    Location:
    Philippines
    First Language:
    Tagalog
    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.
     
    #2
  3. Neo_Kum0rius_6000

    Neo_Kum0rius_6000 Not Your Ordinary Guy! Veteran

    Messages:
    181
    Likes Received:
    341
    Location:
    Russia
    First Language:
    english
    Primarily Uses:
    RMVXA
    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...
     
    #3
  4. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,471
    Likes Received:
    2,862
    Location:
    Philippines
    First Language:
    Tagalog
    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
     
    #4
  5. Neo_Kum0rius_6000

    Neo_Kum0rius_6000 Not Your Ordinary Guy! Veteran

    Messages:
    181
    Likes Received:
    341
    Location:
    Russia
    First Language:
    english
    Primarily Uses:
    RMVXA
    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...
     
    #5
  6. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,471
    Likes Received:
    2,862
    Location:
    Philippines
    First Language:
    Tagalog
    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.
     
    #6
  7. Shaz

    Shaz Veteran Veteran

    Messages:
    37,552
    Likes Received:
    11,260
    Location:
    Australia
    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).
     
    #7
  8. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,197
    Likes Received:
    465
    Location:
    Italy
    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.
     
    #8
    Shaz likes this.
  9. Neo_Kum0rius_6000

    Neo_Kum0rius_6000 Not Your Ordinary Guy! Veteran

    Messages:
    181
    Likes Received:
    341
    Location:
    Russia
    First Language:
    english
    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...
     
    #9
  10. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,197
    Likes Received:
    465
    Location:
    Italy
    First Language:
    Italian
    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.
     
    #10
  11. Neo_Kum0rius_6000

    Neo_Kum0rius_6000 Not Your Ordinary Guy! Veteran

    Messages:
    181
    Likes Received:
    341
    Location:
    Russia
    First Language:
    english
    Primarily Uses:
    RMVXA
    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: Feb 22, 2019
    #11
  12. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,197
    Likes Received:
    465
    Location:
    Italy
    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: Feb 22, 2019
    #12

Share This Page