Game Crashing with Read-Only error

Can anyone shed any light on what is causing this problem, or what it means?

After a while of playtesting my Inform game, I get the following error at the bottom of the game screen:


Without understanding what that even means (aside from it tried to write to something), i have no idea what is causing.

It seems to occur when my code has run that ‘kills a enemy’…moving it to a empty room and incrementing a integer variable counter.
It doesn’t happen the moment that happens, but shortly after.

Any help would be much appreciated.

That’s a low-level error message. It just indicates that some variable had an invalid value. Inform has pretty good run-time error checking, and can usually detect problems before they crash the interpreter. But in this case, something has snuck by.

This is a hard situation to deal with. You might try the RULES debugging command. That might show what rule is running when the error occurs.

Phew! I finally worked out what it was.

It was a conflict of two functions.

Killing an enemy moves it to a disconnected room, but I also had code that every 5 turns moves the enemy to an adjacent room to simulate movement.

That 5 turn code was causing the error, maybe trying to move it to a non-existent room…there are no adjacent rooms to the ‘killed enemies’ room.
Setting a variable that tells the 5 turn check to only move the enemy if its not dead seems to have stopped the error. fingers crossed

1 Like