Items appearing in Inventory at random.

Hello all.

I have been working on my game for weeks now and many older or earlier areas in the game have been completed and not touched since I began the game. However, today when I play tested the game from the start, I started having things happen that never did any of the other 100 times I have play tested the game.

My character goes through a series of events within the first 5 minutes of the game. Everything functioned normally until today. All the sudden, random Items are showing up in their inventory after certain events. This would not normally be a problem but weapons that are not meant to be available until MUCH later in the game are popping into the inventory without any scripts or events telling them to. I have checked, re-checked and triple checked every single event the player comes into contact with in the first hour of the game. There is absolutely no reason that these items should be showing up in the inventory.

Any ideas? No events have been changed in days. The only thing I have done to the game itself all day is completely creating the entire weapons, armor and accessory data for the entire game. I had basic weapons and such before but decided to get a jump start on the items you will be able to get later on. Could this have somehow effected my game?

I have checked every event, every enemy drop, and every single tile for any events I might have started but not finished and still, I see nothing to justify those items showing up in the inventory.
The only fault I can place the blame on from this information is from a script. It's really the only thing which could possibly do that...

To test it out, you could try backing up your project and removing scripts one by one.
I have not added scripts of any kind, nor triggers, common events or variable switches. The game runs purely on the events available to me from the game engine itself.
I solved the problem but I am still unsure of WHY it kept happening. It was an early event with a walking monster, after defeating the monster Control Self Switch A comes on, a new even page goes active and originally I had exit event processing on. I turned it off and went to a blank page as I now know that works best for eliminating lag. However, when I switched to the new blank page, it was creating this random item drop that I talked about. I erased the event totally and started it from scratch, now no random items show in your inventory.

I am still not sure why this happened, as the event was replaced with an identical one but oh well. At least the problem is gone. I just hope it doesn't happen again anywhere in the game.
I had something similiar happen to me, also linked to an event that didn't have any commands in that area. But in my case, the items appearing were always the same (and at the same time, upon entering the map with the event) - and the problem was also locked with one of Yanfly's scripts (that also hadn't done anything directly with that).

After I deleted the event, the script worked perfectly again - but without the script, the event also worked perfectly.

I never was able to pinpoint the true error - and if it happened in your case without any scripts, it might be that the error in my case was only accidentally involving the other script.

It looks like under special circumstances, the interpreter can trigger commands that were not (or no longer) included in the events - but it needs another cause or condition for this, otherwise it would happen much more often than only two cases in half a year...

I'm closing this, because without more info we can't search for that error...

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/items-appearing-in-inventory-at-random.17230/