Kirri

Imagining Things
Veteran
Joined
Dec 14, 2019
Messages
96
Reaction score
204
First Language
Malay
Primarily Uses
RMVXA
Hello there,
Is it possible to make it so that when the player dashes, it can go through event BUT cannot go through impassable tile?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,646
Reaction score
15,730
First Language
English
Primarily Uses
RMMV
ALL events? What about events that have a sprite from the tileset?
 

Kirri

Imagining Things
Veteran
Joined
Dec 14, 2019
Messages
96
Reaction score
204
First Language
Malay
Primarily Uses
RMVXA
ALL events? What about events that have a sprite from the tileset?
Hmm... yea, I want it to not pass through those kinds of events too if possible.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,513
Reaction score
848
First Language
English
Primarily Uses
RMVXA
Try this. Thoughts @Shaz ?
Ruby:
class Game_Player < Game_Character
  def passable?(x, y, d)
    x2 = $game_map.round_x_with_direction(x, d)
    y2 = $game_map.round_y_with_direction(y, d)
    return false unless $game_map.valid?(x2, y2)
    return true if @through || debug_through?
    id = $game_map.event_id_xy(x2,y2)
    evpass = false
    if id != 0
      evpass = $game_map.events[id].tile_id == 0 ? true : false
    end
    return true if dash? && evpass && $game_map.passable?(x2, y2, d)
    return false unless map_passable?(x, y, d)
    return false unless map_passable?(x2, y2, reverse_dir(d))
    return false if collide_with_characters?(x2, y2)
    return true
  end
end
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,646
Reaction score
15,730
First Language
English
Primarily Uses
RMMV
I think putting this in Game_CharacterBase might allow events to go through other events if the player is dashing?

Would also have to cater for the possibility of an event (without a tile sprite) being on an impassable tile. Maybe put the dash test below the two map_passable tests?

Everything else seems good, but I'm a bit tired atm to follow it all properly.

Also, no need to define events in Game_Map because there's already an attr_reader for it in the class.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,513
Reaction score
848
First Language
English
Primarily Uses
RMVXA
Good point, I didn't think about the parent tree. I usually end up placing things where they were originally found until I clue in.
It was weird because through my tests to get this whenever I mentioned $game_map.events[id].tile_id it gave me a no method error on tile_id for nil, nil class. But now it works fine. Must have been the way I originally had it before getting to this solution.

You're right about the event on an impassible tile. The player steps into the tile, then can't move.
*Fixed
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

ZyCHqk2.png

Something about top-downs.
I have never felt so attacked by a tree before :LZSlol: it took 10++ hours to make but at least it looks pretty LOL

Untitled-1.png
now seems like the worst time for me to need a better computer with how much stuff is costing. that and I don't thing there's much else I can do to make MV run any better with what I have.
Sigh... to have some variety in this weather. More than just sun and rain and wind and thunder.
In the meantime, I've discovered that I'm slowly becoming fatigued from the many sleepless nights my neighbors cause. Or at least their dogs. Always barking at something.
I might need a day to just sleep and recharge.

Forum statistics

Threads
118,452
Messages
1,116,087
Members
155,430
Latest member
rozc
Top