Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Calling Actors from another Module
DUFUTA
post Jul 22 2011, 10:11 AM
Post #1


Level 5
Group Icon

Group: Member
Posts: 60
Type: Musician
RM Skill: Intermediate




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?
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Jul 22 2011, 10:28 AM
Post #2


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




Why not simply make the necessary modifications to RPG::Actor so they're reflected inside $data_actors?


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
DUFUTA
post Jul 22 2011, 10:34 AM
Post #3


Level 5
Group Icon

Group: Member
Posts: 60
Type: Musician
RM Skill: Intermediate




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 post has been edited by DUFUTA: Jul 22 2011, 10:45 AM
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 11:35 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker