monkeymaster69 Posted May 26, 2024 soo ive made another post like this two days ago and no one replied soo im gonna ask again with this one and add some context soo ive been trying to port some fallout weapons in doom and ive started with 10MM pistol and i wanted to add reload animations both mid clip and with no clip like in modern games like call of duty and stuff since fallout has this feature and i fallow a tutorial made by weasel that exsplained how to do it and i can make without any issiues DUKE NUKEM 3D style reload with no issiue but when i try making a more modern style and like its shown in the tutorial but its very buggy when i implemented bugs such as -infinite reloads even when the mag is full -reload animation not playing not metter how many times i press "R" -not being able to switch back to the 10MM pistol when i ran out of ammo even when i pick them back up here the code so that someone can help me seing what i did wrong: Actor Vaultdweller : doomplayer { Player.WeaponSlot 2, 10mmPistol Player.StartItem "10mmPistol" Player.StartItem "ReloadAni10mm", 15 Player.StartItem "fist" } actor 10mmPistol : Weapon { Weapon.SelectionOrder 1900 Weapon.AmmoType1 "ReloadAni10mm" Weapon.AmmoUse1 0 Weapon.AmmoType2 "10MMClip" Weapon.AmmoUse2 0 Weapon.AmmoGive 20 Inventory.Pickupmessage "Picked up a pistol." +Weapon.Ammo_Optional +Weapon.Ammo_CheckBoth States { Ready: 10MM A 0 A_JumpIfInventory("ReloadAni10mm",1,"LoadGun") 10MM A 1 A_weaponready(WRF_ALLOWRELOAD) Loop Deselect: 10MM A 1 A_Lower Loop Select: 10MM A 0 A_GiveInventory("ReloadAni10mm",1) 10MM A 1 A_Raise Loop ReloadAni10mm: 10MM D 3 10MM E 3 10MM F 5 10MM G 8 A_TakeInventory("ReloadAni10mm",1) 10MM E 5 10MM D 3 10MM A 2 Goto Ready Fire: 10MM A 0 A_JumpIfNoAmmo("ReloadAni10mm") 10MM A 4 10MM B 6 A_FireBullets(4,4,-1,6,"BulletPuff",1) 10MM B 1 10MM C 5 A_ReFire Goto Ready Flash: 10MM A 3 Bright A_Light2 10MM A 3 Bright A_Light1 10MM A 0 Bright A_Light0 Goto LightDone Spawn: 10MM A -1 Stop } } Actor 10MMClip : Ammo replaces Clip { Inventory.Amount 10 // You'll get half this if a monster drops it. Inventory.MaxAmount 150 Ammo.BackpackAmount 30 // How much you'll get out of backpacks or equivalent. Ammo.BackpackMaxAmount 300 // The new max amount if player has a backpack. Inventory.Icon "CLIPA0" // This displays on the fullscreen HUD. Inventory.PickupMessage "Picked up some 10mm ammo." States { Spawn: CLIP A -1 Stop } } ACTOR ReloadAni10mm : Ammo { Inventory.MaxAmount 12 Ammo.BackpackAmount 0 Ammo.BackpackMaxAmount 12 +IGNORESKILL } 0 Quote Share this post Link to post
kalensar Posted May 26, 2024 (edited) Heres an example from one of my mods. Havent seen any of the usual fun bugs out of it such as unintended bottomless clips, or botched weapon switches. Spoiler ACTOR M16 : Weapon //Replaces Chaingun { Inventory.PickupMessage "Picked up the M-16 Rifle." Obituary "%o was anihilated by %k's BattleRifle." Weapon.SelectionOrder 400 weapon.ammotype2 "Clip" Weapon.AmmoType "Dclip2" Weapon.AmmoUse 1 +Spriteflip +WEAPON.Alt_AMMO_OPTIONAL +WEAPON.MELEEWEAPON //weapon.ammouse2 0 Weapon.SlotNumber 4 Weapon.AmmoGive 0 Weapon.Ammogive2 20 // Weapon.AmmoType1 "Clip" Decal "BulletChip" AttackSound "weapons/UACBR" States { Spawn: M16G A -1 Loop Ready: UACR A 1 A_WeaponReady(WRF_ALLOWRELOAD) Loop Select: TNT1 AAA 0 A_raise UACR A 1 A_Raise Loop Deselect: TNT1 AAA 0 A_Lower UACR A 1 A_Lower Loop Fire: PISG A 0 A_Zoomfactor(0.97) UACR A 0 A_GunFlash UACR A 0 Offset(0, 38) UACR B 2 A_FireBullets(3, 2, 1, 5, "BulletPuff",FBF_USEAMMO) UACR A 0 A_SPAWNITEMEX("RevlCase",18,-4,25,0,-5,5) PISG A 0 A_Zoomfactor(1) UACR A 1 UACR A 0 offset(0, 42) TNT1 A 0 A_Jumpifinventory("DClip2", 1, "Ready") DryFire: UACR A 10 A_StartSound("ColtClac", CHAN_WEAPON) TNT1 A 0 //A_ReFire Goto Reload Reload: ReloadCheck: //TNT1 A 0 A_JumpIfInventory("Dclip2",0,"Dryfire") TNT1 A 0 A_JumpIfInventory("Dclip2",35,"Ready") TNT1 A 0 A_JumpIfInventory("clip",1,"ReloadStart") Goto Ready Reloadstart: TNT1 A 0 A_Jumpifinventory("DClip2", 0, "Ready") ASLR SRQPONJIH 1 ASLR G 1 A_PlaySound("weapons/shotgun/pump1", CHAN_WEAPON) ASLR DCBA 1 ASLR ABC 2 ASLR D 2 //A_Resetreloadcounter//A_CheckReloadDone ASLR G 2 A_PlaySound("weapons/shotgun/pump1", CHAN_WEAPON) ASLR HIJ 2 //A_ReloadOneRound ASLR N 2 ASLR O 2 ASLR P 2 ASLR QRS 2 Reloadammo: TNT1 A 0 A_JumpIfInventory("Dclip2",0,"Ready") TNT1 A 0 A_TakeInventory("clip",1,TIF_NOTAKEINFINITE) TNT1 A 0 A_GiveInventory("Dclip2",1) TNT1 A 0 A_JumpIfInventory("clip",1,"Reloadammo") Goto Ready Flash: UACR D 1 Bright A_Light0 UACR E 1 Bright A_Light1 Goto LightDone }} Actor Dclip2 : Ammo { inventory.maxamount 35} Edited May 26, 2024 by kalensar 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.