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,647
Reaction score
15,736
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,535
Reaction score
854
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,647
Reaction score
15,736
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,535
Reaction score
854
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

Awright ya marshmallows! :kaopride: Here's a peek of what Alice's 8-bit Gothic gonna be like! EXPECT IT! (...in 2025?) :kaoswt:

alice_gothictiles.png
SF_People3_4 added!
index.php

Finds notes for an old side project... Oh, that's right, the two tracks that sounded really cool and gave inspiration for the big bad in that game... Spends day working on cutscene from old notes, looks okay, now lets slot in the first track... um... I did have those tracks??? It was a year or so ago but I did buy them didn't I?
CA9mtHJ.gif

Everything is really confusing for me

Forum statistics

Threads
118,592
Messages
1,117,163
Members
155,658
Latest member
CarloFourQuattro
Top