Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: TrueCynder on January 21, 2014, 10:50:12 am

Title: [SOLVED] Help me finishing the equip scene ?
Post by: TrueCynder on January 21, 2014, 10:50:12 am
Hey everyone so im almost done with editing my equip scene
but there is one thing i cant finish due my lag of RGSS knowlege
could someone tell me how i could display an in game variable based on the array index ?

(http://i39.tinypic.com/2nrpj7l.png)

Next to the weapon level there is suppose to be one out of four variables (9-12)
depending on what actor´s equipment you´re currently editing

1 = 9
2 = 10
3 = 11
4 = 12

id realy appriciate the help  :shy: ( like allways)

Spoiler: ShowHide

#==============================================================================
# ** Window_EquipLeft
#------------------------------------------------------------------------------
#  This window displays actor parameter changes on the equipment screen.
#==============================================================================

class Window_EquipLeft < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     actor : actor
 #--------------------------------------------------------------------------
 def initialize(actor)
   super(0, 64, 272, 416)
   self.contents = Bitmap.new(width - 32, height - 32)
   @actor = actor
   refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   draw_actor_name(@actor, 4, 0)
   draw_actor_parameter(@actor, 4, 64, 0)
   draw_actor_parameter(@actor, 4, 96, 1)
   draw_actor_parameter(@actor, 4, 128, 2)
   draw_actor_parameter(@actor, 4, 192, 3)
   draw_actor_parameter(@actor, 4, 224, 4)
   draw_actor_parameter(@actor, 4, 256, 5)
   draw_actor_parameter(@actor, 4, 288, 6)
   self.contents.font.color = system_color
   self.contents.draw_text(4, 352, 120, 32, "WEAPON LEVEL")
   if @new_atk != nil
     self.contents.font.color = system_color
     self.contents.draw_text(160, 64, 40, 32, "->", 1)
     self.contents.font.color = normal_color
     self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
   end
   if @new_pdef != nil
     self.contents.font.color = system_color
     self.contents.draw_text(160, 96, 40, 32, "->", 1)
     self.contents.font.color = normal_color
     self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
   end
   if @new_mdef != nil
     self.contents.font.color = system_color
     self.contents.draw_text(160, 128, 40, 32, "->", 1)
     self.contents.font.color = normal_color
     self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
   end
 end
 #--------------------------------------------------------------------------
 # * Set parameters after changing equipment
 #     new_atk  : attack power after changing equipment
 #     new_pdef : physical defense after changing equipment
 #     new_mdef : magic defense after changing equipment
 #--------------------------------------------------------------------------
 def set_new_parameters(new_atk, new_pdef, new_mdef)
   if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
     @new_atk = new_atk
     @new_pdef = new_pdef
     @new_mdef = new_mdef
     refresh
   end
 end
end
Title: Re: [unsolved] Help me finishing the equip scene ?
Post by: AliveDrive on January 21, 2014, 12:12:56 pm
First of all, I really like this menu's layout and color scheme. It looks nice! :)

And I'm not sure if this will work but I read that this is how you call the value of an in-game variable so it's worth a shot.

Spoiler: ShowHide
$game_variables[x]


Where X is your variable number.
Title: Re: [unsolved] Help me finishing the equip scene ?
Post by: TrueCynder on January 21, 2014, 01:26:48 pm
Thanks :)

But this does not quiet help me
the variable has to change depending on the current actor
i dont quiet understand how it works myself so i cant explain my problem x_X
Title: Re: [unsolved] Help me finishing the equip scene ?
Post by: KK20 on January 21, 2014, 01:31:52 pm

self.contents.draw_text(YOUR_X_HERE, 352, 50, 32, $game_variables[@actor.id + 8].to_s)
Title: Re: [unsolved] Help me finishing the equip scene ?
Post by: TrueCynder on January 21, 2014, 01:56:49 pm
Thank you ^^"
Title: Re: [unsolved] Help me finishing the equip scene ?
Post by: AliveDrive on January 21, 2014, 03:00:42 pm
Ah, ok. Thank you KK20 for providing more context.

I only have limited knowledge of RGSS.

Could this be used with any variable in any scene?
Title: Re: [unsolved] Help me finishing the equip scene ?
Post by: KK20 on January 21, 2014, 05:34:07 pm
Uh, sure? You'd have to give me some kind of example by what you mean.
Title: Re: [unsolved] Help me finishing the equip scene ?
Post by: AliveDrive on January 21, 2014, 05:47:36 pm
Well not to thread-jack, but since you asked.

I will probably try to implement a relationship system in my project, and I would like to use a sort of "Beastiary" to sort all of the characters.

So the variable would be the relationship level and the scene would be whichever Beastiary I use (but probably Blizzard's).
Title: Re: [unsolved] Help me finishing the equip scene ?
Post by: KK20 on January 21, 2014, 05:54:49 pm
Sounds easy enough. When you get around to it, I'll help ya out. ;0