Script Commands Bug Fixes
#3
Why I Had to Update The Script Once Again

After receiving some Bug bug reports by someone Dog I won't mention here, I noticed something ELSE. Yes, that was NOT the end of the story, guys. Incredible
Fine, Melana. Boring Start complaining now Laughing because you gotta keep Book reading to find out what else has transpired in the maker world since my previous post.

What I told you before was half the truth of what had occurred to RMXP's Interpreter class.

SUMMARY
  • The issue that made the RMXP engine get stuck after a script call event command was a real pain you know where. Tongue sticking out
    Both false and nil results, both considered falsey values, were the worst nightmare Freddy Kruger RMXP Interpreter class had ever experienced.
  • if result == false conditional statement was not the true culprit.
    That was nothing but a goon, but the actual mastermind was in another castle, Mario! Laughing
    It just was a symptom of a bigger issue we had not detected before or preferred to ignore it altogether for undisclosed reasons.
  • @index += 1 addition was mandatory for sure.
    Yet, the condition that made it relevant according to my previous post was WRONG. Thus, it had to be replaced by another one.
  • The need for preparing the event for processing the next event command was real.
    Again, what was terribly wrong was the condition that would apply the fix where it was relevant.
  • I had introduced another Bug bug because of ignoring the second point indeed.

THE ROOT CAUSE

It was located in the Interpreter class for sure but it was in the script section known as Interpreter 1. There you can find a method called update which is very important, especially true if you're an eventer. Yes, eventers depend on it 100% or else they'd lose control of the map forever and ever Happy with a sweat or till they finally Killer kill the application.
There returning a false or nil value as the end result of execute_command event command became a terrible issue!
Yes, I know that this part of the explanation sounds rather old, yet, that's on purpose even if that's not the end of the story. Shocked

Why is it important?

You would understand the issue if you focus on this section of the update method:

Code:
if execute_command == false
  return
end

What you can read there created the issue, even if it was not supposed to. You see, there are other methods that return a false value on purpose! Feeling sick What a mess!

After analyzing those other methods, I came up with 1 out of 2 simple conclusions.

1. They had something in common: they were disruptive by nature! Shocked

If you called another type of scene or a gameover or anything the like, the engine was supposed to halt the execution of the update command ASAP.

2. Script Call event command was ALSO supposed to be just as disruptive as the calls to other scenes if the end result was false.

Here I guess that the Script Call command was intended to be used as some sort of multi-line condition and not really as an evaluation of a whole script or an internal or external method call. The only "official" way to prevent this from ever happening was to return true at the end of our call.

Where did I get that?

If I had only purchased RMXP, I'd probably still ignore the real issue. Nonetheless, having legal access to RMVX and RMVX ACE widened my perspective quite a bit. IIRC, you won't find the exact same issue there, especially in VX ACE. For some reason I haven't studied so far, VX does have a problem with either false or nil values, but only one of them is a pain...

VX ACE actually changed the way the methods are executed, by not testing the result of evaluating the script, to prevent it from changing the event processing based on its interpretation of that old event command over and over again, freezing the maker permanently. OR ignoring the event commands that come after a script call with false or nil as its return values.

The Real Fix

This is the most excentric part of the whole story. It's a mix of the good old "change the value of the result local variable" approach PLUS my @index += 1 increase without ignoring the issues caused by nil. The thing is that I had to properly find the best place to change the @index without altering any other event commands. That perfect place is inside the very same condition that started it all: if result == false itself! Laughing
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Messages In This Thread
Script Commands Bug Fixes - by kyonides - 02-13-2025, 04:06 AM
RE: Script Commands Bug Fixes - by kyonides - Yesterday, 04:15 AM
RE: Script Commands Bug Fixes - by kyonides - Yesterday, 07:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   The Steal and Peep Script DerVVulfman 12 759 02-19-2025, 07:20 AM
Last Post: Ace_V
   Text Scroll Script - Enhanced DerVVulfman 23 36,129 02-18-2021, 04:16 AM
Last Post: DerVVulfman
   Cursor Script Selwyn 7 16,258 09-28-2019, 02:13 PM
Last Post: DerVVulfman
   ACBS FIX SCRIPT #2: Advanced Cry Correction DerVVulfman 1 5,057 08-09-2019, 03:42 PM
Last Post: aeliath
   ACBS FIX SCRIPT #1: Victory Cries Patch DerVVulfman 1 5,160 08-08-2019, 02:53 PM
Last Post: aeliath
   Spritesheet Generator Conversion Script DerVVulfman 0 4,577 11-21-2018, 04:48 AM
Last Post: DerVVulfman
   Event Spawner Fixes DerVVulfman 8 17,798 01-02-2018, 05:48 AM
Last Post: DerVVulfman
   Neo Mode 7 Script by MGCaladtogel MGC 59 130,182 09-29-2017, 03:48 AM
Last Post: DerVVulfman
   Longer Script Calls LiTTleDRAgo 0 5,196 05-17-2017, 12:36 AM
Last Post: LiTTleDRAgo
   SLOLS: Snake Look-alike on Load Script Zeriab 3 11,861 05-14-2017, 06:25 PM
Last Post: LiTTleDRAgo



Users browsing this thread: 1 Guest(s)