TextCodeEscape - Escape script variables in text messages
I just created a simple text escape for script variables/expressions. It is pretty useful if you have variables on your JS script that you want to display in a text message, but don't want to assign them in a game variable (escaping with \V).The plugin is attached to this post.
To escape any JS expression: Hello, I have \S{myPlugin.numberOfApples} apples!
As it uses the eval function, you can't call functions that returns values, only variables or expressions. If any expression used causes an error that would crash your game, no worries, it is handled and logged (your message will reference the JS expression, thought).
Of course you won't be able to preview the message, as the variables are only available in game runtime.
Hope you guys enjoy it!
Terms:
Free for commercial
本贴来自国际rpgmaker官方论坛作者:PMantis13处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/textcodeescape-escape-script-variables-in-text-messages.128280/
页:
[1]