First of all , show more respect and delete this infamous icon asap or i use the "alert the moderator" button .
Well , you're lucky , i have already made a small script like that :
class Game_Actors
def clone(actor_id_orig,actor_id_dest)
@data[actor_id_dest] = Game_Actor.new(actor_id_dest,actor_id_orig)
end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :actor_model_id # accessory ID
#--------------------------------------------------------------------------
# * Object Initialization
# actor_id : actor ID
#--------------------------------------------------------------------------
def initialize(actor_id,actor_model_id=nil)
super()
setup(actor_id,actor_model_id)
@last_skill_id = 0
# p actor_model_id if actor_id == 10
end
def setup(actor_id,actor_model_id=nil)
@actor_model_id = actor_model_id if @actor_model_id == nil
@actor_id = actor_id
actor = $data_actors[actor_id]
actor = $data_actors[@actor_model_id] if @actor_model_id != nil
@name = actor.name
@character_name = actor.character_name
@character_index = actor.character_index
@face_name = actor.face_name
@face_index = actor.face_index
@class_id = actor.class_id
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
@level = actor.initial_level
@exp_list = Array.new(101)
make_exp_list
@exp = @exp_list[@level]
@skills = []
for i in self.class.learnings
learn_skill(i.skill_id) if i.level <= @level
end
clear_extra_values
recover_all
end
#--------------------------------------------------------------------------
# * Get Actor Object
#--------------------------------------------------------------------------
def actor
return $data_actors[@actor_model_id] if @actor_model_id != nil
return $data_actors[@actor_id]
end
end
In an event , use :
Call script : $game_actors.clone(1,10)
And the actor 1 will be duplicated in the actor 10 .
After that , if you add the actor 10 to your team , you will have 2 ralph (of course , it is 2 different ralph with their own level and equipment) .
By using variables and common event , you can make all that you need , i think .
for exemple , to duplicate the actor in variable 1 to the actor in variable 2 :
$game_actors.clone($game_variables[1],$game_variables[2])
Bit of a hack, but it works well enough.
In dricc's script, add the following to Class Game_Actors (top if his script) somewhere:
attr_reader :data
Without it, $game_actors doesn't want to give away too much about the @data variable which holds all the actors - that information is private - but this allows us to read the data and find out what we need to know (we cannot write to it from outside the class so it's safe.)
Anyway, to get this next slot put:
$game_variables[x] = $game_actors.data.size
replacing 'x' with the variable id you want this information to be stored in (be sure to reserve this variable only for this information or you'll have some funny things happen in your game). This bit goes in the Advanced -> Script... option of an event or common event somewhere, not in the Script database section.
Then when you want to clone an idea and drop this actor into the next free space, you can put:
$game_actors.clone(actor_id, $game_variables[x])
Where the 'x' is replaced by the id of that variable you made to keep track of the next free space. What you can do is put those two lines together in one event whenever you make a clone of an actor:
$game_variables[x] = $game_actors.data.size
$game_actors.clone(actor_id, $game_variables[x])
First line gets where the next free slot will be (because of the way arrays store data) and then clones the desired actor into this slot.
I did mess about with a few other ideas, but making @data readable seemed the easiest.
A more proper version .
Now , you can use the "Modify party : Add actor" option normally . If the actor is identified as a clonable one (a tag in the name) , you will have a clone instead of the model .
you can also open automatically the name window to give a new name .
# actor clones
# par dricc
# http://www.rpgmakervx-fr.com/
# USAGE :
# Utiliser "Modifier l'équipe : ajouter un membre" normallement
# Mais au lieu de l'acteur correspondant , ce sera un clone qui sera ajouté .
# Du coup , vous pouvez ajouter plusieurs fois le meme acteur .
# use "Modify party : Add actor" as usual
# But instead of the actor itself , it is a copy that will be added to your party
# Clone paramétrage : A vérifier avant usage !!
# Clone setup : check all these parameters before use !
module CLONE_SETUP
# If true , the player will be asked to rename the clone
RENAME_CLONE = true
# if rename_clone at true , what is the max size for the name ?
NAME_MAX_SIZE = 8
# starting index for cloned actors
ACTOR_CLONE_INDEX = 1000
# the pattern to add to the name in the DB . add / before and after exemple : /<Pokemon>/
# Note : if you put // , all actors will be cloned
ACTOR_CLONE_PATTERN = /<model>/
end
# end setup
# fin paramétrage
# CODE
class Game_Actors
attr_accessor :actor_clone_index
alias dricc_initialize initialize
def initialize
@actor_clone_index = CLONE_SETUP::ACTOR_CLONE_INDEX
dricc_initialize
end
def clone(actor_id_orig,actor_id_dest)
@data[actor_id_dest] = Game_Actor.new(actor_id_dest,actor_id_orig)
end
def chg_name(actor_id,new_name)
@data[actor_id].name = new_name
end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :actor_model_id # accessory ID
#--------------------------------------------------------------------------
# * Object Initialization
# actor_id : actor ID
#--------------------------------------------------------------------------
def initialize(actor_id,actor_model_id=nil)
super()
setup(actor_id,actor_model_id)
@last_skill_id = 0
end
def setup(actor_id,actor_model_id=nil)
@actor_model_id = actor_model_id if @actor_model_id == nil
@actor_id = actor_id
actor = $data_actors[actor_id]
actor = $data_actors[@actor_model_id] if @actor_model_id != nil
@name = actor.name
@character_name = actor.character_name
@character_index = actor.character_index
@face_name = actor.face_name
@face_index = actor.face_index
@class_id = actor.class_id
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
@level = actor.initial_level
@exp_list = Array.new(101)
make_exp_list
@exp = @exp_list[@level]
@skills = []
for i in self.class.learnings
learn_skill(i.skill_id) if i.level <= @level
end
clear_extra_values
recover_all
end
#--------------------------------------------------------------------------
# * Get Actor Object
#--------------------------------------------------------------------------
def actor
return $data_actors[@actor_model_id] if @actor_model_id != nil
return $data_actors[@actor_id]
end
end
class Game_Interpreter
#--------------------------------------------------------------------------
# * Change Party Member
#--------------------------------------------------------------------------
alias dricc_command_129 command_129
def command_129
actor = $game_actors[@params[0]]
pattern = actor.name =~ CLONE_SETUP::ACTOR_CLONE_PATTERN ? 0 : 1
if pattern == 0
temp_name = actor.name.gsub(CLONE_SETUP::ACTOR_CLONE_PATTERN) {nil}
if actor != nil
if @params[1] == 0 # Add
# no initialize case in this script
# if @params[2] == 1 # Initialize
$game_actors.clone(@params[0],$game_actors.actor_clone_index)
$game_actors.chg_name($game_actors.actor_clone_index,temp_name)
#$game_actors[@params[0]].setup(@params[0])
# end
$game_party.add_actor($game_actors.actor_clone_index)
if CLONE_SETUP::RENAME_CLONE
$game_temp.next_scene = "name"
$game_temp.name_actor_id = $game_actors.actor_clone_index
$game_temp.name_max_char = CLONE_SETUP::NAME_MAX_SIZE
end
$game_actors.actor_clone_index+=1
else # Remove
$game_party.remove_actor(@params[0])
end
$game_map.need_refresh = true
end
else
dricc_command_129
end
return true
end
end