I wrote the following script to show an animation 'out of thin air', i.e. without having a supporting Event:
Alas, when it is called, nothing happens. But when I exit the scene and te-enter it (by, say, calling the game menu scene), THEN, the animation take effect...
What object do I have to update, or something.
Errr... please... do not answer $scene.update, because the script is called from the $game_player.check_event_trigger_there, and it could cause an infinite loop.
Unless I call it from somewhere else. The idea is to show the animatiion when the action button is pressed and no Event is triggered.
Thanks all...
Code:
def do_anim( x, y, id)
e = RPG::Event::new( x, y) # create a base RPG::Event
e.id = $game_map.events.size # set ID > last of the map event list
c = Game_Event.new( $game_map.map_id, e) # create the event
$game_map.events[ e.id] = c # push the event in the map event list
c.animation_id = id # try and play the animation
$game_map.events[ e.id].erase # dispose of the event in the map list
end
Alas, when it is called, nothing happens. But when I exit the scene and te-enter it (by, say, calling the game menu scene), THEN, the animation take effect...
What object do I have to update, or something.
Errr... please... do not answer $scene.update, because the script is called from the $game_player.check_event_trigger_there, and it could cause an infinite loop.
Unless I call it from somewhere else. The idea is to show the animatiion when the action button is pressed and no Event is triggered.
Thanks all...