[SOLVED] Help me finishing the equip scene ?

Started by TrueCynder, January 21, 2014, 10:50:12 am

Previous topic - Next topic

TrueCynder

January 21, 2014, 10:50:12 am Last Edit: January 22, 2014, 01:45:10 pm by TrueCynder
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 ?



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

AliveDrive

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.
Quote from: Blizzard on September 09, 2011, 02:26:33 am
The permanent solution for your problem would be to stop hanging out with stupid people.

TrueCynder

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

KK20


self.contents.draw_text(YOUR_X_HERE, 352, 50, 32, $game_variables[@actor.id + 8].to_s)

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!


AliveDrive

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?
Quote from: Blizzard on September 09, 2011, 02:26:33 am
The permanent solution for your problem would be to stop hanging out with stupid people.

KK20

Uh, sure? You'd have to give me some kind of example by what you mean.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AliveDrive

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).
Quote from: Blizzard on September 09, 2011, 02:26:33 am
The permanent solution for your problem would be to stop hanging out with stupid people.

KK20

Sounds easy enough. When you get around to it, I'll help ya out. ;0

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!