How to make a string accessable in dialogues and others

I am trying to make a plugin where one can access certain strings and use them in texts. Like in dialogue and such. However I cannot figure out how to actually do it in RMMV. I am familiar with javascript I am just puzzled in how to do this.


And this is just one part of many things the plugin will do.


Thanks for any help.
Control Variables will let you set a variable to a string, and you can use \v[id] in text to show what's in a variable.
Control Variables will let you set a variable to a string, and you can use \v[id] in text to show what's in a variable.

So the MV variables can be strings too?
yes.  You use the Script box at the bottom of the Control Variables command.
yes.  You use the Script box at the bottom of the Control Variables command.

Hmm that is basically it, how do I make a script that MV recognises?
Why are you trying to do this via script? What are the strings that need to be displayed?



I am saying you can use Control Variables, click on the Script box, and put in a string of text (or a formula that retrieves text from somewhere else).  Then you can use that variable in the Show Text command.


We're going around in circles now, so if you don't understand, it's best that you explain more fully what you are trying to do so I can give you a more specific answer.
Hmm that is basically it, how do I make a script that MV recognises?

Include accessors in your plugin that return a string, then you can call that accessor from the event to populate the variable with the string that you return.

Since you're trying to access the string from dialogue, this is really the only flow that you need unless you're using an alternative method of setting dialogue.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-string-accessable-in-dialogues-and-others.66543/