Kirri

Imagining Things
Veteran
Joined
Dec 14, 2019
Messages
103
Reaction score
272
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
45,453
Reaction score
16,374
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
103
Reaction score
272
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
4,663
Reaction score
1,315
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
45,453
Reaction score
16,374
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
4,663
Reaction score
1,315
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

I am supposed to be preparing to teach my students this afternoon and tomorrow morning about Refugees, Asylees, and Fraud/Misrepresentation and all I can think about is how to improve my Turn Order display. :stickytongue:
Try changing POV battle, near and far away like suikoden...
watercave2.jpg

diablofar.jpg

In the end I choose near over shoulder resembles RE4. Tight close window better. The correlation between battleback, monster style and battler should also be observed and merged.
Upgraded my avatar to be cuter.
When you look for several things for ages and then suddenly find it all at once.

Status.png
Status2.png
equip.png
I'm going to see if I can set up a triple booting setup. Windows for standard use & gaming, debian for linux development and manjaro for linux gaming, wine & proton use.

Forum statistics

Threads
129,703
Messages
1,204,424
Members
170,769
Latest member
ghostyen
Top