Game crashes and I don't know why

Hi there,

I have been working on my game for a long while now and I am literally *this* close to finsihing it. However I have come to a somewhat unknown problem. When I was playtesting I got a sudden recurrent error which says

ERROR: game_switch line 19: false can't be converted into an integer

or something like that, so I thought it was likely to be since I added a few bits which the old save wouldn't have (new skills and whatnot), but now My character doesn't move. I have tried different maps to ensure it wasn't an autorun problem and double checked my tilesets to ensure accessibility and by all rights my character should be moving fine. I checked and the error was coming from default script which I have not touched.

I use extra scripts which are as follows:

From Yanfly:

Core Battle Script

In-Game Party Switch

Element colouring

Enemy HP Gauge

Target Info

Absorb

TP manager

Enemy Level Scaling

Item Menu

From KMS:

Minimap

From William Coulard and Galv:

Land Vehicle

From Casper Gaming:

Vehicle Encounters.

The last thing I did between playtests before I had these sudden issues, was add notetags into certain maps to hide the minimap, which I then proceeded to confirm was not the issue by removing them.

Any help would be grand guys I don't want to be this close and have to start over.

L
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


Your character not moving may not be related at all, so let's work on one problem at a time.


"or something like that" is not helpful to us, or to you. Please show us the EXACT and FULL error message.


Does this error happen as soon as you start a new game? Or is it only when you load a saved game? Does it happen on all maps, or only one particular map? Does it happen as soon as you go onto that map, or do you do some action that triggers it? If you create a completely new map with NO note tags, then set your starting point on that map, then start a new game, does it happen?
Thanks for responding so quickly 🙂

THe error message is as follows word for word:

Script 'Game_Switches' line 19: TypeError occurred:
can't convert false into integer


This occurs only from a saved game when I enter the main 'world map' after 10 seconds exactly, it doesn't matter where you enter the map from (top or bottom)

As for the no movement issue, I created an empty map where my character should be able to move about with no events at all, and the chacter still couldn't move, however it was not a game crash or freeze since ocean animations etc still work.

If you need anything else please don't hesitate to ask guys and I'll respond as quickly as the admin will let me 🙂

L
Basically something in your game scripts tries to store a value (number) into a switch (or the other way around).


This can only occur if the data structure has been changed - and you provide the reason yourself: you loaded an savefile that is probably older than some of your scripts.


In 80% of all cases, you MUST start a new game after adding a script - because adding scripts often changes the data structure and invalidates all savegames from before that script.


As for the movement issue:


When that happens, can the player still turn without moving, or is even turning disabled?


Turning disabled: you have an active autorun on that map or on the common events


Turning possible: The position your player stands on is impassable or surrounded by impassable tiles. This can happen by choosing wrong tiles or by a broken passability in the tileset
I didn't consider checking the common events, since I don't use them, there was one on autorun and now my movement issue is fixed 🙂 Woohoo,

Unfortunately the error is still happening on my world map (I checked by starting a new game on the world map to see if that was also fixed). I double checked that the game was saved before playtesting, so any script that is run should be properly incorporated right? I did another check and it happens after 26 or 27 steps in the world map. Every time, I just realised this because I wasn't running around as I normally do in the game. I think its because It reaches an encounter then something breaks, since it's fine on the town maps I have where there are no encounters.
The we need links to your script (not only their names)


You might also try to use this to find out which scripts have been involved in the error (it's usually more than just the one where the error happens)


http://himeworks.com/2013/06/custom-main-full-error-backtrace/
That error acript really helped. It was a mess up in the vehicle encounter script, where it had been set to FALSE. I changed it to a switch number and it runs fine now. Thanks for all your help guys. 🙂

L
It is obvious what is causing the issue...


You entered an incorrect setting somewhere in a custom script. Search for any settings which may be related to switches.


One of them (or more) is set to 'false' which is not a correct setup most of the times.


Usually these scripts (Yanfly's especially) expect an integer number for every switch setup, and if you don't want to use that function, you can enter 0 as their value.


If you have entered 'false' as a value in a switch setting, than it will pass that as an index number for $game_switches, but, obviously, $game_switches[false] is not a correct syntax, as 'false' can not be used as an index identifier.


Search your scripts and correct the setting which causes the error.


Also this can happen with incorrect use of note-tags, so check your note-tags too, especially the ones related to switches.


Edit:


Ohh, 2 minutes late! 😛


At least you got the issue solved, right?
Haha late or not hopefully this will help someone else if they get into a similar jam.

Thank you all once again for all your help.

L

Original thread: https://forums.rpgmakerweb.com/threads/game-crashes-and-i-dont-know-why.40000/