Help with error

I exported my game and sent it to a friend. When he opens he gets a screen saying Reference errors, but I can open it fine. Can anyone help? thx
To be more specific, the error says newstate is not defined
Can you please get a screenshot from your friend? Does this error happen as soon as he launches the game? Or does he get to the title screen and take some action (and if so, what action)?

Also a screenshot of your plugin manager (or several, if you have more than one screen worth).

Is this the first time you've given the game to your friend? Any chance he had a previous version and is trying to load a game he started in one of those versions?

@Nightfight , please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.


Since it's working on your end and not on your friend's end I will assume for that this is an issue with deployment. I will move the thread according to the root of the issue.

I've moved this thread to RPG Maker MV Deployment. Thank you.

Can you please get a screenshot from your friend? Does this error happen as soon as he launches the game? Or does he get to the title screen and take some action (and if so, what action)?

Also a screenshot of your plugin manager (or several, if you have more than one screen worth).

Is this the first time you've given the game to your friend? Any chance he had a previous version and is trying to load a game he started in one of those versions?

of course here:
also ik double post but i want to resolve this issue
Its when he hits game exe
He has not opened it before
This is the file i send also
And the other things I asked?

Instead of double posting, just edit your post and add the extra info, if nobody else has replied yet.
And the other things I asked?

Instead of double posting, just edit your post and add the extra info, if nobody else has replied yet.
ok did it
Maybe read my post again. Can't help until you give me all the information. There are at least 2 other things I asked for that you haven't provided or answered.
Maybe read my post again. Can't help until you give me all the information. There are at least 2 other things I asked for that you haven't provided or answered.

now it there (dang it. I hate double posting rule and break it, but how else r u supposed to know)
okay - double posting means posting twice in a row. If the last post is not yours, you can go ahead and post. If the last post is yours, you should edit it instead of posting again.

That is not your plugin manager.

Is this the first build you have given your friend? Did he have an earlier build and might have saved a game in that version?
okay - double posting means posting twice in a row. If the last post is not yours, you can go ahead and post. If the last post is yours, you should edit it instead of posting again.

That is not your plugin manager.

Is this the first build you have given your friend? Did he have an earlier build and might have saved a game in that version?

yeah he has an old build I told him to delete it didn't work
here is plugin manager
He may also need to delete any save files.

I am thinking you gave him your game, which he played and made one or more save files. Then you worked on the game some more, adding at least one plugin. Now when he plays it, that plugin is looking for a newState variable in the save files, and his save files don't have it because the plugin wasn't part of the game when he saved.

So two things you can do ...

Get him to delete the save files and then try to play the game.

Look at the code of all your plugins (luckily you don't have many) and see which one contains the word newState (case is important). This will not solve it, but it will identify that it IS a plugin issue and confirm my suspected reason.


edit: I believe the error is coming from the MouseSystem plugin. My guess is that your friend has a gamepad connected, and you do not. The aliased _updateGamepadState uses a variable called newState but does not define it. The original function defines it. But local variables in the original function are not available to the aliased function afaik, so I think this is a bug with the plugin.

The quick solution is to have your friend disconnect his gamepad. But you should look for a fix for this, or use a different mouse plugin.

That plugin actually says it requires TacticsSystem.js and you don't have that in your project at all. Why do you have the mouse system plugin?
He may also need to delete any save files.

I am thinking you gave him your game, which he played and made one or more save files. Then you worked on the game some more, adding at least one plugin. Now when he plays it, that plugin is looking for a newState variable in the save files, and his save files don't have it because the plugin wasn't part of the game when he saved.

So two things you can do ...

Get him to delete the save files and then try to play the game.

Look at the code of all your plugins (luckily you don't have many) and see which one contains the word newState (case is important). This will not solve it, but it will identify that it IS a plugin issue and confirm my suspected reason.


edit: I believe the error is coming from the MouseSystem plugin. My guess is that your friend has a gamepad connected, and you do not. The aliased _updateGamepadState uses a variable called newState but does not define it. The original function defines it. But local variables in the original function are not available to the aliased function afaik, so I think this is a bug with the plugin.

The quick solution is to have your friend disconnect his gamepad. But you should look for a fix for this, or use a different mouse plugin.

That plugin actually says it requires TacticsSystem.js and you don't have that in your project at all. Why do you have the mouse system plugin?

thanks the error was fixed
it was the mouse one which made it so when my friend plugged in a controller it wouldnt work
without a controller plugged in it works fine
If you want players to be able to use a controller, you'll need to get it fixed.

It might still pay to report the issue to the plugin creator, because that bit of code is only called when there IS a controller plugged in. So they have catered for people wanting to use one, but those are the people who will experience the crash.

And also, why do you even have that plugin? It specifically says it's to support another plugin that you're not using, so there's no point in having it. And it might cause other issues because you don't have the required plugin that it lists.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-error.118557/