J
Jaysin
Guest
Hi,
I'm Jaysin, I've been using GMS2 (IDE: 2.2.5.481 /// Runtime: 2.2.5.378) for the past few weeks after having initially tried it 2 years ago. I enjoy it a lot, but I've come across an issue that I'm concerned may be a bug. I'm getting a crash in the GMS2 Runner and when I build a Windows executable. The crash is 100% reproducible and seems to occur when my oPlayer object collides with the position of a pMonster object that has already been destroyed.
I'm trying to think how best to explain this since I'm relatively new and don't know the best way to share my code, so I apologize if this is a little messy. To start, I'm working on an RPG and I'm currently tackling the turn based battle system. I'm coding in GML.
As I mentioned, I have 2 main objects involved in the crash, oPlayer and pMonster (or in this case a child object of pMonster called oFire). pMonster has logic in it's Step event to move towards oPlayer if oPlayer is within a certain range. pMonster also has a Collision event for oPlayer that sets pMonster to persistent (oPlayer is already persistent), takes note of some variables for both objects as well as the current room, re-positions both objects for the battle room, and goes to a room called rBattle.
From here an object called oBattle takes over that controls the turn based battle system. Currently the battle system only allows running, for which I wanted to let pMonster return to the original room and be "dazed" or something so oPlayer can run away, but I also wanted to test defeating pMonster. pMonster has a Room Start event that destroys it if a boolean "defeated" is true. I setup the Run option in oBattle to set pMonster to defeated before returning to the original room, thus destroying pMonster when the room starts and because it was persistent it doesn't spawn a second pMonster where the first one originally was.
Now here's the problem. After doing this, if you move oPlayer to the position pMonster would be in the room, the Runner and Executable crash. Output in the IDE states "FAILED: Run Program Complete" and says to review the log, but there's nothing there short of a warning about the "Collision" layer not being present in some rooms (my oGame object disables it on Room Start so I can be lazy when making rooms). I thought somehow pMonster was still being created despite the persistence change so I checked with the debugger and there was no pMonster (oFire actually) present, its like I have something to collide with triggering the event but no actual instance, so it just crashes?
I tried searching for related issues or existing bugs, but couldn't find anything exactly related. I'm not sure if I can post my project or anything (again, still really new) and my code spans a couple scripts. I'm concerned that I may have done something in my code that is causing the crash, but I tried using breakpoints to pinpoint where and couldn't locate anything. Nonetheless, before I submit a bug report to YYG, I wanted to check with others in case I did do something stupid that is causing this.
Please let me know if I've done something wrong with this post, or if I should include any further information. Sorry in advanced if I did something wrong here, still learning.
Thank you,
Jaysin
I'm Jaysin, I've been using GMS2 (IDE: 2.2.5.481 /// Runtime: 2.2.5.378) for the past few weeks after having initially tried it 2 years ago. I enjoy it a lot, but I've come across an issue that I'm concerned may be a bug. I'm getting a crash in the GMS2 Runner and when I build a Windows executable. The crash is 100% reproducible and seems to occur when my oPlayer object collides with the position of a pMonster object that has already been destroyed.
I'm trying to think how best to explain this since I'm relatively new and don't know the best way to share my code, so I apologize if this is a little messy. To start, I'm working on an RPG and I'm currently tackling the turn based battle system. I'm coding in GML.
As I mentioned, I have 2 main objects involved in the crash, oPlayer and pMonster (or in this case a child object of pMonster called oFire). pMonster has logic in it's Step event to move towards oPlayer if oPlayer is within a certain range. pMonster also has a Collision event for oPlayer that sets pMonster to persistent (oPlayer is already persistent), takes note of some variables for both objects as well as the current room, re-positions both objects for the battle room, and goes to a room called rBattle.
From here an object called oBattle takes over that controls the turn based battle system. Currently the battle system only allows running, for which I wanted to let pMonster return to the original room and be "dazed" or something so oPlayer can run away, but I also wanted to test defeating pMonster. pMonster has a Room Start event that destroys it if a boolean "defeated" is true. I setup the Run option in oBattle to set pMonster to defeated before returning to the original room, thus destroying pMonster when the room starts and because it was persistent it doesn't spawn a second pMonster where the first one originally was.
Now here's the problem. After doing this, if you move oPlayer to the position pMonster would be in the room, the Runner and Executable crash. Output in the IDE states "FAILED: Run Program Complete" and says to review the log, but there's nothing there short of a warning about the "Collision" layer not being present in some rooms (my oGame object disables it on Room Start so I can be lazy when making rooms). I thought somehow pMonster was still being created despite the persistence change so I checked with the debugger and there was no pMonster (oFire actually) present, its like I have something to collide with triggering the event but no actual instance, so it just crashes?
I tried searching for related issues or existing bugs, but couldn't find anything exactly related. I'm not sure if I can post my project or anything (again, still really new) and my code spans a couple scripts. I'm concerned that I may have done something in my code that is causing the crash, but I tried using breakpoints to pinpoint where and couldn't locate anything. Nonetheless, before I submit a bug report to YYG, I wanted to check with others in case I did do something stupid that is causing this.
Please let me know if I've done something wrong with this post, or if I should include any further information. Sorry in advanced if I did something wrong here, still learning.
Thank you,
Jaysin