RMMV JavaScript code/eval inside database text fields

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
232
Reaction score
83
First Language
Italian
Primarily Uses
RMMV
Hello guys! I was wondering if there was any plugin for RPG Maker MV to use JavaScript code/eval inside database text fields to display certain informations or texts.
For example, I would like to use some code like so:

JSEval.png

That would display the value of the variable 1 when playing the game. But that's just an example. I know there are some plugins to display the values of variables like that, but I would like to use any JavaScript code/eval inside any database field.

Here's another example:

JSCode.png
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
889
Reaction score
475
First Language
English
Primarily Uses
RMMV
I think the item description fields should take the standard control characters, so \V[id] should display a variable there.

A quick Google came up with this plugin to do the same thing in item names.

 

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
232
Reaction score
83
First Language
Italian
Primarily Uses
RMMV
Thank you! I was already aware of that plugin, but what I'm actually looking for is the possibility to use any JavaScript code inside the database text fields (so not just variables or escape codes).
 

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
132
Reaction score
95
First Language
English
Primarily Uses
RMMZ
Thank you! I was already aware of that plugin, but what I'm actually looking for is the possibility to use any JavaScript code inside the database text fields.
That would be a potentially game-breaking plugin with very specific requirements and would likely necessitate practically rewriting the entire engine.
If you're wanting the name or descriptions to change based on code, it would be easier to have a plugin made that can change them at will via a plugin command, and even THAT could come with some issues. Setting a variable there and then changing the variable's value elsewhere when needed would be the best solution.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,477
Reaction score
718
First Language
indonesian
Thank you! I was already aware of that plugin, but what I'm actually looking for is the possibility to use any JavaScript code inside the database text fields (so not just variables or escape codes).
yanfly message plugin have eval escape codes... but it only work in message... maybe you can combine it with global text code plugin?
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,928
Reaction score
1,393
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!
I have a Global Text plugin that you can use to use any escape code on any window:
Eli Global Text

Also, have one plugin that adds a lot of new escape codes
Eli Escape Codes

I just don't remember if the MV version of the escape codes has an eval javascript code to use, like "eval[$gameParty.leader().nickname()]"

If not, hold on that is very easy to add.
 

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
232
Reaction score
83
First Language
Italian
Primarily Uses
RMMV
yanfly message plugin have eval escape codes... but it only work in message... maybe you can combine it with global text code plugin?

Yeah, unfortunately that plugin would only work for messages.

Hi there!
I have a Global Text plugin that you can use to use any escape code on any window:
Eli Global Text

Also, have one plugin that adds a lot of new escape codes
Eli Escape Codes

I just don't remember if the MV version of the escape codes has an eval javascript code to use, like "eval[$gameParty.leader().nickname()]"

If not, hold on that is very easy to add.

Thanks! Your plugins are so useful, but I need to use JavaScript code inside the database, so not just escape codes. It would be great if you could make a plugin to use JavaScript code inside the database as if it was eval code for messages.

Looks like the Eli and/or Yanfly plugins have this covered, but in case it helps I have a plugin that lets you define your own escape codes:

Thank you! That's a great plugin, but as I said before, I need to use JavaScript code inside the database (not just escape codes for messages).
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,409
Reaction score
1,818
First Language
EN
Primarily Uses
RMMZ
I don't know about Eli's plugin, but mine works at the Window_Base level, so should be OK in any context that recognises escape codes. Eli's Global Text plugin looks like it lets you use text codes nearly anywhere, i.e. it lets all game windows recognise escape codes.

The only remaining issue I can see is that certain windows might not update at the appropriate times. Example from core scripts: you can use \V[x] in a skill's description but the help window only redraws when the selected skill/item changes.

[Edit: I just checked and Yanfly's Message Core also works for windows other than Window_Message.]
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,486
Reaction score
8,136
First Language
German
Primarily Uses
RMMV
I need to use JavaScript code inside the database
for what purpose? can you give a better example?

Because using any javascript code will never make sense there.

The database fields are all supposed to return values, nothing else. and any form of javascript code that can return values can be expressed in new text codes.
javascript code that does not return values doesn't make any sense directly. The only thing it would do would process those commands when the data is called in the engine, that means when it is displayed in one of the menues - and in such cases it would be easier to have the code in the code for the screen rather than in the data structure.

so please give an example that is more advanced than those simple text replacements you have so far.
 

Htlaets

Veteran
Veteran
Joined
Feb 1, 2017
Messages
114
Reaction score
75
First Language
English
Primarily Uses
Thank you! I was already aware of that plugin, but what I'm actually looking for is the possibility to use any JavaScript code inside the database text fields (so not just variables or escape codes).
Would be more efficient to pass the information to a variable and use \v[x]. You could have it constantly do so with an event that fires every time the menu opens or something like that.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,477
Reaction score
718
First Language
indonesian
Yeah, unfortunately that plugin would only work for messages.



Thanks! Your plugins are so useful, but I need to use JavaScript code inside the database, so not just escape codes. It would be great if you could make a plugin to use JavaScript code inside the database as if it was eval code for messages.



Thank you! That's a great plugin, but as I said before, I need to use JavaScript code inside the database (not just escape codes for messages).
i think eli plugin can do what you want... you just need to use the \Eval[formula] escape codes...
put your javascript formula there... you need escape code to tell the engine the difference between javascript or regular text... so you can make combination of it...
example:

Reid the \EVAL[$gameVariables.value(1)]

it should parse "Reid the " as it is and then will eval the formula inside the escape code...
so the resulting code will be "Reid the <replace this with variable 1 value>"

hope this help...
 

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
232
Reaction score
83
First Language
Italian
Primarily Uses
RMMV
Hey guys, I just wanted to say that I solved this by using @Eliaquim's plugins (Escape Codes and Global Text).
Thank you everyone for the help! <3
 

Latest Threads

Latest Profile Posts

Daz3D has the weirdest number scheme for model generations...
Genesis 4 is the 4th generation and oldest currently available, Genesis 1 is the 5th generation, Genesis 2 is the 6th, 3 is the 7th.... And then it goes Genesis 8. So 4, 1, 2, 3, 8. So when looking through there store you have to remember that sometimes they'll say 6 but they mean 3, and vice versa. :kaoswt:
Would opening a topic with the tutorial be interesting?

Forum statistics

Threads
111,112
Messages
1,058,371
Members
144,326
Latest member
orionalu
Top