Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to Enter Custom Stats

hi there, I have some Qs again.

just wondering, if we are going to create custome stat like this:

HP
MP
ATK
DEF
MATK
MDEF
EVA
MEVA
FAITH
STAMINA

how we are going to enter the stat? esp. if we are going to apply it fro all actors and enemy

thanks
 

Maytag

Member

Nice, you actually kinda stumped me, but nevertheless i will figure it out!!  ???

Ok, you have these;  and RMXP has these;

HP                                  HP
MP                                  SP
ATK                                STR     
DEF                                DEX
MATK                              AGI
MDEF                              INT
EVA                                ATK
MEVA                              PDEF
FAITH                              MDEF
STAMINA

you think you can make your  MATK, EVA, MEVA, FAITH, and Stam to work like the other skills? otherwise you might have to rewrite a lot of scripting. well there ya go. i tried my best :(
                         
 
Not only do you need to manually define the attributes (variables) that will hold the custom stats values,
you would also need to redefine all of the scripts that need to use those values.
For example, I assume MATK, MEVA, STAM will be used in battle, so the battle scripts would need to be
modified to use them.

FAITH, on the other hand, would probably be used exclusively in game play, so you could store & modify the
value in a game variable, and check the value of the variable, using event commands.
(you may only need to have the STATUS menu modified to include the custom stat.)

Be Well
 
Code:
[code]class Game_Actor
alias extra_attr_ga_init initialize
def initialize(actor_id)
  case actor_id
  when 1 #First actor
    @base_attr1 = [1, 5, 10, 16, 22, etc... One value for each level up to 99]
    and so on for each extra atribute...
  when 2 #Second actor...
    yeah, you get it.
  end
  @plus_attr1 = 0
  etc.
  extra_attr_ga_init(actor_id)
end

def attr_1
  return @base_attr1[self.level] + @plus_attr1
end

def attr_1=(other)
  @plus_attr1 = other - @base_attr1[self.level]
end

Reproduce for all other extra stats

end

Then incorporate it into all other scenes... And if you want it for monsters as well, mix around with it to fit Game_Enemy as well. Putting it into Game_Battler wouldn't work out really - considering monsters don't have levels like players do. So for monsters it'd be best to create the arrays by monster ID rather than level...

Hope you get something out of it :P

I'd suggest you keep the number of stats equal to the original number, that way you'd have a much easier time setting them and wouldn't have to do the above stuff.. A'course, you could also make the stats based on an algorithm for the actors. You'd still have to change how they work in battle and stuff though.

Good luck.[/code]
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top