Save-Point
[RMXP] Actor Cloning - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: [RMXP] Actor Cloning (/thread-3261.html)



[RMXP] Actor Cloning - dagarath - 03-08-2011

Alright, I am going to try to make this as easy to understand and concise as possible.

I have been looking for a way to, for example, take Actor001, its level etc, create a new Database entry somewhere other than $game_actors, and save that Actor001 with a unique ID.

I want to be able to use the same 6 actors for my party members, but be able to swap them out, and still save all of their info. I could in theory use actors 7 - 450 for the BASE characters (no level or statistic changes), and 451-999 to store owned party members, but I still don't understand how exactly I would move the actors around the database.

Basically, I create a new Actor001 with Actor054 as a base, give it its own stats etc(that stats part I can do heh) and when I pull Actor001 from my party it will be stored in the first available slot from 451+ UNLESS that actors ID already exists in 451+, in that case it overwrites the currently stored actor.

SO again, to make it clear...how can I overwrite actors with other actors, essentially cloning them?



RE: [RMXP] Actor Cloning - DerVVulfman - 03-08-2011

I just saw this thread.

Here's something you may be interested in.
Actor Cloning System by Charlie Fleed


RE: [RMXP] Actor Cloning - dagarath - 03-08-2011

Yea I found that too, unfortunately there is no Actor Cloning System on Planted Fleed, I don't know if it has just been lost or what?

Would anyone be able to tell me how to create a new section like Actors in the save file?

This seems to be how the entire actor Class is added to the Actors array
Code:
#==============================================================================
# ** Game_Actors
#------------------------------------------------------------------------------
#  This class handles the actor array. Refer to "$game_actors" for each
#  instance of this class.
#==============================================================================

class Game_Actors
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
@data = []
  end
  #--------------------------------------------------------------------------
  # * Get Actor
  # actor_id : actor ID
  #--------------------------------------------------------------------------
  def [](actor_id)
if actor_id > 999 or $data_actors[actor_id] == nil
  return nil
end
if @data[actor_id] == nil
  @data[actor_id] = Game_Actor.new(actor_id)
end
return @data[actor_id]
  end
end

Code:
def initialize(actor_id)
super()
setup(actor_id)
  end
  #--------------------------------------------------------------------------
  # * Setup
  # actor_id : actor ID
  #--------------------------------------------------------------------------
  def setup(actor_id)
   ...

from what I can tell from Actors, I would have to at least have these two sections correct?

Anyways I am pretty much looking for the easy way to do this, but it seems like there may not be an easy way. ya can check out my post about this subject, and what I am really trying to do here
Code:
http://www.hbgames.org/forums/viewtopic.php?p=826676