RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED] Help with Status Information

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
Warm greetings.

First of all I thank all who helped (directly or indirectly) so far. I believe I'll be staying here for quite some time. ;)

Now, through process of modifying I encountered Blizzard's excellent menu update that basically changes the complete display of what you get when you hit "Esc" during game - the menu, with equip, stats, items, etc. I included it into my game with a couple of tiny modifications but, however, were incapable of adding a few small but, for me, very important informations. [I'm using rmxp postality enhanced]

I'd like to have aditional information displayed when you choose Status - Height, Weight and Age of every character displayed in that specific part of the menu. However, I had absolutely no idea how to script it, or edit script.

If you have anykind of idea, I'll listen to it. If you think you can try scripting it, because I can't, you're welcomed. I'm, so to say, troubled with the fact there really isn't a tab where you could write height weight and age so I'm kind of worried how this would work anyway. If you can't come up with something, I think I'll try adding an image instead of sprite next to the status field and include height, weight and age option into the pic instead of separate information...hmm..not bad idea but costs time.

I'll keep an eye on this topic, good luck with ideas. :P
« Last Edit: December 23, 2006, 10:01:53 PM by Decadent Sympozium »

***
Rep:
Level 88
Random-Idiot
Where do you want it and could you post your modded script? It helps  ;)
ALL HAIL ME™

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
Right, I don't understand why I did not offer this before, it's not like I didn't think of it. >_> I figured how to apply image, now I just need these ht, wt and ag.

Here's the screenshot and basic instruction:

Status Image


Here's link to complete script (The modifications weren't of such level that you need mine, I'd rather have a clean edition):

Menu System

Now, as you can see I preffer having that info beneath the picture that is usually displayed, but it can be above the pic, or anywhere in the screen where it might seem logical if you feel it's easier that way. It can be Height, Weight, Age or Age, Height, Weight (What seems more logical to me now). This is the "Status" submenu and it should be there only (because there is no point in seeing it anywhere else).

Take your time, I'm not going anywhere. :P
« Last Edit: December 23, 2006, 12:36:35 PM by Decadent Sympozium »

***
Rep:
Level 88
Random-Idiot
Will the weight ever change same for height and age?

Might be a stupid question, but some want that and some don't, for instance if you say yes to change age, what time system do you use, or do you just want to change the age by call script?
ALL HAIL ME™

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
Hmm..you're question confused me a bit, but I think I know what you mean:

Weight: Measured in lbs (eg 145 lbs), it doesn't change
Height: Measured in ft (eg 6'9'), it doesn't change
Age: Human-like, it doesn't change.

They should be a factor functioning like name of the character, just a name, nothing directly relevant to game itself. I'm trying to achieve this so that players can get the feel of character in space since it's all 2D and proportional in size.

***
Rep:
Level 88
Random-Idiot
Okay, I don;t know if you want to try yourself putting it there. Either way, I made A little script which adds height, weight and age to your characters. You can simply put in above main, and edit the database to your needs. Let me explain, but here is the script.

Code: [Select]
#==============================================================================
# *** Database
#------------------------------------------------------------------------------
#  Contains extra values not in the default Database
#  >> Syntax: ID => Starting VALUE
#  >> 'def' is used when ID is not found
#  >> 'max' is used when higher then max
#  >> 'min' is used when lower then min
#==============================================================================
module Database
  #--------------------------------------------------------------------------
  # * Weights
  #--------------------------------------------------------------------------
  Weights = {
  1 => 43,  2 => 92, 3 => 31,
  4 => 23,  5 => 45, 6 => 99,
  7 => 102, 8 => 30,
  'def' => 60, 'max' => 3000, 'min' => 10
  }
  #--------------------------------------------------------------------------
  # * Heights
  #--------------------------------------------------------------------------
  Heights = {
  1 => 178, 2 => 190, 3 => 156,
  4 => 162, 5 => 110, 6 => 203,
  7 => 167, 8 => 170,
  'def' => 165, 'max' => 300, 'min' => 50
  }
  #--------------------------------------------------------------------------
  # * Ages
  #--------------------------------------------------------------------------
  Ages = {
  1 => 19, 2 => 24, 3 => 26,
  4 => 31, 5 => 44, 6 => 21,
  7 => 31, 8 => 30,
  'def' => 26, 'max' => 150, 'min' => 0
  }
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor
  #--------------------------------------------------------------------------
  # * Setup
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  alias old_setup_me_gameactor setup
  def setup(actor_id)
    old_setup_me_gameactor(actor_id)
    setup_extra
  end
  #--------------------------------------------------------------------------
  # * Setup Extra
  #--------------------------------------------------------------------------
  def setup_extra
    @age = (Database::Ages.has_key?(id) ? Database::Ages[id] : Database::Ages['def'] )
    @weight = (Database::Weights.has_key?(id) ? Database::Weights[id] : Database::Weights['def'] )
    @height = (Database::Heights.has_key?(id) ? Database::Heights[id] : Database::Heights['def'] )
  end
  #--------------------------------------------------------------------------
  # * Gain Weight
  #     n = number to gain
  #--------------------------------------------------------------------------
  def gain_weight(n=5)
    @weight = [[@weight + n, Database::Weights['min']].max,Database::Weights['max']].min
  end
  #--------------------------------------------------------------------------
  # * Lose Weight
  #     n = number to lose
  #--------------------------------------------------------------------------
  def lose_weight(n=5)
    gain_weight(n.abs)
  end
  #--------------------------------------------------------------------------
  # * Gain Height
  #     n = number to gain
  #--------------------------------------------------------------------------
  def gain_height(n=1)
    @height = [[@height + n, Database::Heights['min']].max,Database::Heights['max']].min
  end
  #--------------------------------------------------------------------------
  # * Lose Height
  #     n = number to lose
  #--------------------------------------------------------------------------
  def lose_height(n=1)
    gain_height(-n)
  end
  #--------------------------------------------------------------------------
  # * Gain Years
  #     n = number to gain
  #--------------------------------------------------------------------------
  def gain_years(n=1)
    @age = [[@age + n,Database::Ages['min']].max,Database::Ages['max']].min
  end
  #--------------------------------------------------------------------------
  # * Lose Years (ODD)
  #     n = number to lose
  #--------------------------------------------------------------------------
  def lose_years(n=1)
    gain_years(-n)
  end
  #--------------------------------------------------------------------------
  # * Get Age
  #--------------------------------------------------------------------------
  def age
    return @age
  end
  #--------------------------------------------------------------------------
  # * Get Height
  #--------------------------------------------------------------------------
  def height
    return @height
  end
  #--------------------------------------------------------------------------
  # * Get Weight
  #--------------------------------------------------------------------------
  def weight
    return @weight
  end
end

I know it could be done with simple attribute accessors, but I added some failsaves for you. So here we go. In the module Database all the defaults (aka at game starting) listed. You can add more or change it to your needs. It works like this:

Code: [Select]
Variable = {
ID => Value,
ID2 => Value2 }

Also, I added 3 special values: def, min and max. I will return on that later. Now, I aliased a new setup command into the initialisation (aka creation) of the Game_Actor Script. This is where the 'def' value comes in. Let's say you have 9! actors in the database. This means when creating actor 9, there is no value of weight for it (notice how there is not number 9 in the hash Weights ). The script sees that and takes the 'def' value  which is in the hash.



I only told you about the creation, but not how to modify the values, and read the values. that can be done on the folowing way. Each method discribed below can be used on any Game_Actor object. The methods availeble are:

Code: [Select]
.age            # returns the current age
.height         # returns the current height
.weight         # returns the current weight
.gain_weight(n) # gains n weight
.gain_height(n) # gains n height
.gain_years(n)  # gains n years
.lose_weight(n) # loses n weight
.lose_height(n) # loses n height
.lose_years(n)  # loses n years
.setup_extra    # resets the values

note: gain_years(10) is the same as lose_years(-10) and lose_years(-10) the same as gain_years(10). Best is only to use positive numbers!

note: gain_years(n) > the age will be set to 'max' if n is larger then 'max'
note: lose_years(n) > the age will be set to 'min' if n is smaller then 'min'



Now, how to draw this on screen? In a window where @actor is set to the current actor you could simply do:

Code: [Select]
self.contents.draw_text(X,Y,WIDTH,HEIGHT, @actor.age + " years")
self.contents.draw_text(X,Y,WIDTH,HEIGHT, @actor.weight + " kilogram")
self.contents.draw_text(X,Y,WIDTH,HEIGHT, @actor.height + " centimeters")



Me™

you could simply change kilogram to lbs or whatever you want!. I just added the ability to change the years and weight as you might run into such thing in the game, where the player has some diseases making him reallsy small or old, or a fountain which makes you younger, or turning into a giant.. w/e
« Last Edit: December 23, 2006, 01:44:30 PM by Me™ »
ALL HAIL ME™

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
You're amazing.  ;D   ;D

Alright, I understood most of it, but I'm troubled with this "actor" thing and with this (eg):

Quote

 Heights = {
  1 => 178, 2 => 190, 3 => 156,
  4 => 162, 5 => 110, 6 => 203,
  7 => 167, 8 => 170,

Now, these numbers you typed ->

1) Does this "1" reffer to character number 1 in database, or it reffers to something else?
2) Does "178" reffers to character "1" height that will be displayed on screen, or it reffers to something else?

Ok, you can scratch this if you want, I understood drawing, modifying and so but not actual appearance. XD let's go down by good old dumb way ->

Say I have two characters in database, "Attanan" and "Foradastor". I want ht, wt and ag to be displayed in game without any aspect of modifying, just for them to start with this info (don't bother with drawing, just procedure), and I haven't included this script yet - what do I do, step by step?

[I'm really sorry if I'm bothering you, it's that I just always always have difficulties with scripting]


***
Rep:
Level 88
Random-Idiot
Actors are object created from the script Game_Actor in the script editor. It controlles the hero's in game. The information in your status menu comes from Game_Actor objects. $game_actors is a proccessed version of $data_actors, and $game_party.actors is your party's actors. This means that if you have arshes in your party, $game_party.actors[0] (first actor in party) matches $game_actors[1] (Actor with id = 1) but lets say basil is in your party and arshes is not, then $game_party.actors[0] does NOT match $game_actors[1] but $game_actors[2]


1 refers to the ID, 178 refers to the height given at creation.
Code: [Select]
Syntax: ID => VALUE, ID => VALUE ...

Lets say Attanan in number 1 in the database and Foradastor number two.

1) Add the script above MAIN
2) Change Heights[1] and Heights[2] as well as Age[1] and Age[2] and Weight[1] and Weight[2] to your needs.
3) Test the info by creating a call script with:

Code: [Select]
p $game_actors[1].age
p $game_actors[2].age

If the boxes matched respectifly the numbers set in the script, that works.
« Last Edit: December 23, 2006, 02:13:23 PM by Me™ »
ALL HAIL ME™

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
So that's it? XD Great, great. You're just great. XD Thanks a lot. I think I'll put "resloved" soon.

EDIT...

Ok I'm stupid. I lost myself, I don't know where to put the drawing order. I though I understood this

"In a window where @actor is set to the current actor "

but I was wrong.   ??? I tried putting it on my own but eventually didn't have a clue what to do with it.
« Last Edit: December 23, 2006, 03:23:45 PM by Decadent Sympozium »

***
Rep:
Level 88
Random-Idiot
Well, you where close enough. In the window simply put in probably def refresh, after another self.contents line:

Code: [Select]
self.contents.draw_text(X,Y,WIDTH,HEIGHT, @actor.age + " years")
self.contents.draw_text(X,Y,WIDTH,HEIGHT, @actor.weight + " lbs")
self.contents.draw_text(X,Y,WIDTH,HEIGHT, @actor.height + " ft")

You should take for HEIGHT32 or something and for width the WIDTHof the window.
X is being the X coörd in the window! (so if the window is drawed at 10,10, drawin text at 12,15 is X = 2 and Y = 5.)
Y is being the Y coörd in the window.
ALL HAIL ME™

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
Yea but in which window? O.o Also are these three codes finitive or I'm supposed to replace some part of them with the particular id or alike?
« Last Edit: December 23, 2006, 04:53:51 PM by Decadent Sympozium »

***
Rep:
Level 88
Random-Idiot
I don't really know in which window. I did not test anything at all. In the status window I guess. I guess in window Window_StatusMenu. And no, I made it so you do not ned to replace any thing with an ID. see, the @acotr variable already is the current actor, so that goes oké ... ;)
Try Adding this below your menu script page:

Code: [Select]
class Window_StatusMenu < Window_Base
  alias oldme_extra_status_refresh refresh
  def refresh
    oldme_extra_status_refresh
    old_size = self.contents.font.size
    # self.contents.font.size = 18
    self.contents.draw_text(224, 100, 120, 32, "Age: #{@actor.age} years")
    self.contents.draw_text(224, 132, 120, 32, "Weight: #{@actor.weight} lbs")
    self.contents.draw_text(224, 164, 120, 32, "Height: #{@actor.height} ft")
    self.contents.font.size = old_size
  end
end

just change the 224 for the x coord and the 100,132,164 for the Y coords. If you want to make that text smaller, remove the # for self.contents.font.size = 18 and change the 18 to your needs.
ALL HAIL ME™

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
OMG it worked. I managed to adjust it. Excellent. Well done, lol! XD Sorry to bother you.

***
Rep:
Level 88
Random-Idiot
ALL HAIL ME™