[RMMV] I finally got a system set up to allow players to use Custom Pronouns. Is there an easier way for this?

I thought 'how hard could it be'?
Then it occurred to me that every instance of a pronoun would have to account for whether it would need to be capitalized or not. Hahaha. So I eventually frankensteined this monstrosity off basic coding tips on the Javascript site and some things I saw on here.
Woo.png


So for the sake of making me feel stupid, would there be an easier way to do this? I'm not exactly a coder so I might just be dumb.
What is $gameVariables.setValue(0)'s purpose ? You don't seem to use a variable ID 0, not even sure if a variable 0 exists to begin with. and you don't set it to anything, pretty sure setValue is a function that requires 2 arguments to begin with ?

Also copy/pasting your code for each actors or each whatever is unnecessary, you could just use a variable instead of actor(3), actor(4), actor(5), so that it would become actor($gameVariables.value(<variable id>)). Which will pretty much get rid of every copy/paste of the code you made.
Gonna be honest, I probably just copy pasted it so that I wouldn't keep having to go back to the site.
As for your second paragraph, I'm not sure what that actually means?

What I have set up is that the player can enter custom pronouns into Actors 2-5, (one for each form, Subjective, Objective, Possessive, and a secondary possessive for for cases like 'his' so I can't just add an s in text, then this runs, takes that text and capitalizes the first letter. Each pronoun is then stored as a Variable with the first letter capitalized so I can call on it whenever.

If you could write it out what you mean, I feel like I would understand better, sorry, I'm not really a coder.
Gonna be honest, I probably just copy pasted it so that I wouldn't keep having to go back to the site.
As for your second paragraph, I'm not sure what that actually means?

What I have set up is that the player can enter custom pronouns into Actors 2-5, this then runs, takes that text and capitalizes the first letter.

If you could write it out what you mean, I feel like I would understand better, sorry, I'm not really a coder.
I meant that you should use loops or labels. So that you don't have to write the same code for each actor. just replace the ID of the actor by a variable (in your code), set this variable and run the code.
Oh, so you mean like, set a game variable to equal the needed players name, then just use that variable in the code, right.
So outside of script Variable 1 = Actor 1's name, run script with Variable 1, then Variable 1 = Actor 2's name, repeat?
I meant that you should use loops or labels. So that you don't have to write the same code for each actor. just replace the ID of the actor by a variable (in your code), set this variable and run the code.
Actually, since each one has to get stored as a separate Variable, 1st instance assigns Variable 2. second instance assigns Variable 3, and so on, how would that work?
Yeah, there's a lot easier way.
Unfortunately it's a paid plug-in now but:
Message macros.
All you'd need to do is the following:
Use the plugin and turn on quick macros.
Let's say you have var 1, var 2, var 3, etc. for variations.
You can have a macro that calls var 1, let's say var 1 is the equivalent of She but different versions of it. You can make the call code for var 1 She. Now, going forward, type out every instance of uppercase she as \She and it'll be replaced by the player-customizable var 1.

Next, do the same for the other pronouns with different variables. So, now, in your text, you simply need to use a single gendered pronoun with a \ in front and it'll get changed into the player's preferred pronouns.

Only problem is that it's not case sensitive, but the way around it is to either A: edit the plugin to be case sensitive or B: Change the macros like so: \She and \1she for upper lower case.
Actually, since each one has to get stored as a separate Variable, 1st instance assigns Variable 2. second instance assigns Variable 3, and so on, how would that work?
No... I meant instead of this :
$gameActors.actor(2).name().chatAt(1);
(few lines below...)
$gameActors.actor(3).name().chatAt(1);
(few lines below...)
$gameActors.actor(4).name().chatAt(1);

just replace the first code by this :
$gameActors.actor($gameVariables.value(x)).name().chatAt(1);
so that you run the same code for each actor, instead of copying the code just to change the actor ID, why not set the actor ID in a variable to begin with ?
Assuming it's a single word that you want capitalised, use Control Variables and put the following in the Script line.

Code:
$gameActors.actor(2).name().charAt(1).toUpperCase() + $gameActors.actor(2).name().slice(1).toLowerCase()
Assuming it's a single word that you want capitalised, use Control Variables and put the following in the Script line.

Code:
$gameActors.actor(2).name().charAt(1).toUpperCase() + $gameActors.actor(2).name().slice(1).toLowerCase()
I would also replace 2 by a variable that I would define before definining this particular variable.

also you could always make a new variable for your actors like :
$gameActors.actor(2)._pronoun = "She" or whatever. then checking the "_pronoun" variable of the actor will give you its pronoun.
I would also replace 2 by a variable that I would define before definining this particular variable.

also you could always make a new variable for your actors like :
$gameActors.actor(2)._pronoun = "She" or whatever. then checking the "_pronoun" variable of the actor will give you its pronoun.
Variables didn't seem to persist outside of their initial script call the way I was doing this. I assumed it was just part of how the system worked, was that not right?
Assuming it's a single word that you want capitalised, use Control Variables and put the following in the Script line.

Code:
$gameActors.actor(2).name().charAt(1).toUpperCase() + $gameActors.actor(2).name().slice(1).toLowerCase()
This... is exactly what I was trying to do. I knew there had to be an easier way, jesus. That's a single line lmfao.
Yeah, there's a lot easier way.
Unfortunately it's a paid plug-in now but:
Message macros.
All you'd need to do is the following:
Use the plugin and turn on quick macros.
Let's say you have var 1, var 2, var 3, etc. for variations.
You can have a macro that calls var 1, let's say var 1 is the equivalent of She but different versions of it. You can make the call code for var 1 She. Now, going forward, type out every instance of uppercase she as \She and it'll be replaced by the player-customizable var 1.

Next, do the same for the other pronouns with different variables. So, now, in your text, you simply need to use a single gendered pronoun with a \ in front and it'll get changed into the player's preferred pronouns.

Only problem is that it's not case sensitive, but the way around it is to either A: edit the plugin to be case sensitive or B: Change the macros like so: \She and \1she for upper lower case.
Isn't that no different than just calling the \V[X]?
My problem was getting the variable to the proper value lol.
Isn't that no different than just calling the \V[X]?
My problem was getting the variable to the proper value lol.
Ah. I mean, it's still easier since you'd be able to just type normally, just adding a \ where appropriate rather than needing to memorize variable numbers.

But what you're trying to do is just to take the player input, capitalize it so you have it in a different variable for the start of sentences, right? Yeah, then Shaz's is the way to do it. I did something similar myself in a single line, so I didn't quite see what you were doing for what it was, sorry about that.
Variables didn't seem to persist outside of their initial script call the way I was doing this. I assumed it was just part of how the system worked, was that not right?
variables value do persist (inside $gameVariables), global JS variable too (at least if you put them inside the same script code in the common event).

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-i-finally-got-a-system-set-up-to-allow-players-to-use-custom-pronouns-is-there-an-easier-way-for-this.144038/