Weapons of Saturn v2.0b

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are ONLY for YOUR 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.

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

Postby Patriot1776 » Thu Nov 21, 2013 5:52 pm

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 allExpand view
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 allExpand view
ACTOR ChamberLoading : Inventory
{
inventory.maxamount 1
}
User avatar
Patriot1776
 
Joined: 29 Jun 2008
Location: Moonshine Still, North Carolina Mountains

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

Postby Lippeth » Fri Nov 22, 2013 1:32 am

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
Lippeth
Metalvangelist
 
Joined: 24 Apr 2013
Location: Lost Angeles
Discord: Lippeth#2552

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

Postby Ed the Bat » Fri Nov 22, 2013 1:35 am

Patriot1776 wrote:
Code: Select allExpand view
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
Ed the Bat
I'm tired. I want to go home.
 
Joined: 03 May 2012
Location: Maryland, US
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

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

Postby Captain J » Fri Nov 22, 2013 2:03 am

always thanks for your revamping works, patriot. i'll waiting for rest of astrostein map revamps!
User avatar
Captain J
That's Amoreee
 
 
 
Joined: 02 Oct 2012
Location: A Year old Pizza Box
Discord: DiscussJ#3128

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

Postby Patriot1776 » Fri Nov 22, 2013 6:22 am

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
Patriot1776
 
Joined: 29 Jun 2008
Location: Moonshine Still, North Carolina Mountains

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

Postby Captain J » Fri Nov 22, 2013 8:10 am

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
Captain J
That's Amoreee
 
 
 
Joined: 02 Oct 2012
Location: A Year old Pizza Box
Discord: DiscussJ#3128

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

Postby Patriot1776 » Fri Nov 22, 2013 8:24 am

+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 allExpand view
 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 allExpand view
 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
Patriot1776
 
Joined: 29 Jun 2008
Location: Moonshine Still, North Carolina Mountains

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

Postby Lippeth » Fri Nov 22, 2013 12:01 pm

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
Lippeth
Metalvangelist
 
Joined: 24 Apr 2013
Location: Lost Angeles
Discord: Lippeth#2552

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

Postby Patriot1776 » Fri Nov 22, 2013 1:22 pm

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.
User avatar
Patriot1776
 
Joined: 29 Jun 2008
Location: Moonshine Still, North Carolina Mountains

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

Postby Jinal » Fri Nov 22, 2013 2:44 pm

I wonder if your going to change the SSG sprite by any chance?
Jinal
Banned User
 
Joined: 06 Apr 2008

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

Postby Lippeth » Fri Nov 22, 2013 4:24 pm

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
Lippeth
Metalvangelist
 
Joined: 24 Apr 2013
Location: Lost Angeles
Discord: Lippeth#2552

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

Postby Patriot1776 » Fri Nov 22, 2013 4:54 pm

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
Patriot1776
 
Joined: 29 Jun 2008
Location: Moonshine Still, North Carolina Mountains

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

Postby Abba Zabba » Sun Nov 24, 2013 5:39 am

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
Abba Zabba
 
Joined: 05 Sep 2011
Location: a place lol!

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

Postby Lippeth » Sun Nov 24, 2013 1:03 pm

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
Lippeth
Metalvangelist
 
Joined: 24 Apr 2013
Location: Lost Angeles
Discord: Lippeth#2552

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

Postby Abba Zabba » Sun Nov 24, 2013 6:00 pm

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.
User avatar
Abba Zabba
 
Joined: 05 Sep 2011
Location: a place lol!

PreviousNext

Return to Gameplay Mods

Who is online

Users browsing this forum: No registered users and 14 guests