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

New weapon doesn't replace (GZDoom)

Recommended Posts

Posted (edited)

Hello, I know is a noobish and lame question but can someone help me with the code itself. I want to replace the pistol to a new pistol I made which is the P99. Here is the details:

ACTOR DoomGuy: DoomPlayer {
    Player.WeaponSlot 1, Fist, Chainsaw
    Player.WeaponSlot 2, P99
    Player.WeaponSlot 3, Shotgun, SuperShotgun
    Player.WeaponSlot 4, Chaingun
    Player.WeaponSlot 5, RocketLauncher
    Player.WeaponSlot 6, PlasmaRifle
    Player.WeaponSlot 7, BFG9000
}

ACTOR P99: Weapon Replaces Pistol {
    Weapon.SelectionOrder 50
    Weapon.AmmoGive 7
    Weapon.AmmoUse 1
    Weapon.SlotNumber 2
    Weapon.AmmoType "Clip"
    AttackSound "weapon/firehandgun"
    
    Weapon.BobSpeed 2.2
    Weapon.BobRangeX 0.4
    Weapon.BobRangey 0.2
    
    Inventory.PickupMessage "DoomGuy has picked up a Handgun"
    
    States 
    {
        Select:
            HGP9 A 1 A_Raise
            Loop
            
        Deselect:
            HGP9 A 1 A_Lower
            Loop
            
        Ready:
            HGP9 A 1 A_WeaponReady
            Loop
            
        Fire: 
            HGP9 C 1 A_PlaySound("weapon/firehandgun", CHAN_WEAPON)
            HGP9 C 1 A_FireBullets(1,1,1,7)
            HGP9 DEFGHB 2
            HGP9 A 0 A_Refire
            Goto Ready
            
        Flash:
            USGF A 6 BRIGHT
            Stop
    }

Edited by XCMachine

Share this post


Link to post

Try to use "pistol replaces pistol" instead of "weapon replaces pistol" and see if its work.

Share this post


Link to post

Copy all of the Player.StartItem lines from DoomPlayer, and then edit them so the player starts with your pistol replacement.  You need to copy all of them, or the player will start with only your pistol, and not the fist and ammo.

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
×