Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Event script error, RMXP or Me?

Hi All,

I know I ask a lot of questions, but I attempt to answer as many as I can as well.

Anyway, I have an event, that reads like this

Code:
Control Self Switch: A = On
Script: set_quest_completed(1)

Now, the method it's calling is this:
PHP:
def set_quest_completed(qid)
    if $quest[qid] # quest already taken
      $power += 20
    else # quest not taken
      $qid = qid
    end
    Audio.me_play("Audio/ME/Quest_Complete.mid", 100, 100)
    $quest[qid].failed = false
    $quest[qid].completed = true
    $quest[qid].active = false
end

When I run the event, I get an infinite loop, it's actually calling the above method an infinite amount of times, I've tested it with "p" commands.

Also, it doesn't go anywhere else. Just to that method, and the event isn't looping because I have a "Show Text" in there that only displays once.

So, the problem is SOLVED however, if the event reads like this:
Code:
Control Self Switch: A = On
Script: 
        :set_quest_completed(1)

The ONLY thing that changes between test runs is the BLANK line before the method call in the script.

It runs perfectly if that line is there, and it loops infinitaly if it's not there.

I tried several searches, hoping that RMXP just loops script if it's only one line, but I could find nothing.

So, would anyone care to help me out on this issue?

Thanks in advance,

-Webgovernor

Edit: I've noticed that dissabling different windows, including Enterbrain's windows, causes the loop to eventually break. This is extremely odd behavior.
 
Nope...

Not a parallel process event. I quadruple checked that, almost obsessively. However, the problem whent away after restarting RMXP... odd. The program was running for a few weeks now, and this is the first restart since then.

I've been unable to reproduce the error, and I didn't change a damn thing. At all. I'm assuming RMXP stores some stuff in memory during the run process, and that it continually resides in the system memory untill it's closed, without refreshing. Thus causing corrupted data because we all know what happens to memory without a constant refresh within (6-8 hours of access with DDR-SDRAM).

Anyway, I appreciate the help, but it appears solved...?

Thanks again.
 
There is a bug in the default script (actually there are many...) where a Call Script instruction that has only one line and that returns false hangs the game. Make a Call Script and put "x = false" in it. You'll see. The method you have posted returns false so I think this is what froze your game.

I made a long topic to document this bug and introduce bug fixes, but it was on .net and now it is out of the picture.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top