Help - Search - Members - Calendar
Full Version: Calling Actors from another Module
RPG RPG Revolution Forums > Scripting > Script Development and Support
DUFUTA
Below is the Default Game_Actors object.


CODE
==============================================================================
# ** Game_Actors
#------------------------------------------------------------------------------
#  This class handles the actor array. The instance of this class is
# referenced by $game_actors.
#==============================================================================

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


I've created a secondary module to define actors and would like to use them as the basis for the actors. This would overwrite the RPG::Actor module which is called by the $data_actors. So, how would I set this little portion of script up to call the new module instead?
Kread-EX
Why not simply make the necessary modifications to RPG::Actor so they're reflected inside $data_actors?
DUFUTA
QUOTE (Kread-EX @ Jul 22 2011, 10:28 AM) *
Why not simply make the necessary modifications to RPG::Actor so they're reflected inside $data_actors?



Basically, that's what I did. You're saying leave it called "RPG::Actors" instead of changing the name. I'll see what happens.


EDITTED
@parameters = Table.new(6,100)
for i in 1..99
@parameters[0,i] = 400+i*50
@parameters[1,i] = 80+i*10
@parameters[2,i] = 15+i*5/4
@parameters[3,i] = 15+i*5/4
@parameters[4,i] = 20+i*5/2
@parameters[5,i] = 20+i*5/2

This is the parameters section. I wanted to be able to add a few parameters. So, what's up with this table? Is that MHP, HP, MMP, MP, ATT, DEF, SPI and AGI? The equations at the right. . .what exactly are those doing?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.