[1.0.22] Crash report
Posted: Mon Jan 22, 2007 10:01
This crash happens with a mod that contains the following weapon:
[spoiler][/spoiler]
The weapon is an assault rifle with three modes of fire: single, burst, and auto. Single and burst are handled by primary while auto takes up the altfire. I wanted to add a grenade launcher onto this, so I created a sister weapon, "GRifle", that launches the grenade. The powerup allowing the sister weapon use is activated and deactivated by using an item, "Underslung". This item is given to the player when the rifle is selected. To keep things clean and easy to use, both the powerup and the "Underslung" item are removed from the player while the rifle is being lowered.
The crash happens if I do the following in order:
[spoiler]
Code: Select all
ACTOR Rifle : Weapon replaces Pistol
{
Weapon.SelectionOrder 1400
Weapon.AmmoGive 30
Weapon.AmmoUse1 1
Weapon.AmmoType1 Clip
Weapon.AmmoUse2 1
Weapon.AmmoType2 Clip
+weapon.alt_ammo_optional
weapon.kickback 20
weapon.sisterweapon GRifle
Inventory.PickupSound "misc/w_pkup"
Inventory.PickupMessage "You got the rifle!"
radius 20
height 16
Decal "BulletScratch"
AttackSound "weapons/rifle"
Obituary "%o was penetrated by %k's supersonic rounds."
States
{
Ready:
RIFG A 1 A_WeaponReady
Loop
Select:
RIFG B 1 A_GiveInventory ("Underslung", 1)
RIFG B 1 A_Raise
RIFG B 0 A_Raise
Goto Select+1
Deselect:
RIFG B 0 A_TakeInventory ("Underslung", 1)
RIFG B 0 A_TakeInventory ("PowerWeaponLevel2", 1)
RIFG B 1 A_Lower
RIFG B 0 A_Lower
Goto Deselect+2
Fire:
RIFG A 0 A_GiveInventory("FirstBullet", 1)
RIFG A 2 A_GunFlash
RIFG B 1 A_FireBullets (0, 0, 3, 4, "BulletPuff")
RIFG A 12 A_Refire
Goto Ready
Hold:
RIFG A 0 A_JumpIfInventory("FirstBullet", 1, 7)
RIFG A 2 A_GunFlash
RIFG B 1 A_FireBullets (1, 2, 1, 6, "BulletPuff")
RIFG A 2 A_GunFlash
RIFG B 1 A_FireBullets (2, 3, 1, 6, "BulletPuff")
RIFG A 2 A_GunFlash
RIFG B 1 A_FireBullets (2.5, 4, 1, 6, "BulletPuff")
Goto Hold+12
RIFG A 2 A_GunFlash
RIFG B 1 A_FireBullets (0.5, 1, 1, 8, "BulletPuff")
RIFG A 2 A_GunFlash
RIFG B 1 A_FireBullets (1, 2, 1, 7, "BulletPuff")
RIFG A 0 A_TakeInventory("FirstBullet", 1)
RIFG BA 4
RIFG A 6 A_Refire
Goto Ready
Flash:
RIFG F 0 A_FireCustomMissile ("Tracer", random(-4, 4), 0)
RIFF A 2 BRIGHT A_Light1
RIFF B 0 A_Light0
Stop
Spawn:
RIFL A -1
Stop
AltFire:
RIFG A 0 A_JumpIfInventory ("Clip", 1, 1)
goto Ready
RIFG A 2 A_GunFlash
RIFG B 2 A_FireBullets (3, 4, 1, 6, "BulletPuff")
RIFG A 12 A_Refire
Goto Ready
AltHold:
RIFG A 0 A_JumpIfInventory ("Clip", 1, 1)
goto Ready
RIFG A 2 A_GunFlash
RIFG B 2 A_FireBullets (5, 6, 1, 6, "BulletPuff")
RIFG A 0 A_Jump (196, 2)
RIFG A 0 A_Recoil (1)
RIFG A 12 A_Refire
Goto Ready
}
}
ACTOR FirstBullet : Inventory
{
Inventory.Amount 0
Inventory.MaxAmount 1
}
ACTOR GRifle : Rifle
{
+powered_up
+weapon.noalert
Weapon.AmmoGive 0
Weapon.AmmoType1 RocketAmmo
Weapon.AmmoType2 RocketAmmo
weapon.sisterweapon Rifle
Obituary "%o fragged by %k."
States
{
Fire:
RIFG A 4 A_JumpIfInventory ("RocketAmmo", 1, 3)
RIFG A 0 A_Print ("No rockets, switching back to rifle.")
RIFG A 0 A_TakeInventory ("PowerWeaponLevel2", 1)
goto Ready
RIFG B 4 A_FireCustomMissile ("Rocket", random(-2,2), 1, 0, random(-3,0))
RIFG A 0 A_JumpIfInventory ("RocketAmmo", 1, 3)
RIFG A 0 A_Print ("No rockets, switching back to rifle.")
RIFG A 0 A_TakeInventory ("PowerWeaponLevel2", 1)
goto Ready
RIFG A 8 A_GiveInventory ("PowerWeaponLevel2", 1)
RIFG B 6 A_PlayWeaponSound ("weapons/sshoto")
RIFG BBBB 2 A_Lower
RIFG B 14
RIFG B 6 A_PlayWeaponSound ("weapons/sshotc")
RIFG BBBB 2 A_Raise
RIFG B 8
goto Ready
Altfire:
RIFG A 0
goto Fire
}
}
ACTOR Underslung : CustomInventory
{
inventory.maxamount 1
inventory.amount 0
-invbar
States
{
Use:
RIFG A 0 A_JumpIfInventory ("PowerWeaponLevel2", 1, 2)
RIFG A 0 A_Jump (256, 3)
RIFG A 0 A_TakeInventory ("PowerWeaponLevel2", 1)
RIFG A 0 A_Print ("Now using rifle.")
fail
RIFG A 0 A_JumpIfInventory ("RocketAmmo", 1, 3)
RIFG A 0 A_TakeInventory ("PowerWeaponLevel2", 1)
RIFG A 0 A_Print ("No rockets.")
fail
RIFG A 0 A_GiveInventory ("PowerWeaponLevel2", 1)
RIFG A 0 A_Print ("Now using rocket launcher.")
fail
}
}
The weapon is an assault rifle with three modes of fire: single, burst, and auto. Single and burst are handled by primary while auto takes up the altfire. I wanted to add a grenade launcher onto this, so I created a sister weapon, "GRifle", that launches the grenade. The powerup allowing the sister weapon use is activated and deactivated by using an item, "Underslung". This item is given to the player when the rifle is selected. To keep things clean and easy to use, both the powerup and the "Underslung" item are removed from the player while the rifle is being lowered.
The crash happens if I do the following in order:
- Acquire some rockets;
- Activate the grenade launcher (console command "use Underslung");
- Fire;
- Switch weapons (EDIT: Anything BUT the fist);
- Quit.