Game Crashes When Deselecting Weapon (Not Typical Reason)

Bugs that have been investigated and resolved somehow.

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.
User avatar
ReedtheStrange
Posts: 226
Joined: Sun Sep 11, 2011 3:27 pm

Game Crashes When Deselecting Weapon (Not Typical Reason)

Post by ReedtheStrange »

Alright, I have assigned the weapon to the playerclass slotnumber 3, using both the coding for the weapon and the custom playerclass. When I omitted the weapon.slotnumber line, it worked for a few tries and I thought the problem was fixed. After replacing the sprites in Slade, it never worker again. I omitted it completely, saved the wad, then went back in and copied all of the data from a working weapon with the exception of giving it a different name, id and slotnumber, and no I did not forget to add to the playerclass inventory slot, but it still would not work. I can't find a single discrepancy in the coding no matter how many times I redo it. This really sucks because this weapon was fun to use. Either way, these problems make me want to punch a baby in the face.

Code: Select all

ACTOR Rakim1 : PlayerPawn
{
  Speed 1
  Health 100
  Radius 16
  Height 56
  Mass 100
  PainChance 255
  Player.Face "HRT"
  Player.DisplayName "Rakim Xavier"
  Player.CrouchSprite "RAKC"
  Player.StartItem "RakFist"
  Player.WeaponSlot 1, RakFist, EnergySaw
  Player.WeaponSlot 2, Handgun
  Player.WeaponSlot 3, Trenchgun, DoubleBarreledShotgun, AutoShotgun
  Player.WeaponSlot 4, SMG
  Player.WeaponSlot 5, PodRocketLauncher, MonsterHead
  Player.WeaponSlot 6, PulseRifle
  Player.WeaponSlot 7, XEAR
  Player.WeaponSlot 8, AtlasCannon
  Player.WeaponSlot 9, GodLobe
  Player.ColorRange 85, 100
  States
  {
  Spawn:
    PLAY A -1
    Loop
  See:
    PLAY ABCD 4 
    Loop
  Missile:
    PLAY E 12 
    Goto Spawn
  Melee:
    PLAY F 6 BRIGHT
    Goto Missile
  Pain:
    PLAY G 4 
    PLAY G 4 A_Pain
    Goto Spawn
  Death:
    PLAY H 10
    PLAY I 10 A_PlayerScream
    PLAY J 10 A_NoBlocking
    PLAY KLM 10
    PLAY N -1
    Stop
  XDeath:
    PLAY Q 5 A_PlayerScream
    PLAY R 0 A_NoBlocking
    PLAY R 5 A_SkullPop
    PLAY STUVWX 5
    PLAY Y -1
    Stop
  }
}


actor AutoShotgun : Weapon 300
{
   Weapon.SelectionOrder 700
   Weapon.AmmoUse 1
   Weapon.SlotNumber 3
   Weapon.AmmoGive 20
   Weapon.AmmoType "ShotgunShell"
   Inventory.PickupMessage "'Mess Maker' automatic shotgun" 
   Obituary "k% is a dick who spawns storymode-only weapons." 
   States
   {
   Ready:
     NOOB A 1 A_WeaponReady
     Loop
   Deselect:
     NOOB A 1 A_Lower
     Loop
   Select:
     NOOB A 1 A_Raise
     Loop
   Fire:
     NOOB A 4 A_FireShotgun
     NOOB A 0 A_ReFire
     Goto Ready
   Flash:
     NOOB B 5 Bright A_Light1
     Goto LightDone
     NOOB C 5 Bright A_Light1
     Goto LightDone
   Spawn:
     NUBW A -1
     Stop
   }
}
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by Xaser »

If you're posting this in the bugs forum, you'll be wanting to post the crash log, not the weapon code. If you're afraid it's a problem with the code, not the engine, the Editing forum is what you want. Though ideally the engine shouldn't crash in either case.

I'm not sure if this is the cause of your crash (can't say what the crash even is at the moment), but you don't need to have both Player.Weaponslot and Weapon.SlotNumber at once -- they're two ways of achieving the same result, so if you have a playerclass, you don't have to worry about defining that in the weapon definition. Doesn't seem to me like this sort of thing should cause a crash, but you did mention that removing it made it work for a time. Try it. :P
Guest

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by Guest »

Well, the game just freezes and so does my entire computer. I have to actually log off because the task manager isn't enough to kill the window.
Guest

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by Guest »

It doesn't just craash and show the doomguy holding his throat, my entire computer freezes. I actually have to log off my computer because the task manager isn't enough to close the window.
Guest

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by Guest »

Also, I would like to add that the game doesn't freeze when I press "3" while having it selected if I have the trenchgun for some reason. But curiously, it doesn't with the double-barrled shotgun.
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by TheDarkArchon »

Sounds like there's an 0-tic infinite loop somewhere that's triggering on death. Problem is that I don't see what it is.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by FDARI »

If you have a mod that contains only the weapon (with its slot assignment) and its graphics, do you get the same crash?

Is the trenchgun relevant because that also uses slot 3? I understand that thusly:
- Autoshotgun has slot 3
- Trenchgun has slot 3
- You have both of the above weapons, and weapons in other slots
- If you press 3 while autoshotgun is selected, trenchgun is selected
- If you press the key for another weapon while autoshotgun is selected, the game crashes/freezes

Then for the double barreled shotgun: Does it not freeze, or does it not not freeze? (Review your description if you don't understand my question.) Is the double-barreled shotgun also a slot 3 weapon? In which order do these weapons appear in slot 3? (Is it double-barre shotgun first, then autoshotgun, then trenchgun, or...)
Guest

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by Guest »

The only shotgun type that freezes upon pressing "3" while having it selected is the automatic shotgun. It does not freeze if the player has a normal trenchgun, but freezes if the player only has a double-barreled and the automatic shotgun. I had a similar issue with the monsterhead, but this was permanently fixed when I removed the weapon.slotnumber line from its coding. The fact that it worked temporarily for the automatic shotgun does worry me, however. If all else fails, there is justification for disabling the player's ability to drop the trenchgun because Rakim does use it to prevent himself from falling to his death in the novel, although I have not clearly shown this in the wad yet.
Guest

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by Guest »

The double-barreled shotgun, despite having almost the exact same coding as the supershotgun from Doom II, does the same thing if the player does not possess the trenchgun.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by FDARI »

Questions:
It seems nobody asked yet: What version/build of zdoom are you running?

Does the freeze happen immediately when you press 3, or after the weapon has gone some way down/all the way down?

Does it also freeze if you type SLOT 3 at the console? (It may well, because that's the default binding for pressing 3)

Other:
Currently examining the A_Lower function for possible causes. None found yet.

Unrelated peculiarity, two independent and mutually exclusive death handlers:
Spoiler: Oddity in A_Lower
Is it because PST_DEAD implies that the subsequent operation is not necessary?

I think I'll need to look a little further if A_Lower is where things go wrong.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by Blue Shadow »

I recall something like this happening to me with an older version of ZDoom, which has been fixed in newer versions, but I can't exactly remember which one.

What ZDoom version was GZDoom 1.2.01 based on? Because I think that is the one but I'm not sure.
Guest

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by Guest »

I'm running a fairly old version of Zdoom, which might be the problem. I also had a problem with a certain enemy type where when you would load a save on a map with them, 1/10 of the time, the game would freeze if you attempted to load a save. I can't even remember how I fixed it. I kept replacing its coding with monsters that worked and it didn't worked. I eventually just made an entirely new monster with its original coding and the problem seemed to disappear. This was not the case when I tried it with the two shotgun types, however. I think the best thing to do at this point may just be downloading a newer version of zdoom, or even using gzdoom.

The double-barreled and automatic shotgun freeze the second that you press "3" when you don't have the trenchgun. It hasn't frozen upon the player's death that I've observed so far.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by FDARI »

If it turns out to be a bug in the most recent version (which we can only know if you test it with the most recent version) the fix will be in a new version anyway. It may be possible to backport a fix to an older version of zdoom, but I see no reason to do so.

So... I think we need you to test it with the most recent version, and if it is indeed a zdoom-bug you will end up with a new version anyway. Care to try it out and give us a report?

In case you don't know where to find the latest build: http://svn.drdteam.org/zdoom/
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by amv2k9 »

Try making a backup that defines weapon slots in Keyconf instead of in Decorate.
Guest

Re: Game Crashes When Deselecting Weapon (Not Typical Reason

Post by Guest »

It has not appeared to be an issue.
Post Reply

Return to “Closed Bugs [GZDoom]”