On DECORATE Reloading

Do you have a question about making weapon mods, or do you just need some tutorials and resources? Ask about all of that here.

Moderator: wildweasel

Locked
User avatar
DoomRater
Posts: 397
Joined: Tue Jul 19, 2005 4:14
Location: Programmer's Room, talking to Will Harvey
Contact:

On DECORATE Reloading

Post by DoomRater »

I just finished blabbering about DECORATE and some of the different ways games do reloading. It strikes me as odd that I haven't seen any of the reloading style where you throw away a partial clip- everyone's been using reloading where it takes away from your total ammo count.

See, the reason I'm pointing it out here is because it's a hell of a lot easier to implement. Check this mock reloading code out:

Code: Select all

AltFire:
   TNT1 A 0 A_JumpIfInventory("GenericGunClipAmmo",15,1) //assuming that's like half ammo
   Goto AltFire + 3
   TNT1 A 0
   Goto Ready
   TNT1 A 0 A_TakeInventory("GenericGunClipAmmo",999) 
   TNT1 A 3 A_PlaySound("ClipOut")
   TNT1 AAA 3
   TNT1 A 0 A_TakeInventory("GenericGunClip",1)
   TNT1 A 0 A_GiveInventory("GenericGunClipAmmo",999)
   TNT1 A 4 A_PlaySound("ClipIn")
   TNT1 AA 3
   TNT1 A 3 A_PlaySound("CockGun")
   TNT1 AA 3
   Goto Ready
Notice how there's only one decision in the whole code? And that's even copy and pastable! Bitchin! Sure, it means you can waste up to half the ammo you can carry, but all you have to do is double the amount of clips carryable to balance that issue out and make sure the player always has enough ammo for the job. (adding only a quarter might even be better)

Okay, enough selling the idea- what thoughts do you guys have on it?
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

I've been experimenting with a more unique style of reloading that takes advantage of Heretic-style items. It won't require any extra coding in the weapon itself (outside of clip checks to make sure the weapon won't still shoot or auto-switch if it's out). But my idea is to make ammo clips into inventory items, that you must highlight and use to reload specific weapons. The disadvantage of that is that it'll be harder (probably impossible) to implement reloading animations, or disallow the player to use a clip item unless he's wielding the gun that it goes to.
User avatar
DoomRater
Posts: 397
Joined: Tue Jul 19, 2005 4:14
Location: Programmer's Room, talking to Will Harvey
Contact:

Post by DoomRater »

Harder? Ha. Simply have the item give IsReloading at the same time and check for it like what I did in my recode of Inuyasha's M-16. Of course, if you're going to do that, you could just as well do exactly what was done in that M-16... but I do understand what you're going for.

Simply put, once I had that I'd be binding the ammo type to keys on my layout rather than sifting through the inventory list.

Checking the gun item means another counter- one that says "Hey! I'm the weapon being used!" at least until there's a way to check weapon names in DECORATE. But still, doable.
User avatar
Zero Prophet
Posts: 40
Joined: Mon Feb 06, 2006 2:07
Location: dev/null

Post by Zero Prophet »

Seeing that something along the lines of a "Use" state exists for inventory items, it would be theoretically possible to have the clip selection autoselect the particular weapon in the process. On the other extreme, this method behind the madness specifically requires the use of a decorative SetWeapon equivalent, which does not exist to my limited knowledge.

I also have developed a massive grudge against the aforementioned wasteful system of reloading ever since getting stuck on The Chronicles of Riddick and forcing a fresh start as I ran out of ammo due to excess reloading. Use at your own risk.
User avatar
DoomRater
Posts: 397
Joined: Tue Jul 19, 2005 4:14
Location: Programmer's Room, talking to Will Harvey
Contact:

Post by DoomRater »

There does indeed exist the equivilent- It was used in Kgsws's skin weapons.

A_SelectWeapon(weapon name)
User avatar
Xaser
Developer
Developer
Posts: 112
Joined: Sat Jul 16, 2005 2:51

Post by Xaser »

Wait, timeout. This is possible? That's pretty damn good news, then.

And I don't care what the prophets say... Riddick's reloading system is pretty damn cool. It makes things much more strategic, preventing reloading every bloody two seconds (which I usually do anyway).
User avatar
DoomRater
Posts: 397
Joined: Tue Jul 19, 2005 4:14
Location: Programmer's Room, talking to Will Harvey
Contact:

Post by DoomRater »

What's more, it's EASIER than implementing the other reloading style.

Now, usually I keep people from over-reloading by making sure the clip's half empty first. That's what I did for the Boombox in Stupid Deathmatch.
Locked

Return to “Weapon Modding Help & Resources”