At certain times in my game, I want the player to be able to "ghost" - that is, move through other events on the map, but not to be able to walk onto impassible tiles. The other events move around, so I can't simply set them all to Through for the duration of the player's "ghosting", or they will move through the impassible tiles.
Is there any reasonably easy way to do this, or will I need to look into the Character/Base scripts and extend the way that character movement separately checks for tile passability versus event passability (where a new "ghost" property of the character would ignore the event passability checks)?
Thank you for any help you can offer me!!
It's a fairly simple script to make.
I'm going to sleep now, but I can write it for you tomorrow.
If you know how to modify the script, yes, adding a switch check on the passability check will work.
So when the ghost switch is on, the player should be able to walk through events but not tiles.
This might proves to the be easiest way.
If you wish to do it without modifying the scripts. You will need to go for the complicated way.
[1] Edit all events like you suggested, but instead of having the events set to Through, set them to be "Below" or "Above" the character. Have the events check for the switch to turn between 2 modes. So all you need is to copy the event page inside the existing events and do minimum changes.
[2] Set up an event to turn the player into Through by using Route, and have a parallel event to check where the player's X, Y is, and move him/her back if he/she's stepping on unwanted tile.
Hudell, MeowFace, thank you so much for the information. With your assurances that this would be fairly easy to do, I went back into Game_CharacterBase and aliased the collide_with_characters? method (which is probably just one of several ways to successfully create this "ghost" logic) after adding a @ghost attribute to the class.
Seems to work exactly as I intended. Ghosting allows a character to move through other events, but not impassable terrain, and (with some exceptions based on Priority) allows you to interact with Action Button/Touch events while ghosted.
#-------------------------------------------------------------------------- # * Detect Collision with Character #-------------------------------------------------------------------------- alias :ghostly_collision :collide_with_characters? def collide_with_characters?(x, y) # If Ghost Mode is activated, cannot collide with characters if @ghost collision = false # Otherwise, reference the standard "collide_with_characters?" method else collision = ghostly_collision(x, y) end return collision endMeowFace - your first event-based solution is very clever as well! It turns out that it was even easier for me to script, but if someone doesn't want to mess with the existing code, that's a very smart way to do it... wish I would have thought of it myself!
Hudell - I really appreciate the offer to write it for me. It was very generous of you and I'm glad I don't have to trouble you for it. 🙂