Food Use Increases Stats Over Time

Hello,

I have no real idea what I should call this sort of thing (thus the terrible topic title), but I'll at least try to explain it as best I can. I'm experimenting with the following idea:

Food is split into several categories. [sWEET] [bITTER] [sOUR], etc. (similar to the Poffin system from Pokemon). 

After consuming a food in a particular category, a variable increases by 1 in that type. So eating a [sWEET] food increases that character's [sWEET] variable by 1. Once that variable reaches a certain amount, like 10 or 20, they receive a permanent boost to a particular stat such as ATK, SPD, DEF, etc. These stat boosts are permanent, not battle specific.

Further, I'm interested in making it so that the more that a character consumes of a particular food type, they become steadily immune to its stat boosting effects. So where it may take Eric to eat 3 [sWEET] foods to gain a point, after gaining 5 points he now needs to eat 12 [sWEET] foods for that one point. The closest I can think of a system like this was Final Fantasy: Crystal Chronicles, where eating certain foods like Star Carrots would increase your Magic Power. However, each character had a particular palette, so they might not enjoy eating Star Carrots and thus wouldn't receive as much of a bonus OR they had overate Star Carrots and the bonus would be dulled. 

After doing some experimenting, I was able to do this in a limited fashion using Items that activate Common Events. However, the Common Events only allow the increase to be in percentages, not in whole stat numbers that I can see in the program. Further, Common Events only allow for the variable to effect the entire game. For example, if Alex ate a [sWEET] food it would still add the variable in a way that would effect Eric as well. I want the variables to be character specific. I also have no idea how I would implement the "character prefers this food/used it too much/doesn't like it" type of system from Crystal Chronicles.

Is this a process that could be attempted with just some eventing, variables, switches, and branches? Or would I need a script instead?

Thanks!
Further, Common Events only allow for the variable to effect the entire game. For example, if Alex ate a [sWEET] food it would still add the variable in a way that would effect Eric as well.
Not neccessarily.
You need one variable for each actor, and the common events called by the items need to identify that actor and only increase that variable.


There are several ways to do this, for example by a target state that is identified in the common event, by a command in the damage formula or by scripting for advanced events.
In making one variable for each actor, how would I know who ate the food to add the variable to?
make common event that asks who to fed it to using a "Show Choices", if you have more than 4 in the party put 3 per option page and use a continue/more option. it's pretty much user input. then  depending which one the player chose add to that person's stat.
Not neccessarily.

You need one variable for each actor, and the common events called by the items need to identify that actor and only increase that variable.

There are several ways to do this, for example by a target state that is identified in the common event, by a command in the damage formula or by scripting for advanced events.
What would make this easier, as well as making advanced eventing easier in general, is use Hime's custom page conditions.  This not only enables you to set any condition/any amount of conditions on normal events, it also lets you set such for Battle, and common events as well.

It's a must use script for anyone who is planning on making any events that are even remotely complex.
What would make this easier, as well as making advanced eventing easier in general, is use Hime's custom page conditions.  This not only enables you to set any condition/any amount of conditions on normal events, it also lets you set such for Battle, and common events as well.

It's a must use script for anyone who is planning on making any events that are even remotely complex.
I'll certainly look into trying out that script. From just the brief glance I gave it, it sounds really confusing to use. But I'm sure after some playing around I might be able to figure out how to do what I'm trying to do. Thanks for that.

make common event that asks who to fed it to using a "Show Choices", if you have more than 4 in the party put 3 per option page and use a continue/more option. it's pretty much user input. then  depending which one the player chose add to that person's stat.
I hadn't thought at all about doing something like that, but I was hoping for the item to be usable by anyone at anytime. Can Show Choices be allowed during item use in battle? Or is that only available on the overworld? I want the food to function like an actual restorative item, so a player would use it during battle. But I also want it to potentially boost stats after repeated use over time depending on the character that uses it.
In making one variable for each actor, how would I know who ate the food to add the variable to?
Make a new state "food-target" and have the item a feature that adds this target to the actor eating.
Then in the common event, for each actor make a conditional branch "state food target inflikted". The actor where the branch returns true is the one who ate, and you can have the calculations specified for that actor in the branch. remove the state as part of the branch commands
I'll certainly look into trying out that script. From just the brief glance I gave it, it sounds really confusing to use. But I'm sure after some playing around I might be able to figure out how to do what I'm trying to do. Thanks for that.

I hadn't thought at all about doing something like that, but I was hoping for the item to be usable by anyone at anytime. Can Show Choices be allowed during item use in battle? Or is that only available on the overworld? I want the food to function like an actual restorative item, so a player would use it during battle. But I also want it to potentially boost stats after repeated use over time depending on the character that uses it.

It's actually very simple, as the first command line of a event, make a comment, with this: <page condition>

On the next line, create a condition branch(any condition you set for that, will now count as a page condition).
It's certainly something you can do with events:

  • Have variables that represent how many (sweet/sour/etc.) foods (character X/Y/Z) must eat to get a stat boost
  • Have variables that represent how many (sweet/sour/etc.) foods (character X/Y/Z) has eaten since their last stat boost
  • Upon eating a food the character is given a state (e.g. "Sour State") and then a Common Event runs
  • The Common Event looks to see whether each character has Sour State, and increases their "Sour Foods" variable by 1.  Then it removes the Sour State from the party.If the character's Sour Foods Eaten equals their Sour Foods for a Boost, they get a stat boost, the Sour Foods for a Boost Variable is increased, and the Sour Foods Eaten variable is set to 0
However, the eventing for this will be pretty long and drawn out and won't be easily scalable when you need to add new characters/tastes, fix bugs, etc.  If you know anyone who is a competent scripter, or feel comfortable making a Script Request, you can save yourself a lot of time and heartache by getting it in script form.
After testing it out with states and variables, like suggested, the system works perfectly. The only problem, as Wavelength said, is that the eventing gets really drawn out, so much so it actually goes off the visible page. Overall this was more of a test of seeing what is possible and what is not possible with pure eventing based on a random idea that came to me. I think having a script to control all of this would be much smoother, especially if it incorporated some way of visibly tracking the variables with a menu/chart/bars/etc. for the player's convenience. Are there any sort of scripts that do create menus/charts/bargraphs/etc. using variables? And if I did need a script made of this, what exactly would you call this sort of system? I really have no idea what I'd describe it as being.

Original thread: https://forums.rpgmakerweb.com/threads/food-use-increases-stats-over-time.45766/