GZDoom crashes when hitting User State keys with my mod.
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- JohnnyBGetgoode
- Posts: 39
- Joined: Tue Jul 10, 2018 9:29 am
- Location: East Coast USA
- Contact:
GZDoom crashes when hitting User State keys with my mod.
I'm currently developing a mod for GZDoom, which requires the use of the user states keys to change states on a weapon. But when I attempt to do so, the game crashes to desktop.
Attached is the crash report, along with a demo Wad that should show it happening. Lemme know if you need anything else.
I'd like to finish this mod, so any help or workarounds would be appreciated.
Attached is the crash report, along with a demo Wad that should show it happening. Lemme know if you need anything else.
I'd like to finish this mod, so any help or workarounds would be appreciated.
- Attachments
-
- ModCrash.wad
- Here's the Wad
- (1.85 KiB) Downloaded 22 times
-
- CrashReport.zip
- Here's the report.
- (23.17 KiB) Downloaded 24 times
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: GZDoom crashes when hitting User State keys with my mod.
I don't know if it's because the upload has failed or what, but I can't open this WAD - it appears to be corrupt. (And only 1.85 KB, at that.) Could you upload it somewhere like Dropbox or Google Drive?
- JohnnyBGetgoode
- Posts: 39
- Joined: Tue Jul 10, 2018 9:29 am
- Location: East Coast USA
- Contact:
Re: GZDoom crashes when hitting User State keys with my mod.
Honestly, I'm just having trouble with using ZDoom's demo record. I'll probably just upload a gif or something.wildweasel wrote:I don't know if it's because the upload has failed or what, but I can't open this WAD - it appears to be corrupt. (And only 1.85 KB, at that.) Could you upload it somewhere like Dropbox or Google Drive?
Is there anything that can be gleaned from the crash report at least?
EDIT:
https://gfycat.com/gifs/detail/UnkemptTornHoneyeater
That's what I'm seeing whenever I try to hit states keys with my mod.
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: GZDoom crashes when hitting User State keys with my mod.
Well, the crash is occurring within gzdoom.exe, which means this is either a bug with it, or a bug with your code - I'd like to look at your code, and I can't do so without a functional, non-corrupted copy of your WAD file. So could you upload it to Dropbox or Google Drive or some such place?
- JohnnyBGetgoode
- Posts: 39
- Joined: Tue Jul 10, 2018 9:29 am
- Location: East Coast USA
- Contact:
Re: GZDoom crashes when hitting User State keys with my mod.
oooooh, you needed my mod code...
*smacks head* Forgive me, for I am teh stupid.
https://drive.google.com/drive/folders/ ... Amod5QyGn0
Here you go.
*smacks head* Forgive me, for I am teh stupid.
https://drive.google.com/drive/folders/ ... Amod5QyGn0
Here you go.
Re: GZDoom crashes when hitting User State keys with my mod.
The crash was partly fixed in modern branch. In fact there are two related issues in the engine.
With the mentioned fix it no longer crashes the game but aborts VM instead
In this function player.mo becomes null after the following line
I cannot say what's wrong with it at the moment. Most likely a missing state was set on player pawn which could explain its premature destruction.
With the mentioned fix it no longer crashes the game but aborts VM instead
Code: Select all
VM execution aborted: tried to read from address zero.
Called from PlayerPawn.PlayerThink at gzdoom.pk3:zscript/shared/player.txt, line 1259
Code: Select all
player.mo.TickPSprites();
- JohnnyBGetgoode
- Posts: 39
- Joined: Tue Jul 10, 2018 9:29 am
- Location: East Coast USA
- Contact:
Re: GZDoom crashes when hitting User State keys with my mod.
Well, that's disappointing._mental_ wrote:The crash was partly fixed in modern branch. In fact there are two related issues in the engine.
With the mentioned fix it no longer crashes the game but aborts VM insteadIn this function player.mo becomes null after the following lineCode: Select all
VM execution aborted: tried to read from address zero. Called from PlayerPawn.PlayerThink at gzdoom.pk3:zscript/shared/player.txt, line 1259
I cannot say what's wrong with it at the moment. Most likely a missing state was set on player pawn which could explain its premature destruction.Code: Select all
player.mo.TickPSprites();
Perhaps there's a workaround. I may not need a custom thinker class to do what I'm doing. I just need some kind of variable that any Actor class can read and write to. I only did the thinker because the ZDoom wiki pointed me in that direction.
Any help in this endeavor would be appreciated.
Re: GZDoom crashes when hitting User State keys with my mod.
BTW the second weapon causes VM abort too but with a different callstack
Code: Select all
VM execution aborted: tried to read from address zero.
Called from ChromaScissors.StateFunction.56 at Chromagun-v01.pk3:actors/chromascissors/chromascissors.txt, line 79
Called from PSprite.SetState [Native]
Called from Weapon.A_Raise at gzdoom.pk3:zscript/inventory/weapons.txt, line 230
Called from weapon state ChromaScissors.19 in ChromaScissors
Called from PSprite.SetState [Native]
Called from PSprite.Tick at gzdoom.pk3:zscript/shared/player.txt, line 1353
Called from PlayerPawn.TickPSprites at gzdoom.pk3:zscript/shared/player.txt, line 413
Called from PlayerPawn.PlayerThink at gzdoom.pk3:zscript/shared/player.txt, line 1248
Re: GZDoom crashes when hitting User State keys with my mod.
EUREKA! I'VE FIXED IT!
Cheers on the log data for the weapon state calls, mental! That was the exact issue. I rewrote the weapon states for the starting gun, and presto, it works as intended!
Now to fix the second gun. Thanks a ton! You're a lifesaver!
Cheers on the log data for the weapon state calls, mental! That was the exact issue. I rewrote the weapon states for the starting gun, and presto, it works as intended!
Now to fix the second gun. Thanks a ton! You're a lifesaver!
- JohnnyBGetgoode
- Posts: 39
- Joined: Tue Jul 10, 2018 9:29 am
- Location: East Coast USA
- Contact:
Re: GZDoom crashes when hitting User State keys with my mod.
Fixed it!
Cheers on finding the state label call. That was the exact issue. I rewrote my state code, and now my mod works as intended!
Thanks mental, you're a lifesaver!
Cheers on finding the state label call. That was the exact issue. I rewrote my state code, and now my mod works as intended!
Thanks mental, you're a lifesaver!