Bug Fixes for Both of RMXP's Interpreter's Script Commands
Introduction
For ages we've known very well that the RMXP Interpreter class had an issue with command_355 aka the script event command. It has to evaluate the result of a script pasted as mere text in a very small window.
The problem was that certain non truthy values, anything that doesn't return true as end result, might get ignored by the game engine. This part and its related solution are nothing new in the XP community and I just "copied & pasted" that centuries old solution here.
Nonetheless, that's not all this scriptlet has to offer. I was discussing some issues with XP in a VX ACE channel when I noticed there was another bug that usually got ignored in RMXP. It was the script condition in the conditional branch event command! Shocked
The issue is very simple. You open the conditional branch and choose the script condition and type something there that's supposed to return a boolean value. (No if conditional reserved term is required there.) Now you'd expect me to tell you that it had the same issue the script command has... but nope, that's not the case here.
Both a truthy (true) and a falsey (false) value are fine and work just as intended. Yet, here comes the dreadful nil value into play!
Whenever your call returns a nil, your check becomes invalid and the engine simply skips it. Just like that, guys!
Don't worry pals!
The scriptlet below has come to Save-Point to solve that issue! :issue:
The Script
Ruby:
Infrequently Asked Questions
Q: Has anybody else posted anything like this before?
A: Who knows? In any case I preferred to leave the script here just in case anybody fiddling with RMXP ever needs it.
Terms & Conditions
You can do whatever you want with it, I just built something upon somebody else's work and that's it.
本贴来自国际rpgmaker官方论坛作者:kyonides处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/script-commands-bug-fixes.154416/