Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Kitty

A_SelectWeapon not working

Question

God damn, this stupid A_SelectWeapon("Unarmed") under rage wont select unarmed no matter what I do. I give up. Pleas Help.


 

Spoiler

 

ACTOR PerkDPlayer : Doomplayer
{
    player.startitem "Handgun"
    player.startitem "Unarmed"
    Player.StartItem "pistolammo", 60
    Player.WeaponSlot 1, Unarmed,PowerSaw
       Player.WeaponSlot 2, Handgun, Machinegun
    Player.WeaponSlot 3, PumpShotgun, BreakShotgun
    Player.WeaponSlot 4, Rifle, Gatlinggun
    Player.WeaponSlot 5, MissileLauncher,Laser
    Player.WeaponSlot 6, Plasmagun, BFG
    //Player.WeaponSlot 7, Laser
   States
   {
   Spawn:
      PLAY Z -1
      goto Spawn
   See:
      PLAY A 6
      PLAY B 6 A_SpawnItem("PlayerStep", 0, 0, 0, 0)
      PLAY C 6
      PLAY D 6 A_SpawnItem("PlayerStep", 0, 0, 0, 0)
      goto Spawn
    }
}

ACTOR WeaponBase: DoomWeapon
{
//    Inventory.PickupSound "items/weapon"
    Weapon.BobStyle  Smooth
    Weapon.BobSpeed  2.00
    Weapon.BobRangeX 0.25
    Weapon.BobRangeY 0.50
    Weapon.SelectionOrder 9999999
    
    States
    {
    Flash:
        TNT1 A 2 A_Light2
        TNT1 A 2 A_Light1
        Goto LightDone
    }
}
ACTOR Rage : Berserk Replaces Berserk
{

   States
   {
   Pickup:
      TNT1 A 0 A_GiveInventory("PowerStrength")
      TNT1 A 0 HealThing(100, 0)
      TNT1 A 0 A_SelectWeapon("Unarmed")
      Stop
   }
}
ACTOR "Unarmed" : WeaponBase replaces Fist
{
    Weapon.SelectionOrder 3700
    Weapon.Kickback 100
    Obituary "$OB_MPFIST"
    Tag "$TAG_FIST"
    Weapon.BobStyle  Alpha
    Weapon.BobRangeX 2
    Weapon.BobRangeY 1
    +WEAPON.WIMPY_WEAPON
    +WEAPON.MELEEWEAPON
    +WEAPON.NOALERT
    +PUFFONACTORS 
    States
    {
    Ready:
        PKFS A 1 A_WeaponReady
        Loop
    Select:
        PKFS AAA 0 A_Raise
        PKFS A 1
        Loop
    Deselect:
        PKFS AAA 0 A_Lower
        PKFS A 1
        Loop
    Fire:
        TNT1 A 0  A_JumpIfInventory("PowerStrength", 1,"Ragefire")
        PKFS LB 1 
        PKFS C 1
        PKFS D 1 Offset( 0, 34)
        PKFS E 0 
        {
        A_PlaySound ("weapon/Fist", CHAN_BODY);
        A_CustomPunch(4*random(2,3), TRUE, CPF_PULLIN | CPF_NOTURN, "BulletPuff", 64, 0, 0, NULL, "weapon/Fist/Hit","");
        }
        PKFS E 4 Offset( 0, 36)
        PKFS E 1 Offset( 0, 35)
        PKFS E 1 Offset( 0, 34)
        PKFS F 1 Offset( 0, 33)
        PKFS F 1 Offset( 0, 32)
        PKFS G 1
        PKFS HI 1
        PKFS JK 1
        PKFS L 1
        PKFS A 5 A_ReFire
        Goto Ready
        
//BESERK

    RageFire:
        TNT1 A 0 A_quake(1, 27, 0, 64, "")
        PKFS L 2 A_weaponoffset(0, 32, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(0, 33, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(2, 34, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(-2, 33, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(6, 35, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(2, 36, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(-2, 37, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(-6, 36, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(4, 41, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(8, 43, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(-4, 46, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(2, 47, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(3, 50, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(1, 51, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(-1, 53, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(-8, 55, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(1, 59, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(1, 61, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(0, 63, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(-1, 66, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(0, 70, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(-2, 71, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(0, 76, WOF_INTERPOLATE)
        PKFS L 1 A_weaponoffset(0, 80, WOF_INTERPOLATE)
        
        PKFS E 1
        {
        A_PlaySound ("caco/crash", CHAN_7);
        A_CustomPunch(4*random(30,40), TRUE, CPF_PULLIN | CPF_NOTURN, "RagePuff", 64, 0, 0, NULL, "monster/superdemon/explode","");
        A_quake(12, 12, 0, 64, "world/quake");
        }
        
        PKFS E 4 Offset( 0, 36)
        PKFS E 1 Offset( 0, 35)
        PKFS E 1 Offset( 0, 34)
        PKFS F 1 Offset( 0, 33)
        PKFS F 1 Offset( 0, 32)
    
        PKFS G 1
        PKFS HI 1
        PKFS JK 1
        PKFS L 1
        PKFS A 5 A_ReFire
        Goto Ready
    RageALTFire:
        PKFS LB 1 
        PKFS C 1
        PKFS D 1 Offset( 0, 34)
        PKFS E 0 
        {
        A_PlaySound ("weapon/Fist", CHAN_BODY);
        A_CustomPunch(4*random(2,3), TRUE, CPF_PULLIN | CPF_NOTURN, "BulletPuff", 64, 0, 0, NULL, "weapon/Fist/Hit","");
        }
        PKFS E 4 Offset( 0, 36)
        PKFS E 1 Offset( 0, 35)
        PKFS E 1 Offset( 0, 34)
        PKFS F 1 Offset( 0, 33)
        PKFS F 1 Offset( 0, 32)
        PKFS G 1
        PKFS HI 1
        PKFS JK 1
        PKFS L 1
        PKFS A 5 A_ReFire
        Goto Ready
    }
}

ACTOR "PowerSaw" : WeaponBase replaces Chainsaw
{
    Weapon.Kickback 0
    Weapon.SelectionOrder 2200
    Weapon.UpSound "weapons/sawup"
    Weapon.ReadySound "weapons/sawidle"
    Inventory.PickupMessage "$GOTCHAINSAW"
    Obituary "$OB_MPCHAINSAW"
    Tag "$TAG_CHAINSAW"
    
    +WEAPON.NOALERT
    States
    {
    Ready:
        SAWG CCDDEEFF 1 A_WeaponReady 
        Loop
    Select:
        SAWG AA 0 A_Raise
        SAWG A 1 
        Loop
    Deselect:
        SAWG A 0 A_Lower
        SAWG A 1 
        SAWG A 0 A_stopsound(CHAN_WEAPON)
        Loop
    Fire:
        SAWG A 0 //Radius_Quake(1,2,0,1,0)
        SAWG A 1 Offset( -1, 33) A_playsound("weapons/sawidle",chan_5)
        SAWG A 2 Offset( 0, 33) A_Saw("","weapons/sawhit", 2 ,"",100)
        SAWG B 1 Offset( 0, 33)
        SAWG B 1 Offset( 0, 34)
        SAWG A 0 //Radius_Quake(1,2,0,1,0)
        SAWG A 1 Offset( 0, 34)
        SAWG A 2 Offset( 0, 33) A_Saw("","weapons/sawhit", 2 ,"",100)
        SAWG B 1 Offset( 0, 32)
        SAWG B 1 Offset( -1, 32)
        SAWG B 0 A_ReFire
        Goto Ready
    AltFire:
        SAWG A 0 Radius_Quake(1,2,0,1,0)
        SAWG A 1 Offset( 0, 33)
        SAWG A 1 Offset( -1, 34) A_Saw("weapons/sawfull","weapons/sawhit", 1 ,"SawPuff",SF_NOPULLIN|SF_NOTURN,65,4,0)
        SAWG B 1 Offset( -2, 33)
        SAWG B 1 Offset( -1, 32)
        SAWG A 0 Radius_Quake(1,2,0,1,0)
        SAWG A 1 Offset( 0, 33)
        SAWG A 1 Offset( -1, 34) A_Saw("weapons/sawfull","weapons/sawhit", 1 ,"SawPuff",SF_NOPULLIN|SF_NOTURN,65,4,0)
        SAWG B 1 Offset( -2, 33)
        SAWG B 1 Offset( -1, 32)
        SAWG B 0 A_ReFire
        Goto Ready
    Spawn:
        CSAW A -1
        Stop
    }
}

ACTOR "Handgun" : WeaponBase replaces Pistol
{
    Weapon.SelectionOrder 1900
    Weapon.UpSound "weapons/pistolup"
    Weapon.AmmoUse 1
    Weapon.AmmoGive 24
    Weapon.AmmoType "PistolAmmo"
    Obituary "$OB_MPPISTOL"
    Inventory.Pickupmessage "$PICKUP_PISTOL_DROPPED"
    Tag "$TAG_PISTOL"
    scale 0
    
    decal bulletchip
    +WEAPON.WIMPY_WEAPON
    +WEAPON.NOAUTOFIRE
    +WEAPON.NOALERT
    +INVENTORY.UNDROPPABLE
    Scale .3
    States
    {
    Ready:
        PKPI A 1 A_WeaponReady
        Loop
    Deselect:
        PKPI AAA 0 A_Lower
        PKPI A 1
        Loop
    Select:
        PKPI AAA 0 A_Raise
        PKPI A 1 
        Loop
    Fire:
      PKPI A 0 A_PlayWeaponSound("weapons/pistol")
      //PKPI A 0 A_AlertMonsters
      PKPI A 0
      {
      A_ZoomFactor(0.99);
      }
      PKPI A 1 
      {
      //A_FireBullets(1.2,1.2,-1,Random(5,7),"BulletPuff");
      A_FireProjectile("PistolBullet",frandom(-1.2,1.2),1,0,0, FPF_NOAUTOAIM, frandom(-1.2,1.2));
      //a_setpitch (pitch-0.2);
      }
      PKPI A 0 A_SpawnItemEx("BulletCasing",30,0,30,Random(2,4),Random(3,6),Random(3,6),0, SXF_NOCHECKPOSITION)
      PKPI B 2 offset(0,33) 
      {
      //A_setpitch (pitch-0.1);
      A_GunFlash;
      A_ZoomFactor(1.0);
      }
      PKPI C 1 offset(0,34) //a_setpitch (pitch+0.2)
      PKPI EDBAA 2 offset(0,32) A_WeaponReady
      PKPI A 2 A_Refire
      goto ready
    Flash:
        PKPF A 1 Bright A_Light2
        PKPF A 1 Bright A_Light1
        Goto LightDone
    Spawn:
        PIST A -1
        Stop
    }
}

ACTOR Machinegun : WeaponBase 15105
{
    //Weapon.UpSound "weapons/machinegun/up"
    Weapon.UpSound "weapons/machineup"
    Weapon.AmmoType "PistolAmmo"
    Weapon.AmmoGive 20
    Weapon.AmmoUse 1
    Inventory.PickupMessage "$DED_GOT_MACHINEGUN"
    Tag "$DED_TAG_MACHINEGUN"
    Obituary "$DED_OB_MACHINEGUN"
    DamageType "DedMachinegun"
    Weapon.BobStyle  "InverseSmooth"
    Weapon.BobSpeed  2.25
    Weapon.BobRangeX 0.5
    Weapon.BobRangeY 0.25
    
    states
    {
    Ready:
        MEKG A 1 A_WeaponReady
        Loop
    Deselect:
        MEKG AAA 0 A_Lower
        MEKG A 1
        Loop
    Select:
        MEKG AAA 0 A_Raise
        MEKG A 1 
        Loop
    Fire:
        MEKF A 0 
        { 
        A_ZoomFactor(0.99);
        A_Quake(1,2,0,5,"");
        A_SpawnItemEx("BulletCasing",30,0,30,Random(2,4),Random(3,6),Random(3,6),0,SXF_NOCHECKPOSITION);
        }
        MEKF A 0 Bright A_FireProjectile("PistolBullet",frandom(-4.0,4.0),1,0,0, FPF_NOAUTOAIM, frandom(-2.0,2.0)) //A_FireBullets(4, 2, 1, Random(5,7), "BulletPuff")
        MEKF AA 0 
        {
        A_ZoomFactor(1.0);
        A_PlaySound("weapons/chngun", CHAN_WEAPON);
        A_setpitch(pitch-0.5); //A_PlaySound("weapons/machinegun/firex", CHAN_5);
        }
        MEKF A 1 Bright Offset( 0, 34) A_Jump(128, "FireAlt")
        MEKF B 1 Bright Offset(-1, 36)a_setpitch(pitch+0.2)
        MEKG A 1        Offset(-1, 35)a_setpitch(pitch+0.2)
        Goto FireDone
    FireAlt:
        MEKF A 1 Bright Offset( 0, 34)
        MEKF B 1 Bright Offset( 1, 36)
        MEKG A 1        Offset( 1, 35)
    FireDone:
        MEKG A 0 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH | WRF_NOBOB) // reset offsets
        MEKG A 1 Offset( 0, 34) A_Refire
        MEKG A 1 Offset( 0, 33) 
        Goto Ready
    Flash:
        TNT1 A 1 Bright A_Light1
        Goto LightDone
    Spawn:
        MEKP A -1
        Stop
    }
}

ACTOR "PumpShotgun" : WeaponBase replaces Shotgun
{
    Weapon.SelectionOrder 1300
    Weapon.UpSound "weapons/Shotgun1up"
    Weapon.AmmoUse 1
    Weapon.AmmoGive 8
    Weapon.AmmoType "Shell"
    Inventory.PickupMessage "$GOTSHOTGUN"
    Obituary "$OB_MPSHOTGUN"
    Tag "$TAG_SHOTGUN"
    
    decal bulletchip
    States
    {
    Ready:
        PKSG A 1 A_WeaponReady
        Loop
    Select:
        PKSG AAA 0 A_Raise
        PKSG A 1
        Loop
    Deselect:
        PKSG AAA 0 A_Lower
        PKSG A 1
        Loop
    Fire:
        PKSG A 2
        PKSG A 0
        {
        A_ZoomFactor(0.96);
        A_Quake(2,9,0,5,"");
        A_PlaySound ("weapons/shotgf", CHAN_WEAPON);
        }
        PKSG AAAAAAAAAA 0 A_FireProjectile("ShellBullet",frandom(-3.0,3.0),0,0,10, FPF_NOAUTOAIM, frandom(-3.0,3.0))
        PKSG A 2
        {
        A_FireBullets (11.2, 7.1, 4, 5, "ShellPuff");
        A_FireBullets (2.8, 0.8, 6, 5, "ShellPuff", "");
        A_GunFlash;
        }
        PKSG A 0 A_ZoomFactor(1.0)
        PKSG A 1 Offset( 0, 40) 
        PKSG A 1 Offset( -2, 40) 
        PKSG A 1 Offset(2,42)
        PKSG A 1 Offset(0,42)
        PKSG A 1 Offset(0,38)
        PKSG A 1 Offset(0,36) 
        PKSG B 2 
        PKSG C 1 
        PKSG D 1
        PKSG E 2
        PKSG F 4
        PKSG G 1
        PKSG H 2
        TNT1 A 0 A_spawnitemex ("shellcasing", 30, 0, 30, random(3,4), random(7,8), random(7,9), 0,SXF_NOCHECKPOSITION)
        PKSG GFEDCB 2
        Goto FireDone
    FireDone:
        PKSG A 0 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH | WRF_NOBOB) // reset offsets
        PKSG A 1 Offset( 0, 34) A_Refire
        PKSG A 1 Offset( 0, 33) 
        Goto Ready
    Flash:
        SHTF B 3 Bright A_Light2
        SHTF A 2 Bright A_Light1
        Goto LightDone
    Ready:
        SHTG A 1 A_WeaponReady
        Loop
    Spawn:
        SHOT A -1
        Stop
    }
}

ACTOR "BreakShotgun" : WeaponBase replaces SuperShotgun
{
    Weapon.SelectionOrder 400
    Weapon.UpSound "weapons/Shotgun2up"
    Weapon.AmmoUse 2
    Weapon.AmmoGive 8
    Weapon.AmmoType "Shell"
    Weapon.BobRangeY 0.75
    Inventory.PickupMessage "$GOTSHOTGUN2"
    Obituary "$OB_MPSSHOTGUN"
    Tag "$TAG_SUPERSHOTGUN"
    
    decal bulletchip
    +NOAUTOFIRE
    States
    {
    Deselect:
        PKS2 AA 0 A_Lower
        PKS2 A 1
        Loop
    Select:
        PKS2 AA 0 A_Raise
        PKS2 A 1
        Loop
    Fire:
        PKS2 A 3 
        PKS2 A 0
        {
        A_ZoomFactor(0.96);
        A_Quake(1,8,0,5,"");
        }
        PKS2 AAAAAAAAAAAAAAAAAAAA 0 A_FireProjectile("ShellBullet",frandom(-10.0,10.0),0,0,10, FPF_NOAUTOAIM , frandom(-10.0,10.0))
        PKS2 A 1 Offset( 0, 40) BRIGHT
        {
        A_Quake(3,9,0,5,"");
        A_FireBullets (11.2, 7.1, 20, 5, "ShellPuff");
        A_PlaySound ("weapons/sshotf", CHAN_WEAPON);
        A_GunFlash;
        }
        PKS2 A 0 A_ZoomFactor(1.0)
        PKS2 A 2 Offset( -1, 50) BRIGHT
        PKS2 A 1 Offset( -1, 52) 
        PKS2 A 1 Offset(0,48) 
        PKS2 A 2 Offset(0,44) 
        PKS2 A 2 Offset(0,40)
        PKS2 B 1 Offset(0,36)
        PKS2 B 1 Offset(0,34)
        PKS2 C 1 Offset(0,34)
        PKS2 C 2
        PKS2 D 3 
        PKS2 E 4 
        PKS2 F 3 A_OpenShotgun2
        PKS2 A 0 A_spawnitemex ("shellcasing", 30, 0, 20, random(0,1), random(-2,-3), random(9,10), 0,SXF_NOCHECKPOSITION)
        PKS2 A 0 A_spawnitemex ("shellcasing", 30, 0, 20, random(-2,-3), random(-5,-6), random(10,11), 0,SXF_NOCHECKPOSITION)
        PKS2 GHIJ 2
        PKS2 K 3
        PKS2 L 2 A_LoadShotgun2
        PKS2 M 3 
        PKS2 NOPQ 2 
        PKS2 R 3 A_CloseShotgun2
        PKS2 S 3
        Goto FireDone
    FireDone:
        PKS2 A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH | WRF_NOBOB) // reset offsets
        PKS2 A 1 Offset( -1, 34) A_Refire
        PKS2 A 1 Offset( 0, 33) 
        Goto Ready
    Flash:
        SHT2 J 3 Bright A_Light2
        SHT2 I 2 Bright A_Light1
        Goto LightDone
    Ready:
        PKS2 A 1 A_WeaponReady
        Loop
    Spawn:
        SGN2 A -1
        Stop
    }
}

Actor Rifle : WeaponBase 15101
{
  weapon.Slotnumber 2
  Weapon.UpSound "weapons/rifleup"
  Weapon.AmmoType "RifleAmmo"
  Weapon.AmmoGive 12
  Weapon.AmmoUse 1
  Weapon.BobSpeed  2.00
  Weapon.BobRangeX 0.5
  Weapon.BobRangeY 0.3
  Inventory.PickupMessage "You got the Rifle."
  Inventory.PickupSound "misc/w_pkup"
  Weapon.SelectionOrder 50
  Weapon.Kickback 10
  AttackSound "Weapons/RifleFire"
  Decal BulletChip
  States
  {
    Select:
        RIFG AAA 0 A_Raise
        RIFG A 1 
        Loop
    Deselect:
        RIFG AAA 0 A_Lower
        RIFG A 1 
        Loop
    Ready:
        RIFG A 1 A_WeaponReady
        Loop
    Fire:
        //RIFG A 0 A_JumpIfInventory("LaserAmmo", 1, 1)
        //goto FireEmpty6
        RIFG A 1
        TNT1 A 0 
        {
            A_Quake(1,8,0,5,"");
            A_WeaponOffset(0,36, WOF_INTERPOLATE);
        }
        RIFG I 1
        {
        //A_RailAttack(Random(24,26), 0, 1, "none", "ff ff a0", RGF_FULLBRIGHT| RGF_NORANDOMPUFFZ, 0, "RiflePuff", 0.6, 0, 0, 5, 0, 0, "rail_rifle", 0, 0, 2);
        A_PlaySound("Weapons/RifleFire",CHAN_WEAPON,1);
        A_FireProjectile("RifleBullet",frandom(-0.6,0.6),1,0,0, FPF_NOAUTOAIM, frandom(-0.6,0.6));
        A_GunFlash;
        }
        RIFG A 0 A_SpawnItemEx("RifleCasing",30,3,25,Random(2,4),Random(3,6),Random(3,6),0,SXF_NOCHECKPOSITION)
        RIFG B 1 A_WeaponOffset(0,34, WOF_INTERPOLATE)
        RIFG D 1
        RIFG FH 1
        //PLSG A 0 A_JumpIfInventory("LaserAmmo", 1, 1)
        //goto FireEmpty
        RIFG A 1 
        TNT1 A 0 
        {
            A_Quake(1,8,0,5,"");
            A_WeaponOffset(0,38, WOF_INTERPOLATE);
        }
        RIFG I 1
        {
        //A_RailAttack(Random(24,26), 0, 1, "none", "ff ff a0", RGF_FULLBRIGHT| RGF_NORANDOMPUFFZ, 0, "RiflePuff", 0.6, 0.6, 0, 5, 0, 0, "rail_rifle", 0, 0, 2);
        A_PlaySound("Weapons/RifleFire",CHAN_WEAPON,1);
        A_FireProjectile("RifleBullet",frandom(-0.6,0.6),1,0,0, FPF_NOAUTOAIM, frandom(-0.6,0.6));
        A_GunFlash;
        }
        RIFG A 0 A_SpawnItemEx("RifleCasing",30,3,25,Random(2,4),Random(3,6),Random(3,6),0,SXF_NOCHECKPOSITION)
        RIFG B 1 A_WeaponOffset(0,36, WOF_INTERPOLATE)
        RIFG D 1
        RIFG FH 1
        //RIFG A 0 A_JumpIfNoAmmo("Deselect")
        //goto FireEmpty
        RIFG A 1 
        TNT1 A 0 
        {
            A_Quake(1,8,0,5,"");
            A_WeaponOffset(0,42, WOF_INTERPOLATE);
        }
        RIFG I 1
        {
            //A_RailAttack(Random(24,26), 0, 1, "none", "ff ff a0", RGF_FULLBRIGHT| RGF_NORANDOMPUFFZ, 0, "RiflePuff", 0.6, 1.2,  0, 5, 0, 0, "rail_rifle", 0, 0, 2);
            A_PlaySound("Weapons/RifleFire",CHAN_WEAPON,1);
            A_FireProjectile("RifleBullet",frandom(-0.6,0.6),1,0,0, FPF_NOAUTOAIM, frandom(-0.6,0.6));
            A_GunFlash;
        }
        RIFG A 0 A_SpawnItemEx("RifleCasing",30,3,25,Random(2,4),Random(3,6),Random(3,6),0,SXF_NOCHECKPOSITION)
        RIFG B 1 A_WeaponOffset(0,40, WOF_INTERPOLATE)
        RIFG CD 1 
        RIFG EFGH 1 
        RIFG GFED 1 
        RIFG CJ 1
        //RIFG A 0 A_JumpIfNoAmmo("Deselect")
        Goto FireDone
    FireDone: 
        RIFG A 2 A_WeaponOffset( 0, 24, WOF_INTERPOLATE)
        RIFG A 2
        {
            A_WeaponOffset( 0, 28, WOF_INTERPOLATE);
            A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH); // reset offsets
        }
        RIFG A 2 A_Refire
        //TNT1 A 0  A_WeaponOffset( 0, 32, WOF_INTERPOLATE)
        Goto Ready
        /*
     FireEmpty:
        RIFG A 1 A_PlaySound("misc/w_pkup", 7)
        RIFG A 1 offset(0, 37)
        RIFG A 1 offset(0, 36)
        RIFG A 1 offset(0, 35)
        RIFG A 1 offset(0, 34)
        RIFG A 1 offset(0, 32)
        RIFG A 1 A_ReFire
        goto Ready
        */
     Flash:
        RIFG K 1 Bright A_Light1
        RIFG K 1 Bright A_Light2
        //RIFF C 1 Bright A_Light2
        TNT1 A 0 A_Light0
    Stop
    Spawn:
        RIFL A -1
        Loop
  }
}

ACTOR "Gatlinggun" : WeaponBase replaces Chaingun
{
    Weapon.SelectionOrder 700
    Weapon.UpSound "weapons/chainup"
    Weapon.AmmoUse 1
    Weapon.AmmoGive 30
    Weapon.BobRangeX 0.5
    Weapon.BobRangeY 0.3
    decal bulletchip
    Weapon.AmmoType "RifleAmmo"
    Inventory.PickupMessage "$GOTCHAINGUN" // "You got the chaingun"
    Obituary "$OB_MPCHAINGUN" // "%o was mowed down by %k's chaingun."
    Tag "$TAG_CHAINGUN"
    
    AttackSound "Weapons/MinigunFire"
    States
    {
    Ready:
        PKCG A 1 A_WeaponReady
        Loop
    Select:
        PKCG A 1 A_Raise
        Loop
    Deselect:
        PKCG A 0 A_Lower
        PKCG A 1 A_stopsound(chan_7)
        Loop
    Fire:
        PKCG A 1 A_PlaySound("weapons/schnready",CHAN_WEAPON,0.5)
        PKCG B 7
        PKCG C 6
        PKCG D 5
        PKCG AB 4
        PKCG CD 3
        PKCG ABC 2
        PKCG B 0 A_PlaySound("weapons/schnbakgrd2",CHAN_7,0.5, true)
        PKCG DABC 1
        PKCG D 1 A_Refire
        PKCG B 0 A_Jump(256,"NoFire")
    Hold:
        PKCG A 1
        {
        A_ZoomFactor(0.98);
        A_Quake(1,8,0,5,"");
        A_WeaponOffset(0,38, WOF_INTERPOLATE);
        }
        PKCG A 1 
        {
        //A_RailAttack(Random(24,26), 0, 1, "none", "ff ff a0", RGF_FULLBRIGHT| RGF_NORANDOMPUFFZ, 0, "RiflePuff", 5, 5, 0, 5, 0, 0, "rail_rifle", 0, 0, 2);
        A_PlaySound("Weapons/MinigunFire",CHAN_WEAPON,1);
        A_FireProjectile("RifleBullet",frandom(-5.0,5.0),1,0,0, FPF_NOAUTOAIM, frandom(-5.0,5.0));
        A_GunFlash;
        }
        PKCG A 0
        { 
        A_ZoomFactor(0.99);
        A_spawnitemex ("RifleCasing", 40, 0, 15, random(5,7), random(7,8), random(7,10), 0,SXF_NOCHECKPOSITION);
        A_setpitch(pitch-1);
        A_WeaponOffset(0,34, WOF_INTERPOLATE);
        }
        PKCG B 1 
        {
        A_ZoomFactor(1.0);
        A_setpitch(pitch+0.2); 
        }
        PKCG C 1 a_setpitch(pitch+0.2)
        PKCG D 1 a_setpitch(pitch+0.1)
        
        PKCG A 1
        {
        A_ZoomFactor(0.98);
        A_Quake(1,8,0,5,"");
        A_WeaponOffset(0,38, WOF_INTERPOLATE);
        }
        PKCG A 1 
        {
        //A_RailAttack(Random(24,26), 0, 1, "none", "ff ff a0", RGF_FULLBRIGHT| RGF_NORANDOMPUFFZ, 0, "RiflePuff", 5, 5, 0, 5, 0, 0, "rail_rifle", 0, 0, 2);
        A_PlaySound("Weapons/MinigunFire",CHAN_WEAPON,1);
        A_FireProjectile("RifleBullet",frandom(-5.0,5.0),1,0,0, FPF_NOAUTOAIM, frandom(-5.0,5.0));
        A_GunFlash;
        }
        PKCG A 0
        { 
        A_ZoomFactor(0.99);
        A_spawnitemex ("RifleCasing", 40, 0, 15, random(5,7), random(7,8), random(7,10), 0,SXF_NOCHECKPOSITION);
        A_setpitch(pitch-1);
        A_WeaponOffset(0,34, WOF_INTERPOLATE);
        }
        PKCG B 1 
        {
        A_ZoomFactor(1.0);
        A_setpitch(pitch+0.2); 
        }
        PKCG C 1 a_setpitch(pitch+0.2)
        PKCG D 1 a_setpitch(pitch+0.1)
        
        PKCG A 1
        {
        A_ZoomFactor(0.98);
        A_Quake(1,8,0,5,"");
        A_WeaponOffset(0,38, WOF_INTERPOLATE);
        }
        PKCG A 1 
        {
        //A_RailAttack(Random(24,26), 0, 1, "none", "ff ff a0", RGF_FULLBRIGHT| RGF_NORANDOMPUFFZ, 0, "RiflePuff", 5, 5, 0, 5, 0, 0, "rail_rifle", 0, 0, 2);
        A_PlaySound("Weapons/MinigunFire",CHAN_WEAPON,1);
        A_FireProjectile("RifleBullet",frandom(-5.0,5.0),1,0,0, FPF_NOAUTOAIM, frandom(-5.0,5.0));
        A_GunFlash;
        }
        PKCG A 0
        { 
        A_ZoomFactor(0.99);
        A_spawnitemex ("RifleCasing", 40, 0, 15, random(5,7), random(7,8), random(7,10), 0,SXF_NOCHECKPOSITION);
        A_setpitch(pitch-1);
        A_WeaponOffset(0,34, WOF_INTERPOLATE);
        }
        PKCG B 1 
        {
        A_ZoomFactor(1.0);
        A_setpitch(pitch+0.2); 
        A_WeaponOffset(0,32, WOF_INTERPOLATE);
        }
        PKCG C 1 a_setpitch(pitch+0.2)
        PKCG D 1 a_setpitch(pitch+0.1)
        
        PKCG B 0 A_ReFire
        PKCG B 0 A_stopsound(chan_7)
        PKCG A 0 A_PlaySound("weapons/schnend",CHAN_5,0.5)
        PKCG A 1 A_Weaponready
        PKCG BB 1 A_Weaponready
        PKCG CCC 1 A_Weaponready
        PKCG DDD 1 A_Weaponready
        Goto Ready
        
    NoFire:
        PKCG A 0 A_stopsound(chan_7)
        PKCG A 0 A_PlaySound("weapons/schnend",CHAN_5,0.5)
        PKCG A 1 
        PKCG BB 1 
        PKCG CCC 1 
        PKCG DDD 1 
        Goto Ready
        
    Flash:
        PKCF A 0
        PKCF A 0 A_Jump(128,4)
        PKCF A 1 Bright A_Light1
        PKCF B 1 Bright A_Light2
        PKCF A 2 A_Light1
        Goto LightDone
        PKCF C 1 Bright A_Light1
        PKCF D 1 Bright A_Light2
        PKCF A 2 A_Light1
        Goto LightDone
     Spawn:
         MGUN A -1
         Stop
    }
}

ACTOR "MissileLauncher" : WeaponBase replaces RocketLauncher
{
    Weapon.SelectionOrder 2500
    Weapon.UpSound "weapons/rocketup"
    Weapon.AmmoUse 1
    Weapon.AmmoGive 2
    Weapon.AmmoType "RocketAmmo"
    +WEAPON.NOAUTOFIRE
    Inventory.PickupMessage "$GOTLAUNCHER"
    Tag "$TAG_ROCKETLAUNCHER"
    States
    {
    Ready:
        PKRL A 1 A_WeaponReady
        Loop
    Deselect:
        PKRL A 1 A_Lower
        Loop
    Select:
        PKRL A 1 A_Raise
        Loop
    Fire:
        PKRL A 2 A_GunFlash
        PKRL A 4 
        PKRL B 2 
        TNT1 A 0 
        {
        A_Quake(2,10,0,5,"");
        A_ZoomFactor(0.95);
        }
        PKRL D 3{ 
        A_FireMissile;
        }
        PKRL C 1 A_ZoomFactor(1.0)
        PKRL C 2 a_setpitch(pitch-1)
        PKRL BE 2
        PKRL FG 1
        PKRL A 0 A_ReFire
        Goto Ready
    Flash:
        PKRF A 3 Bright A_Light1
        PKRF B 2 Bright
        PKRF C 2 Bright A_Light2
        PKRF DE 3 Bright
        Goto LightDone
    Spawn:
        LAUN A -1
        Stop
    }
}

ACTOR "Plasmagun" : WeaponBase replaces PlasmaRifle
{
    Weapon.SelectionOrder 100
    Weapon.UpSound "weapons/plasmaup"
    Weapon.AmmoUse 1
    Weapon.AmmoGive 40
    Weapon.AmmoType "Cell"
    Inventory.PickupMessage "$GOTPLASMA"
    Tag "$TAG_PLASMARIFLE"
       States
       {
    Ready:
        PLSG A 1 A_WeaponReady
        Loop
    Select:
        PLSG AAA 0 A_Raise
        PLSG A 1
        loop
    Deselect:
        PLSG AAA 0 A_Lower
        PLSG A 1
        Loop
    Fire:
        PLSF A 0 Radius_Quake(1,1,0,1,0)
        PLSF E 1 Bright A_FireProjectile ("smoothblueplasma", 0, true, 0, 0, FPF_NOAUTOAIM, 0)
        TNT1 A 0 bright 
        {
            a_setpitch(pitch-1);
            A_WeaponOffset(0,36, WOF_INTERPOLATE);
        }
        PLSF C 1 Bright a_setpitch(pitch+0.1)
        TNT1 A 0 A_WeaponOffset(0,32, WOF_INTERPOLATE)
        PLSF D 1 Bright a_setpitch(pitch+0.3)
        PLSF D 1 Bright a_setpitch(pitch+0.2)
        TNT1 A 0 A_ReFire
        PLSF E 1 Bright
        PLSF F 1 Bright
        PLSF E 1 Bright
        PKPL B 1
        PKPL DEF 1
        PKPL G 6
        PKPL FEDC 2 
        PKPL BA 1 
        Goto Ready
    Hold:
        PLSF A 0 Radius_Quake(1,2,0,1,0)
        PLSF E 1 Bright A_FireProjectile ("NewPlasmaBall", 0, true, 0, 0, FPF_NOAUTOAIM, 0)
        TNT1 A 0 bright 
        {
            a_setpitch(pitch-1);
            A_WeaponOffset(0,36, WOF_INTERPOLATE);
        }
        PLSF C 1 Bright a_setpitch(pitch+0.1)
        TNT1 A 0 A_WeaponOffset(0,32, WOF_INTERPOLATE)
        PLSF D 1 Bright a_setpitch(pitch+0.3)
        PLSF D 1 Bright a_setpitch(pitch+0.2)
        Goto Fire
       Flash:
          TNT1 A 1 A_Light1
          Goto LightDone
    Spawn:
        PLAS A -1
        Stop
       }
}

Actor "BFG" : WeaponBase replaces BFG9000
{    
    Height 20
    Weapon.SelectionOrder 2800
    Weapon.UpSound "weapons/BFGup"
    Weapon.AmmoUse 40
    Weapon.AmmoGive 40
    Weapon.AmmoType "Cell"
    Weapon.BobRangeX 0.5
    Weapon.BobRangeY 0.2
    +WEAPON.NOAUTOFIRE
    Inventory.PickupMessage "$GOTBFG9000"
    Tag "$TAG_BFG9000"
    States
    {
    Ready:
        BFGG A 1 A_WeaponReady
        Loop
    Deselect:
        BFGG A 1 A_Lower
        Loop
    Select:
        BFGG A 1 A_Raise
        Loop
    Fire: 
        BFGG A 20 A_BFGSound
        BFGG A 2 A_GunFlash
        BFGN A 2 A_ZoomFactor(0.99)
        BFGN A 2 A_ZoomFactor(0.98)
        BFGN A 2 A_ZoomFactor(0.97)
        BFGN A 1 A_ZoomFactor(0.96)
        TNT1 A 0 
        {
            //Radius_Quake(12,35,0,1,0);
            A_quake(12, 35, 0, 64, "world/quake");
            A_ZoomFactor(0.4, ZOOM_INSTANT | ZOOM_NOSCALETURNING);
            A_WeaponOffset(0,50, WOF_INTERPOLATE);
        }
        SBFG D 1 A_ZoomFactor(0.8, ZOOM_NOSCALETURNING)
        SBFG D 1 A_FireBFG
        TNT1 A 0 A_WeaponOffset(0,32, WOF_INTERPOLATE)
        SBFG D 1 A_ZoomFactor(1.0, ZOOM_INSTANT)
        SBFG D 1 a_setpitch(pitch-2.0)
        SBFG E 1 a_setpitch(pitch-1.6)
        SBFG E 1 a_setpitch(pitch+0.6)
        SBFG D 1 a_setpitch(pitch+0.6)
        SBFG D 1 a_setpitch(pitch+0.6)
        SBFG C 1 a_setpitch(pitch+0.6)
        SBFG C 1 a_setpitch(pitch+0.4)
        SBFG B 1 a_setpitch(pitch+0.4)
        SBFG A 1 a_setpitch(pitch+0.4)
        BFGG A 20 A_ReFire
        goto Ready
    Hold:
        BFGG A 20 A_BFGSound
        BFGG A 2 A_GunFlash
        BFGN A 2 A_ZoomFactor(0.99)
        BFGN A 2 A_ZoomFactor(0.98)
        BFGN A 2 A_ZoomFactor(0.97)
        BFGN A 1 A_ZoomFactor(0.96)
        TNT1 A 0 
        {
            //Radius_Quake(12,35,0,1,0);
            A_quake(12, 35, 0, 64, "world/quake");
            A_ZoomFactor(0.4, ZOOM_INSTANT | ZOOM_NOSCALETURNING);
            A_WeaponOffset(0,50, WOF_INTERPOLATE);
        }
        SBFG D 1 A_ZoomFactor(0.8, ZOOM_NOSCALETURNING)
        SBFG D 1 A_FireBFG
        TNT1 A 0 A_WeaponOffset(0,32, WOF_INTERPOLATE)
        SBFG D 1 A_ZoomFactor(1.0, ZOOM_INSTANT)
        SBFG D 1 a_setpitch(pitch-2.0)
        SBFG E 1 a_setpitch(pitch-1.6)
        SBFG E 1 a_setpitch(pitch+0.6)
        SBFG D 1 a_setpitch(pitch+0.6)
        SBFG D 1 a_setpitch(pitch+0.6)
        SBFG C 1 a_setpitch(pitch+0.6)
        SBFG C 1 a_setpitch(pitch+0.4)
        SBFG B 1 a_setpitch(pitch+0.4)
        SBFG A 1 a_setpitch(pitch+0.4)
        BFGG A 20 A_ReFire
        goto Ready
    Flash:
        BFGW A 2 bright
        BFGX HGFE 1 bright A_Light2
        BFGX DCBA 1 bright A_Light2
        TNT1 A 0 A_Light0
        Goto LightDone
    Spawn:
        BFUG A -1
        Stop
    }
}

actor Laser : Weapon 15106
{
   Weapon.UpSound "weapons/laserup"
   Weapon.AmmoType "HellEnergy"
   Weapon.AmmoGive 100
   Weapon.BobRangeX 0.75
   Weapon.BobRangeY 0.5
   +WEAPON.NOAUTOAIM
   Tag "$LITH_TXT_INFO_SHORT_PlasmaRifle"
   //Weapon.SlotNumber 6
   //Weapon.SlotPriority 1
   
   states
   {
   Spawn:
      TNT1 A 0
      LASR A 0 A_SpawnItemEx("Lith_PlasmaRiflePickup", 0,0,0, 0,0,0, 0)
      stop
   
   Ready:
      LASH A 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWUSER4)
      loop
   
   Deselect:
      TNT1 A 0 A_StopSound(CHAN_7)
      TNT1 A 0 A_StopSound(CHAN_6)
   DeselectLoop:
      TNT1 AAA 0 A_Lower
      LASH A 1
      loop
   
   Select:
      TNT1 AAA 0 A_Raise
      LASH A 1
      loop
      
   FireLaserReal:
      TNT1 A 0 A_AlertMonsters
      TNT1 A 0 A_FireBullets(0, 0, 1, 0, "Lith_PlasmaHit", FBF_NORANDOMPUFFZ)
      TNT1 A 0 A_RailAttack(random(4,5), 0, false, "None", "Red", RGF_SILENT|RGF_FULLBRIGHT|RGF_NOPIERCING , 3 , "LaserPuff", 0.4, 0.2, 1024, 1, 3, 0.5, "Lith_PlasmaLaze")
      stop
      
   Fire:
      TNT1 A 0 A_JumpIfInventory("HellEnergy", 1, 1)
      goto FireEmpty
      TNT1 A 0 A_TakeInventory("HellEnergy", 2, TIF_NOTAKEINFINITE)
      LASH A 1 A_PlaySound("weapons/laser/fire_start", CHAN_WEAPON, 0.4, false)
      TNT1 A 0 A_PlaySound("weapons/laser/fire_loop", CHAN_7, 0.4, true)
      TNT1 A 0 A_PlaySound("weapons/laser/fire_hum",  CHAN_6, 0.4, true)
      TNT1 AA 0 A_gunflash("FireLaserReal")
      LASG A 2 offset(0, 35) bright A_gunflash("FireLaserReal")
      
   FireLaserLoop:
      TNT1 A 0 A_Quake(1,8,0,5,"")
      TNT1 A 0 A_JumpIfInventory("HellEnergy", 1, 1)
      goto FireEmpty
      TNT1 A  0 A_TakeInventory("HellEnergy", 2, TIF_NOTAKEINFINITE)
      LASG B  1 offset(0, 39)  bright A_gunflash("FireLaserReal")
      LASG BB 1 offset(-2, 38) bright A_gunflash("FireLaserReal")
      LASG B  1 offset(1, 37)  bright A_gunflash("FireLaserReal")
      LASG B  1 offset(-1, 40) bright A_gunflash("FireLaserReal")
      LASG CC 1 offset(1, 37)  bright A_ReFire("FireLaserLoop")
      
   FireLaserDone:
      TNT1 A 0 A_StopSound(CHAN_7)
      LASH A 1 offset(1, 36) A_PlaySound("weapons/laser/fire_end", CHAN_WEAPON, 0.4, false)
      LASH A 1 offset(0, 35)
      LASH A 1 offset(0, 34)
      LASH A 1 offset(0, 33)
      LASH A 1 offset(0, 32)
      TNT1 A 0 A_StopSound(CHAN_6)
      LASH A 1
      goto Ready

   FireEmpty:
      TNT1 A 0 A_StopSound(CHAN_7)
      TNT1 A 0 A_StopSound(CHAN_6)
      LASH A 1 A_PlaySound("wweapons/laser/spark", Chan_7)
      LASH A 1 offset(0, 37)
      LASH A 1 offset(0, 36)
      LASH A 1 offset(0, 35)
      LASH A 1 offset(0, 34)
      LASH A 1 offset(0, 32)
      LASH A 1 A_ReFire
      goto Ready
   /*
   AltFire:
      //PLSG A 0 A_JumpIf(CallACS("Lith_GetPlayerData", pdata_upgrade, UPGR_PlasLaser), "FireReal")
      //PLSG A 0 A_JumpIf(CallACS("Lith_GetPlayerData", pdata_upgrade, UPGR_PartBeam), "FireReal")
      PLSG A 0 A_JumpIfInventory("LaserAmmo", 1, 1)
      goto FireEmpty
      LASG A 0 A_TakeInventory("LaserAmmo", 5, TIF_NOTAKEINFINITE)
      LASG A 0 A_gunflash("DummyFlash")
      LASG A 0 A_FireCustomMissile("Lith_PenetratingPlasmaBolt", frandom(-0.5,0.5), 0, 0, -9)
      LASG A 0 A_FireCustomMissile("Lith_PenetratingPlasmaBolt", 0, 0, 0, -9, "",frandom(-2.7, -1.9))
      LASG A 0 A_FireCustomMissile("Lith_PenetratingPlasmaBolt", 0, 0, 0, -9, "",frandom(-4.7, -3.9))
      LASG A 0 A_FireCustomMissile("Lith_PenetratingPlasmaBolt", 0, 0, 0, -9, "",frandom(2.7, 1.9))
      LASG A 0 A_FireCustomMissile("Lith_PenetratingPlasmaBolt", frandom(2.7, 1.9), 0, 0, -9, "",frandom(-2.7, -1.9))
      LASG A 0 A_FireCustomMissile("Lith_PenetratingPlasmaBolt", frandom(-2.7, -1.9), 0, 0, -9, "",frandom(-2.7, -1.9))
      LASG A 1 offset(0, 37) bright A_PlaySound("weapons/laser/altfire", CHAN_WEAPON)
      LASG C 1 offset(0, 36) bright
      LASH A 1 offset(0, 35)
      LASH A 1 offset(0, 34)
      LASH A 1 offset(0, 32)
      LASH AAAA 1 A_ReFire
      Goto Ready
      */
      AltFire:
      TNT1 A 0 A_JumpIfInventory("HellEnergy", 50, 1)
      goto FireEmpty
      TNT1 A 0 A_TakeInventory("HellEnergy", 50, TIF_NOTAKEINFINITE)
      LASG A 3 A_gunflash("DummyFlash")
      TNT1 A 0 
      {
        Radius_Quake(10,15,0,1,0);
        A_WeaponOffset(0,36, WOF_INTERPOLATE);
        A_FireCustomMissile("SuperDemonBall", frandom(-0.5,0.5), 0, 0, -9);
        A_FireCustomMissile("SuperDemonBall", 0, 0, 0, -9, "",frandom(-2.7, -1.9));
        A_FireCustomMissile("SuperDemonBall", 0, 0, 0, -9, "",frandom(-4.7, -3.9));
        A_FireCustomMissile("SuperDemonBall", 0, 0, 0, -9, "",frandom(2.7, 1.9));
        A_FireCustomMissile("SuperDemonBall", frandom(2.7, 1.9), 0, 0, -9, "",frandom(-2.7, -1.9));
        A_FireCustomMissile("SuperDemonBall", frandom(-2.7, -1.9), 0, 0, -9, "",frandom(-2.7, -1.9));
      }
      LASG A 1 offset(0, 37) bright A_PlaySound("weapons/laser/altfire", CHAN_WEAPON)
      LASG C 2 offset(0, 36) bright
      LASH A 1 offset(0, 34)
      LASH A 1 offset(0, 33)
      LASH A 1 offset(0, 32)
      LASH A 2 offset(0, 31)
      LASH A 2 offset(0, 30)
      LASH A 8
      LASH AAAA 6 A_ReFire
      Goto Ready
   }
}

 

 

Edited by Kitty : spoiler

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 1

The "Pickup" state sequence works only if the actor inherits from CustomInventory, yours inherits from Berserk.

Share this post


Link to post
  • 1
21 hours ago, Empyre said:

You defined a custom player class, but is it actually being used?

 

I've assumed that yes, otherwise the OP would surely notice greater issues than just A_SelectWeapon not working.

 

21 hours ago, Empyre said:

@scifista42The Pickup state does work when inherited from Berserk. I know because I have used it successfully before:

 

  Reveal hidden contents

ACTOR OPBerserk : Berserk replaces Berserk
{
  +INVENTORY.FANCYPICKUPSOUND
  Inventory.PickupSound "misc/p_pkup"
  Inventory.PickUpMessage "Berserk Sphere! You're a one-punch man now!"
  States
  {
  Spawn:
    OPBZ ABCDCB 6
    Loop
  Pickup:
    TNT1 A 0
    TNT1 A 0 A_GiveInventory("PowerStrength")
    TNT1 A 0 A_GiveInventory("OPBerserkHealth", 1)
    TNT1 A 0 A_SelectWeapon("OPFist")
    Stop
  }
}

 

 

You're right, Berserk itself inherits from CustomInventory and indirect inheritance works just as fine as direct one. That's how things work in current GZDoom, at least. Then my next guess is that the OP is also using an outdated version of the source port, although I find it hard to believe that some outdated version of the source port would support all the other features in the OP's DECORATE but not the Berserk thing. The only other guess is that the weapon "Unarmed" is in fact not working, either due to all of its sprites missing or some error in its definition, but I assume the OP made sure the weapon itself worked by selecting it normally before trying to select it with A_SelectWeapon.

Edited by scifista42

Share this post


Link to post
  • 0

First, it would be kind of you to put that long DECORATE code into a spoiler. Edit: I see that you did. Thank you.

 

You defined a custom player class, but is it actually being used? If not, then the player would not have the Unarmed weapon to switch to. You need to either use the GameInfo method or the older KEYCONF method:

https://zdoom.org/wiki/Creating_new_player_classes

 

@scifista42The Pickup state does work when inherited from Berserk. I know because I have used it successfully before:

Spoiler

ACTOR OPBerserk : Berserk replaces Berserk
{
  +INVENTORY.FANCYPICKUPSOUND
  Inventory.PickupSound "misc/p_pkup"
  Inventory.PickUpMessage "Berserk Sphere! You're a one-punch man now!"
  States
  {
  Spawn:
    OPBZ ABCDCB 6
    Loop
  Pickup:
    TNT1 A 0
    TNT1 A 0 A_GiveInventory("PowerStrength")
    TNT1 A 0 A_GiveInventory("OPBerserkHealth", 1)
    TNT1 A 0 A_SelectWeapon("OPFist")
    Stop
  }
}

 

Edited by Empyre

Share this post


Link to post
  • 0
14 hours ago, scifista42 said:

The "Pickup" state sequence works only if the actor inherits from CustomInventory, yours inherits from Berserk.

You are a life saver. I spent hours looking it up on zdoom wiki and couldn't figure that out. Its a funny thing how inheritance works.

 

Spoiler

ACTOR Rage : CustomInventory replaces Berserk

 

Edited by Kitty

Share this post


Link to post
  • 0

My code works in Zandronum, which is famously not the current GZDoom. For example, it doesn't support the anonymous functions I saw in Kitty's code.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×