Tile Passable Only by Dashing?

Discussion in 'RPG Maker MV' started by MechScapeZH, Oct 22, 2019.

  1. MechScapeZH

    MechScapeZH Veteran Veteran

    Messages:
    268
    Likes Received:
    245
    First Language:
    English
    Primarily Uses:
    RMMV
    Hello,

    I have a bit of an unusual question- I want to make a tile that is passable only when the player is dashing. Is there any way to do this?

    Thank you in advance for your help.
     
    #1
  2. gambitben

    gambitben Veteran Veteran

    Messages:
    135
    Likes Received:
    97
    First Language:
    Spanish English
    Primarily Uses:
    RMMV
    Well, I do have a simple plugin free trick; the only downside it has is using too many instances of it might slow the game down on that particular map, but it should work if used sparsely.

    I'm assuming you are using the shift key to dash.

    Create an event, set it to same as character priority and make it parallel. Put this in the first page:

    ◆Wait:5 frames
    ◆If:Button [Shift] is pressed down
    ◆Control Self Switch:A = ON

    :End

    Now for the second page. Check self switch A, make it parallel too and set the priority to below characters. Put this in it:

    ◆Wait:5 frames
    ◆If:Button [Shift] is pressed down

    :Else
    ◆Control Self Switch:A = OFF

    :End

    As long as the player is dashing with the shift key they'll be able to cross. As soon as they stop dashing, invisible wall! Hope it helps, I'm sure that this could be cleaner with some script usage but it's perfectly functional as it is.
     
    #2
    MechScapeZH and Aloe Guvner like this.
  3. MechScapeZH

    MechScapeZH Veteran Veteran

    Messages:
    268
    Likes Received:
    245
    First Language:
    English
    Primarily Uses:
    RMMV
    This works phenomenally- thank you so much! I never would have thought of it.

    I experimented with the code- is it possible for the player to be transferred to a specific spot on the map rather than being stopped? When I try to add a transfer event after the turning off of Self Switch A, the player is transferred even if they cleared the tiles. I should have been more clear- I'm using this as a Mega Man X- esque air dash system. The player pushes a button and moves in a certain direction, bypassing certain obstacles. If they were to release the button early, what's to stop them from just pushing it again? I was hoping to have them transferred back to where they started.

    Is this possible? If not, I'll deal with it- you have been tremendously helpful already. Thank you- I've added your name to my game's credits. :)
     
    #3
    gambitben likes this.
  4. Aesica

    Aesica undefined Veteran

    Messages:
    845
    Likes Received:
    812
    Location:
    SW5GMW 4xVHk
    First Language:
    English
    Primarily Uses:
    RMMV
    I get the feeling that might not work with controllers, and it definitely won't work if the player has the option to enable auto-dash.

    You can use
    Code:
    $gamePlayer.isDashing()
    to determine whether a player is dashing or not, so try that in your conditional instead of the shift check
     
    #4
    caethyril, gambitben and MechScapeZH like this.
  5. MechScapeZH

    MechScapeZH Veteran Veteran

    Messages:
    268
    Likes Received:
    245
    First Language:
    English
    Primarily Uses:
    RMMV
    This works even better- thank you so much. There's only one thing- if the player dashes, then stops on a tile, they're able to stay on the tile.

    If I limit the number of dashes the player is allowed to do per unit of time, this could be used to essentially cheat. Wait for their dash to recharge and continue. Is there a fix for that.

    I'd add you to my credits as well, but you're already in them. :guffaw: Thank you for your continued help. :)
     
    #5
    gambitben and Aesica like this.
  6. Aesica

    Aesica undefined Veteran

    Messages:
    845
    Likes Received:
    812
    Location:
    SW5GMW 4xVHk
    First Language:
    English
    Primarily Uses:
    RMMV
    You could always add something to the parallel process event that checks for whatever region the player is standing on, and if it's a certain number (whatever you paint over the dash-only tiles) they could be teleported back once isDashing turns up false.
     
    #6
    MechScapeZH likes this.
  7. MechScapeZH

    MechScapeZH Veteran Veteran

    Messages:
    268
    Likes Received:
    245
    First Language:
    English
    Primarily Uses:
    RMMV
    I...didn't actually have it in a parallel process with Region IDs. I had it in an event touch. That was... a mistake I should not have made, considering I have done collisions before.

    Thank you, that worked perfectly!
     
    #7
    Aesica likes this.
  8. gambitben

    gambitben Veteran Veteran

    Messages:
    135
    Likes Received:
    97
    First Language:
    Spanish English
    Primarily Uses:
    RMMV
    @Aesica comes through as always :kaojoy:
    I knew there was going to be a script solution, I'm not very good with code and never know how to reference them :rswt

    Glad my thingy worked and I have to check mechscape, it looks extremely cool. Best of luck with it!
     
    #8
    MechScapeZH and Aesica like this.
  9. MechScapeZH

    MechScapeZH Veteran Veteran

    Messages:
    268
    Likes Received:
    245
    First Language:
    English
    Primarily Uses:
    RMMV
    It worked perfectly, thank you! The functionality just didn't fit what I wanted to do- it was my fault that I wasn't clear enough. I still feel like I might use your "wall" code for another obstacle- as I said, I've added you to the credits.

    Thank you for the well wishes! I'm glad my game looks interesting. :)
     
    #9
    Aesica and gambitben like this.

Share This Page