Replacing Weapons in DECORATE...
Posted: Sat Jul 04, 2009 5:07 pm
I've never really messed with making weapons before, and now I seem to be paying the price. What I want to do is replace some of the default Doom weapons with slightly altered ones. All I'm trying to do is modify the Spawn state so that it executes a script. What's the correct way to do this? I've tried...
I've also tried inherriting from the DoomWeapon class and replacing the shotgun like this...
The Shotgun is replaced with my _Shotgun, I can pick it up and the script gets run, so far so good. The problem I encounter is when using the weapon. Once I pick up the _Shotgun and it autoselects, I can't mouse-wheel to any of the other weapons. I have to select a weapon by pressing the coresponding # key. Then I can mouse-wheel between all other weapons except the _Shotgun, and I can't get back to it either by pressing 3. I tried adding the _Shotgun to slot 3 of the KEYCONF lump but that doesn't seem to make a difference. What am I ignorant about here, or can't this be done?
Code: Select all
actor _Shotgun : Shotgun replaces Shotgun
{
states
{
Spawn:
SHOT A 0
SHOT A 0 ACS_ExecuteAlways(992, 0, 5)
SHOT A -1
Stop
}
}
Code: Select all
actor _Shotgun : DoomWeapon replaces Shotgun
{
Game Doom
SpawnID 27
Weapon.SelectionOrder 1300
Weapon.AmmoUse 1
Weapon.AmmoGive 8
Weapon.AmmoType "Shell"
Inventory.PickupMessage "$GOTSHOTGUN" // "You got the shotgun!"
Obituary "$OB_MPSHOTGUN" // "%o chewed on %k's boomstick."
States
{
Ready:
SHTG A 1 A_WeaponReady
Loop
Deselect:
SHTG A 1 A_Lower
Loop
Select:
SHTG A 1 A_Raise
Loop
Fire:
SHTG A 3
SHTG A 7 A_FireShotgun
SHTG BC 5
SHTG D 4
SHTG CB 5
SHTG A 3
SHTG A 7 A_ReFire
Goto Ready
Flash:
SHTF A 4 Bright A_Light1
SHTF B 3 Bright A_Light2
Goto LightDone
Spawn:
SHOT A 0
SHOT A 0 ACS_ExecuteAlways(992, 0, 5)
SHOT A -1
Stop
}
}