Percentages and strings built into variable editor

Description of the Feature:
  • I have an Max HP variable, I have a current HP variable, ugh, percentage of current HP.
  • I have a word, I have a variable, ugh, String Variable
  • Bad jokes aside, I think that these things should be a part of the editor.

Code for Implementation:
Nope, not a coder, just an idealist designer with fresh ideas.

Mockups:
Actually, come to think of it, the whole variables menu should be reworked. I mean, it isn't hard to understand, but I definitely feel like it could be simpler. But if making it simpler isn't an option, then at least add percentages and string in the variable menu.

Why is this feature good?
This feature is great because of the following:
  • Having a percentage could help with functions that affect critical hits or some other game mechanic
  • Having percentages helps with custom menus and custom battle systems
  • Having string data typed in by the designer instead of by the end user will allow certain names to be recalled and remembered easier when referencing them in message boxes. Also gives the player the ability to rename something. For an example, let's say you stored the word "Mysteria" in Var 0001. Let's say you reference the town as that but you want the player to have the ability to rename it. Right now the only way to do that is to use an actor/hero slot. String data and name change could solve this.

Possible issues with this feature?
Issues that might arise from this feature:
  • People might think it's a waste of time (How hard is it to say variable is equal to variable divided by another variable * 100) but it would just be super helpful having it native to the engine/editor.
  • String data actually has limited functionality in most games, it's just a really nice feature to have in rare situations.
Think of the casual users who are either (a) math illiterate or (b) not aware how modular design works so they won't put a percentage formula in common events to get percentages easily.

Honestly, building percentages into the set variable would be very easy and could save a lot of time for casual users.

String data seems less useful in editor but I thought "why not do both" when I made this post
Let's see if I understand you. You want the ability to set a variable as either an float/integer variable, or a string? (Percents are float variables actually, as 100% is 1 in decimal form). Is that correct?
Sorry, but I don't understand what the feature is supposed to be here...
Let me explain two scenarios:

Let's say I am wanting to make a spell that only becomes available when my current HP is 25% of my total HP. Currently I would have to put the current HP into a variable, then take that variable and divide by total HP and restore it into that 1st variable, then take that 1st variable and multiply by 100 to get the percentage. My suggestion is to have that whole formula built into the variable menu. I'll let you figure out the best way to do that.

The second is let's say that the password to a door is "Purple" or "purple". I want to have that string data put into a variable so I could have the game change the password to "Pink" or "pink" later down the road based on conditional branches. Without "setting" a string variable in the editor, there's no way to do that without going into the scripting. Also, I want a "get player input" version of that too that brings up the player "type in a name/word" keyboard but stores that data into a variable instead of changing an actors name. This is especially helpful in an Earthbound clone game where the best magic spell in the game was your favorite thing.

But the percentages would really be helpful, this way it could scale with the game as your HP goes up. But it shouldn't be just locked to actor stats, we should be able to use percentages for just about anything should we want to.
The second is let's say that the password to a door is "Purple" or "purple". I want to have that string data put into a variable so I could have the game change the password to "Pink" or "pink" later down the road based on conditional branches. Without "setting" a string variable in the editor, there's no way to do that without going into the scripting.
Actually, string setting to a variable is easy.

Go to Control Variables, select your variable, then select Script, and put "Purple". The game variables actually can take any type of data.

Yeah, it's not obvious that you could do that, but it's there and you don't actually need to know how to code even if you used the "Script" option. So they could maybe adda new option that clearly says: "TEXT"

As for the first suggestion of %s, hmmmmmm... I can't think of a better way to implement a general purpose formula option for the variables instead of just using the Script option to write the formula.

Now if you only want it to work for certain % values rather than as a general formula, then they could just add new selections for the Actor Data option which says HP%, MP% and so on.

EDIT: Oh, hmmm... maybe a simple % option that allows you to select current value and maximum value.
Yeah a simple % option that let's you build a fraction and spit out a percentage really is the ideal solution.

Imagine building a CBS or CMS and you want to display a meter that represents the percentage. You can't do that without my formula. But what if you failed math in school and you didn't understand fractions or ratios or percentages? Do you just yield to a plugin? Or do you use the % button? Bam! Made the editor/engine user-friendly.

Percentages has other great benefits too. When using a RNG for a fetch quest (who does that - oh, right me), if my NPC asked for 21 feathers and I want them to switch dialogue for 12 feathers left, I would want a conditional branch for "If % is <50% then" so I could do this right. But if that same NPC did a RNG for 11 feathers, that same formula would work for 6 feathers this time.

Percentages work in other great ways too. If you combine this idea with the battler idea I have on here, the percentages really can impact how the actor or the monster behaves. Percentages are how most games do things, so why not make it easier for all users to implement it.
additionally, if it is about passwords I wouldn't use a variable at all - there is a tutorial on the official blogs on how to do a password with eventing only.
You need to use the "Name Input Processing" command on an actor that is never in any party (because that is the default way to input any string by player) and then simply use the conditional branch "actor name is XYZ" to check if the correct password is given
But what if you failed math in school and you didn't understand fractions or ratios or percentages? Do you just yield to a plugin? Or do you use the % button? Bam! Made the editor/engine user-friendly.
If I failed math and never understood fractions or ratios or percentages, how will I even know that I need a percentage? I'd probably be like: "What's a percentage?"

To be able to use the % button right, then you at least need to know what percentages are. So since I failed math and didn't understood percentages, I cannot use that button as I won't know what it is for.
additionally, if it is about passwords I wouldn't use a variable at all - there is a tutorial on the official blogs on how to do a password with eventing only.
You need to use the "Name Input Processing" command on an actor that is never in any party (because that is the default way to input any string by player) and then simply use the conditional branch "actor name is XYZ" to check if the correct password is given
I know how it is used in present day, my string data idea is to stop the duct tape and the Macguyver and just have it be a native option. We can all be crafty/witty/intuitive but the entry level casual user is who I make my ideas for. If the String data was more direct to variables, then it would be more user-friendly. But again, the tutorial would need to be brought over to the Steam users directly since most Steam owners are NOT crossing over to the website. I speak from experience and from observation.

If I failed math and never understood fractions or ratios or percentages, how will I even know that I need a percentage? I'd probably be like: "What's a percentage?"

To be able to use the % button right, then you at least need to know what percentages are. So since I failed math and didn't understood percentages, I cannot use that button as I won't know what it is for.
You can't play with a tool that isn't available. Isn't a large part of "coding" or "learning to code" playing with tools and seeing how they work?

I think it isn't too much to ask to put a % key in there. It's just a formula that can be calculated by the engine between two numbers. Honestly, it dumbfounds me how it's not there. Potions shouldn't heal 250 HP, it should heal 25% of HP; makes the potions less useless late game doesn't it? See, should be a native part of the engine.
I never said it's too much to ask for a % option.

Potions shouldn't heal 250 HP, it should heal 25% of HP; makes the potions less useless late game doesn't it? See, should be a native part of the engine.
But potions can do heal % HP already, and it doesn't even need variables. There's an effect option for both %HP heal and fixed HP heal for potions.

Find better examples 😛
I never said it's too much to ask for a % option.



But potions can do heal % HP already, and it doesn't even need variables. There's an effect option for both %HP heal and fixed HP heal for potions.

Find better examples 😛
Well I could come up with hundreds. My CMS and CBS ideas were pretty great for advanced users. The quest percentage is good for the mid-range users. How about adding percentage for items, like having an Exp Egg that increases exp earned by 5% or a Bank item that increases Gil by 2% interest.
both options are already possible, because the EX/SP-Parameters (like the experience rate) are already calculated in percentages.

There are a few advanced options where percentages in variables might be usable, but most basic uses for percentages are already handled by default.
@Andar

Your point is moot. Adding a percentage option is the least reconstructive thing I've asked over the last week. It's really just asking the engine to be a calculator, which it already does for +, -, *, /. So why not add in percentages?

Original thread: https://forums.rpgmakerweb.com/threads/percentages-and-strings-built-into-variable-editor.77483/