Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

I just came up with a theory about why people may be having this problem. Is it possible that when you assign a global struct to an instance and delete that instance, it stays associated with that instance? When you re-battle an enemy, the enemy's instance that was created has a different id to the previous instance that was destroyed.

This occurs when you re-battle an enemy, battle an enemy of the same type, or exit and re-enter the room before re-battling the enemy. Is there a way to refresh global structs to their condition at game start?

EDIT: I fixed the bug! 

Instead of doing this:

global.enemies =
{
    slimeG: 
    {         name: "Slime",
I re-rote the enemies list to be more in line with the players list:
global.enemies = [
    {
        name: "Slime",
Instead of doing it the way Shaun had implemented it, I assigned a unique integer value to each enemy and manually assigned each enemy's name to an enumerator:
oBattleUnitEnemy,enemies[i]);
oBattleUnitEnemy,global.enemies[enemies[i]]);

I advise everyone facing this problem to do what I did.

Hello, could you describe the process from just downloading the base code to getting this bug to occur? I understand the theory behind the shallow reference of instance_create_depth somehow leading to incorrect garbage collection when the enemy instance is destroyed but I can't seem to replicate the issue on the basis of this theory. Potentially a runner patch of some kind may have fixed this?