Jump to content
  • 0

Custom weapon zoom crashes the game?


_koraichu

Question

I'm still working on the rifle from the last post, but now a new issue hath arisen:

When I try to use the zoom function I added, GZDoom shits the bed. Completely locks up, then crashes (if I'm lucky).

 

This is what the section in DECORATE that covers the rifle looks like:

ACTOR Rifle : Weapon 10001
  {
     Inventory.Pickupmessage "You got the Rifle!"
     Weapon.SelectionOrder 350
     Weapon.AmmoType "Clip"
     Weapon.AmmoGive 24
     Weapon.AmmoUse 1
     Weapon.SlotNumber 8
     AttackSound "RifleFire" 
     States
     {
     Spawn: // This state is entered when you drop the weapon.
        BRFO A -1
        Stop
     Ready: // This state is entered when you have this weapon selected.
        BRFE A 1 A_WeaponReady
        Loop 
     Deselect: // This state is entered when you deselect the current selected weapon.
        BRFE A 1 A_Lower
        Loop 
     Select: // This state is entered when you select this weapon.
        BRFE A 1 A_Raise
        Loop 
     Fire: // The firing state.
        BRFE A 4
        BRFE A 0 A_FireBullets (0, 0, 1, 50)
        BRFF A 2 A_GunFlash // While on fire state it spawns the weapon's flash.
        BRFF B 3
        BRFE A 7 A_CheckReload
        BRFR A 14 A_OpenShotgun2
        BRFR B 14 A_LoadShotgun2
        Goto Ready
     Flash: // The weapons flash.
        BRFF A 2 bright A_Light1
        Goto LightDone
     AltFire: //The Alternate Fire (Zoom for this Weapon)
        BRFE A 0 A_ZoomFactor (3.0)
        Goto AltFireDone
     AltFireDone:
        BRFE A 0 A_ReFire
        Goto Ready
     }
  }

What've I done wrong this time?????

Xp

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 1

When you "zoom" here, your weapon loops between AltFire and AltFireDone in a 0-tic long cycle, which causes infinite freeze.

The zoom frame should have at least duration of 1.

Share this post


Link to post
  • 0

Your script looks entirely clear but there may be a very subtle syntax error.

 

There's a pretty complex way to debug it and I can provide steps but I can't ensure it will work for you since my knowledge on this is very limited.

Only thing I've found so far is opening GZDoom in an IDE, compiling a debug build, running the code, and then profiling it in a software like Visual Studio or CLion.

Not sure if you've tried this before.

 

GZDoom has been acting strange for me in the past few days like never before, maybe it's universal who knows. Sorry I'm not much of a help, hope you can get it working soon.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...