- Joined
- Aug 19, 2013
- Messages
- 265
- Reaction score
- 223
- First Language
- English
- Primarily Uses
- RMVXA
When using N.A.S.T.Y. Extra Stats https://forums.rpgmakerweb.com/index.php?threads/n-a-s-t-y-extra-stats.998/ and Theo Custom Parameter Formula https://www.rpgmakercentral.com/topic/20334-theo-custom-parameter-formula/, I am trying to create a custom parameter that determines how much HP is gained by an actor's Constitution xstat. I'll preclude this by saying that I have little to no understanding of how ruby scripting works, and I am struggling through the dark to try and get this to work. Forgive me for my lack of understanding if I make simple scripting errors.
I'll give a run down of what is supposed to happen: Let's say a character starts with 20 HP at level 1, and starts with 10 CON. Any amount of CON above 10 increases Max HP by 8, per point in CON. That's governed by this formula: 20 + (8 * (CON - 10)) For instance, if a character has 12 CON, he has 20 + (8 * (12-10)). This becomes 20 + 16 = 36.
The formula I made in the Theo Custom Parameter script looks like this (the relevant part between "def" and the second "end"):
With this, I get an "Stack Level Too Deep" error. I have tried other variations like:
This don't work either. I feel like the only way to move forward is blocked because I lack the knowledge to understand how this works.
I'll give a run down of what is supposed to happen: Let's say a character starts with 20 HP at level 1, and starts with 10 CON. Any amount of CON above 10 increases Max HP by 8, per point in CON. That's governed by this formula: 20 + (8 * (CON - 10)) For instance, if a character has 12 CON, he has 20 + (8 * (12-10)). This becomes 20 + 16 = 36.
The formula I made in the Theo Custom Parameter script looks like this (the relevant part between "def" and the second "end"):
Code:
def custom_mhp(ori_param)
if $game_actors[actor.id].xstat.con > 10
20 + (8 * ($game_actor[actor.id].xstat.con - 10))
else
20
end
end
Code:
def custom_mhp(ori_param)
if $game_actors.xstat.con > 10
20 + (8 * ($game_actors.xstat.con - 10))
else
20
end
end
Last edited:
