I have an interesting problem. I have managed to add events through RGSS using the following code
Now I wish to do the opposite and remove events from the game map using RGSS. I have taken the straightforward approach and used the line $game_map.events.delete(index). This remove the event but not the corresponding sprite. I suppose I could set the event sprite to a blank before erasing the event, but is their a more thorough way to remove the event sprite?
Thanks for the help.
Code:
ev = RPG::Event.new(x, y)
ev.id = $game_map.events.size + 1
ev.pages = []
# Create a game event object using map id and ev value
event = Game_Event.new($game_map.map_id, ev)
event.through = false
# Set the event at ev.id to our event (include it in map)
$game_map.events[ev.id] = event
@index = ev.id
#$event_instance[ev.id] = event
#$game_map.map.events.keys.push(@index)
$game_map.map.events[@index] = ev
#print $game_map.events
# Map needs to be redrawn because a new event was added
$game_map.need_refresh = true
$scene.spriteset.add_additional_sprites
Now I wish to do the opposite and remove events from the game map using RGSS. I have taken the straightforward approach and used the line $game_map.events.delete(index). This remove the event but not the corresponding sprite. I suppose I could set the event sprite to a blank before erasing the event, but is their a more thorough way to remove the event sprite?
Thanks for the help.