Hello, I was wondering if someone would be able to edit this existing code to make it when you altfire it goes into an animation where the player attaches a suppressor to it and the weapon is suppressed and is reversed when you altfire again back to its unsuppressed state. I'd prefer it being one weapon if possible, I already made the sprites for it and looks really good. (I am pretty much looking for my pistol code to be altered so it can be suppressed and unsuppressed when the player presses the right mouse button or the 'altfire' key) I have tried to do it myself but I can't for the life of me figure it out on my own.
/////Code Here/////
Spoiler:
ACTOR M1911 : Weapon 17001{//$Category DOV - WEAPONSWeapon.SlotNumber 2Weapon.SelectionOrder 1Weapon.Kickback 50Weapon.BobRangeX 0.3Weapon.BobRangeY 0.5Weapon.BobStyle InverseSmoothWeapon.BobSpeed 2.4Obituary "%o was executed by %k's customized 1911."Scale 0.4Radius 15Height 15Decal "MagnumHole"AttackSound "1911FIR2"Inventory.Pickupmessage "Obtained customized 1911!"Inventory.PickupSound "1911UP" Weapon.Ammotype1 "1911Loaded"Weapon.Ammotype2 "1911Ammo"Weapon.Ammouse 1Weapon.Ammouse2 0Weapon.Ammogive1 0Weapon.Ammogive2 5+Weapon.Ammo_Optional+NOAUTOFIRE+NOEXTREMEDEATH+COUNTITEM+CASTSPRITESHADOWStates{Spawn:1911 A -1loopPickup:1911 A 0 A_GiveInventory("QuickKick", 1)Stop Ready:1911 B 1 A_WeaponReady(WRF_ALLOWRELOAD)loop Select:1911 B 0 A_PlaySound("DRAW",CHAN_AUTO)1911 B 1 Offset (90,69)1911 B 1 Offset (70,60)1911 B 1 Offset (55,52)1911 B 1 Offset (35,45)1911 B 1 Offset (15,39)1911 B 1 Offset (1,35)SelectRaise:1911 B 1 A_RAISELoopDeselect:1911 B 0 A_PlaySound("AWAY", CHAN_WEAPON)1911 B 1 Offset (1,35)1911 B 1 Offset (15,39)1911 B 1 Offset (35,45)1911 B 1 Offset (55,52)1911 B 1 Offset (70,60)1911 B 1 Offset (90,69)1911 B 1 Offset (105,89)1911 B 1 Offset (125,102)1911 B 1 Offset (155,108)1911 B 1 Offset (155,150)DeselectRaise:1911 B 0 Offset (-1,0)1911 B 1 A_LowerLoop Fire:1911 C 0 A_JumpIfNoAmmo("Reload")1911 C 0 A_StartSound("1911FIR2",CHAN_AUTO)1911 C 2 Bright A_FireProjectile("PistolTracer", FRandom(-0.6, 0.6), true, 0, 0, 0, FRandom(-2.0, 2.0))1911 C 0 A_spawnitemex ("Casing", 34, 1, 27, random(1,6), random(1,8), random(1,9), 0)1911 C 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0,5)1911 D 2 Bright A_SetPitch(pitch-0.3)1911 E 1 A_SetPitch(pitch-0.3)1911 F 1 A_SetPitch(pitch-0.8)1911 G 1 A_SetPitch(pitch+0.8)1911 B 0 A_SetPitch(pitch+0.3)1911 B 0 A_SetPitch(pitch+0.3)Goto ReadyReload:1911 B 0 A_JumpIfInventory("1911Loaded", 7, 2) // If the gun's full, jump 2 states.1911 B 0 A_JumpIfInventory("1911Ammo", 1, "ReloadWork") // If there's extra ammo, reload.1911 B 1 // Here's where that first line ends up - the gun does nothing and returns to Ready.Goto ReadyReloadWork:1911 B 1 Offset(0,35)1911 B 1 Offset(-2,38)1911 B 0 A_PlaySound("1911MAG1",CHAN_AUTO)1911 B 1 Offset(-4,44)1911 B 1 Offset(-6,52)1911 B 1 Offset(-1,54)1911 B 6 Offset(-2,56)1911 B 0 A_FireCustomMissile("PistolMagDrop",-5,0,8,-4)1911 B 1 Offset(-1,54)1911 B 1 Offset(-6,52)1911 B 1 Offset(-4,44)1911 B 0 A_PlaySound("1911MAG2",CHAN_AUTO)1911 B 1 Offset(-2,38)1911 B 1 Offset(0,35)1911 B 1 Offset(0,35)1911 B 1 Offset(-3,56)1911 B 1 Offset(-3,56)1911 B 1 Offset(-3,51)1911 B 1 Offset(-3,53)1911 B 1 Offset(0,35)1911 B 1 Offset(0,35)ReloadLoop:1911 B 0 A_TakeInventory("1911Ammo", 1)1911 B 0 A_GiveInventory("1911Loaded", 1)1911 B 0 A_JumpIfInventory("1911Loaded", 7, "ReloadFinish")1911 B 0 A_JumpIfInventory("1911Ammo", 1, "ReloadLoop")Goto ReloadFinishReloadFinish:1911 B 1 Offset(-3,57)1911 B 1 Offset(-3,59)1911 B 1 Offset(-3,63)1911 B 1 Offset(-3,67)1911 B 1 Offset(-3,65)1911 B 0 A_PlaySound("1911UP",CHAN_AUTO)1911 B 1 Offset(-3,62)1911 B 1 Offset(-3,58)1911 B 1 Offset(-3,55)1911 B 1 Offset(-2,53)1911 B 1 Offset(-2,49)1911 B 1 Offset(-2,46)1911 B 1 Offset(-2,45)1911 B 1 Offset(-1,44)1911 B 1 Offset(-1,46)1911 B 1 Offset(-1,47)1911 B 1 Offset(0,49) A_WeaponReady(WRF_NOBOB)1911 B 1 Offset(0,44) A_WeaponReady(WRF_NOBOB)1911 B 1 Offset(0,38) A_WeaponReady(WRF_NOBOB)1911 B 1 Offset(0,35) A_WeaponReady(WRF_NOBOB)1911 B 1 Offset(0,32) A_WeaponReady(WRF_NOBOB)Goto ReadyGoto ready}}ACTOR 1911Loaded : Ammo{Inventory.MaxAmount 7+IGNORESKILL}
Statistics: Posted by Graaicko — Thu May 23, 2024 3:33 pm