The code below triggers&works perfectly when the player starts out on that map. But when the player is transferred to that map then it doesn't work:
The code below does nothing at all:
The nap_ev_text_commenttag() is using the following code for retrieving the Character_Sprite that belongs to the given event_id:
I don't understand where I have to call this line (from an alias):
$game_map.events.each{ |ev| ev[1].nap_ev_text_commenttag } # array note: [0] = id, [1] = eventGame_Event.setup_page_settings already calls that nap_ev_text_commenttag (which works perfectly when the event-page is switched). But the first time nap_ev_text_commenttag() is called on an event the SpriteSet is not initialized for the new map yet. Resulting in nil values or values from the previous map.
Hope this makes sense.
class Scene_Base alias nap_ev_text_post_start post_start def post_start $game_map.events.each{ |ev| ev[1].nap_ev_text_commenttag } # array note: [0] = id, [1] = event nap_ev_text_post_start endend
class Scene_Map alias nap_ev_text_post_transfer post_transfer def post_transfer $game_map.events.each{ |ev| ev[1].nap_ev_text_commenttag } # array note: [0] = id, [1] = event nap_ev_text_post_transfer endend
class Scene_Map < Scene_Base attr_reader :spritesetendclass Spriteset_Map attr_reader :character_spritesendmodule Nap def self.get_character_sprite(ev_id) return nil if !SceneManager.scene.is_a?(Scene_Map) || !SceneManager.scene.spriteset SceneManager.scene.spriteset.character_sprites.each{|cs| return cs if cs.character.id == ev_id } return nil endend
I don't understand where I have to call this line (from an alias):
$game_map.events.each{ |ev| ev[1].nap_ev_text_commenttag } # array note: [0] = id, [1] = eventGame_Event.setup_page_settings already calls that nap_ev_text_commenttag (which works perfectly when the event-page is switched). But the first time nap_ev_text_commenttag() is called on an event the SpriteSet is not initialized for the new map yet. Resulting in nil values or values from the previous map.
Hope this makes sense.