class Scene_Map
attr_accessor :spriteset
end
class Spriteset_Map
create_character_sprite(character)
@character_sprites.push(Sprite_Character.new(character))
end
end
class Game_Map
clone_event(event_id)
return 0 if @events.size == 0 || @events[event_id] == nil
id = @events.keys.max
@events[id] = @events[event_id]
$scene.spriteset.create_character_sprite(@events[id])
@need_refresh = true
return id
end
end
If you use this script, you should be able to clone an event using this:
$game_map.clone_event(ID)
The method will return the ID of the new event or 0 if it wasn't created. The argument passed onto the method is the ID of the event that you want to clone. I haven't tested this, but it should work.
Creating an event is more complicated.
Events can be directly moved by using this code:
$game_map.events[ID].moveto(X, Y)
ID is the event ID, X and Y are the coordinates. Keep in mind that events created like this don't appear in the map editor.
If it a predefined event, though, you can just use the "Change Event Location" event command.
If you want to access variables via script use this: