Weapons of Saturn

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Patriot1776
Posts: 425
Joined: Sun Jun 29, 2008 10:24 am
Location: Moonshine Still, North Carolina Mountains

Re: [UPDATE Nov 15, 2013] Weapons of Saturn

Post by Patriot1776 »

Modded reload code for the shotgun. With this code, the shotgun now works very much the same as it does in 'Accessories to Murder', and I added this feature to that one too.

Code: Select all

Reload:
    TNT1 A 0 A_Takeinventory("ZoomIn",1)
    TNT1 A 0 A_ZoomFactor(1.0)
    TNT1 A 0 A_GiveInventory("ShotgunReloading",1)
    BOOM BEH 1
    BOOM FG 1
    BOOM GY 1
Goto ReloadWork1

ReloadWork1:
     TNT1 A 0 A_JumpIfInventory("LoadedShell",1,"ReloadWork2") // Check if there is still at least one shell still loaded.
     TNT1 A 0 A_GiveInventory ("ChamberLoading",1)  // If not, set a marker saying we will pump to chamber first shell so we'll be able to load 8 more and have 9 shots total.

ReloadWork2:
      TNT1 A 0 A_PlayWeaponSound("weapons/trenchgun/load")
      TNT1 A 0 A_TakeInventory("Shell",1)
      TNT1 A 0 A_GiveInventory("LoadedShell",1)
      BOMR ABCCCD 1
      BOMR EFGH 1
      BOMR II 1 A_WeaponReady(1)
      TNT1 A 0 A_JumpIfInventory("LoadedShell",9,"ReloadEnd") // Fully loaded?  Back into action!
      TNT1 A 0 A_JumpIfInventory("ChamberLoading",1,"ReloadPump") // Are we loading first shell into completely gun if so?  Pump!
      TNT1 A 0 A_JumpIfInventory("Shell",1,"ReloadWork2") //  If not, keep inserting additional shells without pumping until the magtube's full.
      //TNT1 A 0 A_JumpIfInventory("Shell",1,1)
      CSHT A 0 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH|WRF_ALLOWRELOAD)
      Goto ReloadEnd
   
ReloadPump:
	  BOOM G 2 A_PlayWeaponSound("weapons/trenchgun/cock")
          BOOM Y 2
	  BOOM Y 2 offset(1,36)
	  BOOM Y 2 offset(2,38)
	  BOOM Y 1 offset(2,40)
	  BOOM G 3 offset(5,36)
          BOOM F 6 offset(0,32)
	  TNT1 A 0 A_TakeInventory("ChamberLoading", 1) // First shell's chambered, so we clear our marker that says we're loading first shell.
	  TNT1 A 0 A_JumpIfInventory("Shell",1,"ReloadWork2") // Still got ammo?  If so, now to load 8 more in it.
	  Goto ReloadEnd

ReloadEnd:
      TNT1 A 0 A_Takeinventory("Aiming",1)
      BOOM HEB 2 A_TakeInventory("ShotgunReloading",1)
      BOOM A 1 A_WeaponReady(1)
      TNT1 A 0 A_ReFire
      Goto Ready
To see how this system works for real, load up 'Accessories to Murder' and give yourself the pump shotgun. The reloading mechanics you see is code basically exactly like this in action. My inspiration for this was GZDA Advanced Weapons, in that the pump shotgun in that one worked the same way, in that the first shell loaded into an empty weapon is first chambered by pumping, and then the rest of the shells are simply inserted. This is actually much more closer to reality to how a shotgun would be used by the pros in tactical firefights.

EDIT: Oh, BTW, you need to create a new dummy inventory item as well:

Code: Select all

ACTOR ChamberLoading : Inventory
{
inventory.maxamount 1
}
User avatar
Lippeth
Posts: 291
Joined: Wed Apr 24, 2013 1:41 am
Location: Lost Angeles

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Lippeth »

I've implemented this into my main project, if I have your permission. A few minor frames were changed due to personal taste, but I'm pretty happy with the result and I've added you into the credits list inside the pk3 file. I've also fixed an issue the shotgun had when hitting alt fire while reloading that wasn't a problem until this recent change. Thanks for the input!
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US

Re: [UPDATE Nov 15, 2013] Weapons of Saturn

Post by Ed the Bat »

Patriot1776 wrote:

Code: Select all

ACTOR ChamberLoading : Inventory
{
inventory.maxamount 1
}
Inventory.MaxAmount 1 is already defined as a property of the Inventory class, so that's just redundant.
User avatar
Captain J
 
 
Posts: 16890
Joined: Tue Oct 02, 2012 2:20 am
Location: An ancient Escape Shuttle(No longer active here anymore)

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Captain J »

always thanks for your revamping works, patriot. i'll waiting for rest of astrostein map revamps!
User avatar
Patriot1776
Posts: 425
Joined: Sun Jun 29, 2008 10:24 am
Location: Moonshine Still, North Carolina Mountains

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Patriot1776 »

Of course you got my permission Lippeth, and thanks!! :D

Captain J, truth is I've not touched the Astrostein stuff for a few weeks now, been too busy with the normal job and as I said, actually self-studying and learning a non-computer oriented trade to get a secondary source of income going. Probably will get back to work on the Astrostein levels shortly though, feeling burned out now from a heavy surge of work at the normal job. :blergh:
User avatar
Captain J
 
 
Posts: 16890
Joined: Tue Oct 02, 2012 2:20 am
Location: An ancient Escape Shuttle(No longer active here anymore)

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Captain J »

i know that, but if you have a enough times to do it. don't push yourself, rest if you need it! beside, i can wait for a years for that!
User avatar
Patriot1776
Posts: 425
Joined: Sun Jun 29, 2008 10:24 am
Location: Moonshine Still, North Carolina Mountains

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Patriot1776 »

+1 reloading added to the pistol and the assault rifle. Now, if you reload while there is still at least 1 shot in them, you will have an extra round to shoot since there is one already in the chamber. Reloading the pistol with one or more shots left will leave you with 11 shots before you need to reload again instead of 10, and on the assault rifle, you get 26 shots before you need to reload, instead of 25. Coding change was even easier than I thought.

+1 reload coding changes for pistol:

Code: Select all

 ReloadChamberCheck:
	TNT1 A 0 A_JumpIfInventory ("9mm",1,"ReloadLoop2")
	  Goto ReloadLoop1

  ReloadLoop1:
    TNT1 A 0 A_GiveInventory("9mm")
    TNT1 A 0 A_TakeInventory("Clip",1,TIF_NOTAKEINFINITE)
    TNT1 A 0 A_JumpIfInventory("9mm",10,"ReloadEnd")
    TNT1 A 0 A_JumpIfInventory("Clip",1,"ReloadLoop1")
      Goto ReloadEnd

  ReloadLoop2:
	TNT1 A 0 A_GiveInventory("9mm")
	TNT1 A 0 A_TakeInventory("Clip",1,TIF_NOTAKEINFINITE)
	TNT1 A 0 A_JumpIfInventory("9mm",11,"ReloadEnd")
	TNT1 A 0 A_JumpIfInventory("Clip",1,"ReloadLoop2")
	  Goto ReloadEnd

ACTOR 9mm : Ammo
{
   +IGNORESKILL
   Inventory.MaxAmount 11
   Ammo.BackpackMaxAmount 15
}
And for the assault rifle:

Code: Select all

 ReloadChamberCheck:
	  TNT1 A 0 A_JumpIfInventory("Magazine",1,"ReloadLoop2")
	    Goto ReloadLoop1
   
   ReloadLoop1:
      TNT1 A 0 A_GiveInventory("Magazine")
      TNT1 A 0 A_TakeInventory("Clip",1,TIF_NOTAKEINFINITE)
      TNT1 A 0 A_JumpIfInventory("Magazine",25,"ReloadEnd")
      TNT1 A 0 A_JumpIfInventory("Clip",1,"ReloadLoop1")
        Goto ReloadEnd
	  
	ReloadLoop2:
	  TNT1 A 0 A_GiveInventory("Magazine")
	  TNT1 A 0 A_TakeInventory("Clip",1,TIF_NOTAKEINFINITE)
	  TNT1 A 0 A_JumpIfInventory("Magazine",26,"ReloadEnd")
	  TNT1 A 0 A_JumpIfInventory("Clip",1,"ReloadLoop2")
	    Goto ReloadEnd

ACTOR Magazine : Ammo
{
   +IGNORESKILL
   Inventory.MaxAmount 26
   Ammo.BackpackMaxAmount 30
}
Doesn't make that much of a difference in the gameplay though, but does make the reloading just a tad more reflect reality. :)
User avatar
Lippeth
Posts: 291
Joined: Wed Apr 24, 2013 1:41 am
Location: Lost Angeles

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Lippeth »

Implemented, I had to add sprites to the pistol to keep the slide closed when reloading with one in the chamber, and decided to remove the increased magazine capacity feature when picking up a backpack for compatibility reasons. So the pistol will always have a 15 round mag and the rifle will always have a 30 round mag.
User avatar
Patriot1776
Posts: 425
Joined: Sun Jun 29, 2008 10:24 am
Location: Moonshine Still, North Carolina Mountains

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Patriot1776 »

Huh, did the reloading tweak break the increased magazine feature, or was it screwing stuff up even with the original reload code?

I'm wondering why the chaingun still seems like its shooting somewhat like a shotgun, why when you shoot it you see bullet puffs in places on the walls that are too wide to the left, right, up, and down from the point of aim to really be attributed to ungodly recoil. The chaingun really seems odd that way.
Jinal
Posts: 317
Joined: Sun Apr 06, 2008 2:51 pm

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Jinal »

I wonder if your going to change the SSG sprite by any chance?
User avatar
Lippeth
Posts: 291
Joined: Wed Apr 24, 2013 1:41 am
Location: Lost Angeles

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Lippeth »

I was having issues, but I've fixed it by checking for an inventory item that is picked up with the backpack. It will jump to separate reload states with the correct numbers. There may have been a simpler fix but I did it the only way I know how.
User avatar
Patriot1776
Posts: 425
Joined: Sun Jun 29, 2008 10:24 am
Location: Moonshine Still, North Carolina Mountains

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Patriot1776 »

I agree, there might have been a simpler way that might might have saved some code, but doing it this way, having four separate sub-states I guess leaves the code easier to read and understand, and gives more predictable behavior.
User avatar
Abba Zabba
Posts: 2166
Joined: Mon Sep 05, 2011 8:50 pm
Location: a place lol!

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Abba Zabba »

May I ask what resolution you play at, Lippeth? I love this mod and the HUD you made, but it leaves very little room in the center of my screen to see what weapon is out with fullscreen hud scaling on (just enough space to all of the super shotgun.)

One last question; where does the mp40 sit when compared to the rifle? To me it seems like the rifle has a higher RoF and has an accurate iron sight (well, more like laser sight but you know.)
User avatar
Lippeth
Posts: 291
Joined: Wed Apr 24, 2013 1:41 am
Location: Lost Angeles

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Lippeth »

Shortly after I made the HUD I realized that it doesn't always look good at most resolutions. It looks fine on my laptop at 1366x768, and pretty much anything else 16:9, but you'll have to mess around with it a bit to get it to look right at 4:3.

The MP40 is as high as it can be without finding new sprites, resources are scarce without taking pictures of one myself, and I don't have one lying around to photograph. If I ever find decent resources, I'll be sure to use them because it would let me resurrect my Wolfenstyle project.
User avatar
Abba Zabba
Posts: 2166
Joined: Mon Sep 05, 2011 8:50 pm
Location: a place lol!

Re: [UPDATE Nov 22, 2013] Weapons of Saturn

Post by Abba Zabba »

I don't think you got what I meant when I said "where it sits"; I meant how does it function compared to the rifle.

Return to “Gameplay Mods”