Adding more stats that behave like SP
#1
So this has been bothering me for a long time now.. so much so, that I’m calling out to you guys for any help or insight.

 
For my project I’m wanting to add two stats that work just like SP, namely STM and MP.
 
I found out adding the first (STM) was quite easy, I just replaced the names with “SP” in the script with “STM”, also since I am not interested in a stat called “SP”.
With it I added a nice green STM-bar as a visual indicator which I’ve found a code for.
 
Now for the MP stat it seems a lot harder.
I had to make a whole new stat that does not exist in the database.
However this seems at least partly possible. With help of Kitsune's Extra Statistics I managed to add MP, but here comes the problem: I cannot figure out how to define a minimal and maximum amount for MP to make it work like SP.
I now have a MP stat that works more like a fixed stat such as STR or INT.
 
My best guess is the code below has to be modified somehow?

Code:
 def maxmp
   n = [[base_maxmp + @mp_plus, 1].max, 999].min
   for i in @states
     n *= XTRA_STATS_RATE[i][0] / 100.0
   end
     n = [[Integer(n), 1].max, 999].min
    return n
   end

 
Does anyone know how to make it work with a bar and that can be used up using skills, just like SP?
 
 I’m very much a Rubyscript noob so after trying different things I am clueless Sad
Reply }
#2
Just like any of the RMXP stats, Strength, Intelligence, Raw Good Looks, they all have a fully minimum stat of 0 and a full blown max of 999 regardless of level.

What you want is to understand about the stat's increase and how they work.

When you change the Str, Dex, HP stats, you can do that in the editor.  With this, you need the script.  Please note the below section:
Code:
 # Described below.  Actor #1's char stat starts at 10 and const starts at 12
 #                   Actor #2's char stat starts at 20 and const starts at 24
 #                   Both have a 2pt curve for char and 3pt curve for const
 #
 #
   XTRA_STATS_ACTOR = {1 => [[10, 2], [12, 3]],
                       2 => [[20, 2], [24, 3]] }  
This is describing TWO different stats for two different actors.
When it shows:  1 => [[10,2],[12,3]] .... it shows how actor #1 handles TWO different stats.  The first array [10,2] is for the first stat, and [12,3] is for the second stat.

I guess you'd have   1 => [[10,2]] all by itself to handle your #1 actor as you're adding only one stat, right?  But you'd be doing this for actor #2,  #3, #27, #98, whatever.

Each of these arrays defines what your actors start off with at level 1, and how much of an increase you get insofar as a stat increase.  In the above CODE example, Actor #1 startts off his first stat with 10 points to that stat, and Actror #2 gets 20 points of that stat at level 1.  Both have a 2pt curve in the above example.

So there is no begin or end stats, but a curve progression.

Now you can run a test, jacking your hero up to the max level and see how high his stats are at that level.  It would be so much easier if I could edit/alter the editor.... yeah, like that's gonna happen.

Just remember, you need to make matching stats for enemies, weapons, etc.

And the section of  code you are looking at,  XTRA_STATS_RATE, handles how status effect may play with the new Stat.  Like if the VENOM state makes your stat reduce by 20% or  so.

I'm using it for 'fatigue' in my own action game.

EDIT: Oh the bars thing.

Remember that the script suggests both a 'Char' and a 'Const' stat? It's defined like:
Code:
def char
    n = [[base_char + @char_plus, 1].max, 999].min
    for i in @states
      n *= XTRA_STATS_RATE[i][0] / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end
You create these of course, or a MP method in your case. Once done, you make your bar access actor.mp instead of actor.sp
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#3
(07-17-2020, 09:22 PM)DerVVulfman Wrote: Just like any of the RMXP stats, Strength, Intelligence, Raw Good Looks, they all have a fully minimum stat of 0 and a full blown max of 999 regardless of level.

What you want is to understand about the stat's increase and how they work.

When you change the Str, Dex, HP stats, you can do that in the editor.  With this, you need the script.  Please note the below section:
Code:
 # Described below.  Actor #1's char stat starts at 10 and const starts at 12
 #                   Actor #2's char stat starts at 20 and const starts at 24
 #                   Both have a 2pt curve for char and 3pt curve for const
 #
 #
   XTRA_STATS_ACTOR = {1 => [[10, 2], [12, 3]],
                       2 => [[20, 2], [24, 3]] }  
This is describing TWO different stats for two different actors.
When it shows:  1 => [[10,2],[12,3]] .... it shows how actor #1 handles TWO different stats.  The first array [10,2] is for the first stat, and [12,3] is for the second stat.

I guess you'd have   1 => [[10,2]] all by itself to handle your #1 actor as you're adding only one stat, right?  But you'd be doing this for actor #2,  #3, #27, #98, whatever.

Each of these arrays defines what your actors start off with at level 1, and how much of an increase you get insofar as a stat increase.  In the above CODE example, Actor #1 startts off his first stat with 10 points to that stat, and Actror #2 gets 20 points of that stat at level 1.  Both have a 2pt curve in the above example.

So there is no begin or end stats, but a curve progression.

Now you can run a test, jacking your hero up to the max level and see how high his stats are at that level.  It would be so much easier if I could edit/alter the editor.... yeah, like that's gonna happen.

Just remember, you need to make matching stats for enemies, weapons, etc.

And the section of  code you are looking at,  XTRA_STATS_RATE, handles how status effect may play with the new Stat.  Like if the VENOM state makes your stat reduce by 20% or  so.

I'm using it for 'fatigue' in my own action game.

EDIT:  Oh the bars thing.

Remember that the script suggests both a 'Char' and a 'Const' stat?   It's defined like:
Code:
  def char
   n = [[base_char + @char_plus, 1].max, 999].min
   for i in @states
     n *= XTRA_STATS_RATE[i][0] / 100.0
   end
   n = [[Integer(n), 1].max, 999].min
   return n
 end  
You create these of course, or a MP method in your case.  Once done, you make your bar access actor.mp instead of actor.sp

Thanks for your reaction.
In fact I could use the second stat too because I'm thinking of a "Morale" stat.

I have been trying to tweak with the min and max stats combined with the bar im using. But every time it gives me an error like 'undefined method []' for nil:NilClass' (might have to do a roll back since I've been messing around with it a lot).

So far I do understand how the arrays work. Although I do not know if I can define a minimum and a maximum amount with the "def MP" method. Also with that mp bar Sarcasm It looks like it is conflicting somehow.

For example, if I use the def MP method to say
Code:
def mp
n = [[base_mp + @mp_plus, 0].max, 20].min
This could work for level 1

But if the hero levels, I'd want the max MP to be 25 for example. So it would look like this

Code:
def mp
n = [[base_mp + @mp_plus, 0].max, 25].min

I don't think the above examples would work since the MP must be able to be unique for each character, while this method is meant for all actors right?

The bar im trying to use has a hard time accesing the data from XTRA_STATS_ACTOR. I guess that is because I dont know how to do it
Reply }
#4
Quote: The bar im trying to use has a hard time accesing the data from XTRA_STATS_ACTOR. I guess that is because I dont know how to do it

Nonononononooo!!!!

You don't link the bar to XTRA_STATS_ACTOR at all. You link it to the method defined for that stat. You have an mp stat designated above, so just consider this!!! Using a bar script called 'draw_bar' as an example.

draw_bar(actor.hp, actor.maxhp, bar_x_pos, bar_y_pos, bar_length, 8, hp_bar_color)
draw_bar(actor.mp, 999, bar_x_pos, bar_y_pos+20, bar_length, 8, mp_bar_color)

At the time, I only assumed a static '999' maximum for character stats, not something akin to HP or SP.

WORKING now....
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#5
You'd need to replace that 20 or 25 with a variable or method call that processes the actual value for such a level.
You can create an array full of this values for every single level and then search for its index via using the @level variable as its actual position inside that array.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#6
Alright. I will try to edit it like you guys are showing me (when I have some time for it).

When I know more I'll let you know!
Reply }
#7
Well, I did say WORKING, right? And that's what I did ....... ((( > HERE < )))

I updated Kitsune with a new TYPE of Stat, what I call an 'action' stat, one designed in the same manner as the HP and SP stats and for much the same reason.

The new script has a 'draw_actor_fatigue' method which is similar to the draw_actor_hp. With that, creating a bar for such a stat should be no problem, And you can see its use within the demo script's altered Window_Status script.

Meanwhile, I severely FIXED THE DANG STAT PROGRESSION system. It was recycled from another script, however I used the wrong method... one that made an experience points bell curve that made stat values increase exponentially instead of a flat grade as they should have.

No one mentioned this in nearly a decade of its release?
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#8
(07-21-2020, 03:53 AM)DerVVulfman Wrote: Well, I did say WORKING, right?  And that's what I did ....... ((( > HERE < )))

I updated Kitsune with a new TYPE of Stat, what I call an 'action' stat, one designed in the same manner as the HP and SP stats and for much the same reason.

The new script has a 'draw_actor_fatigue' method which is similar to the draw_actor_hp.  With that, creating a bar for such a stat should be no problem,  And you can see its use within the demo script's altered Window_Status script.

Meanwhile, I severely FIXED THE DANG STAT PROGRESSION system.  It was recycled from another script, however I used the wrong method... one that made an experience points bell curve that made stat values increase exponentially instead of a flat grade as they should have.

No one mentioned this in nearly a decade of its release?

This looks very promising man! Can't wait to try it out :thumbs up:
Reply }
#9
Got it working! Thanks for the help Grinning
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 15,591 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   Best Practices for Adding New Data to Saves tnsi 3 5,993 02-16-2015, 04:50 AM
Last Post: tnsi
   Adding new Stats? shintashi 2 5,584 03-27-2010, 11:42 PM
Last Post: Victor Sant



Users browsing this thread: 1 Guest(s)