Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Job

An Idea for Ammo: Programmer's Input Wanted

Recommended Posts

First, I honestly don't know if this idea has been brought up before. Second, I don't know if it's possible, but here goes.

Is it possible to program a sourceport, or simply a .deh, that modifies ammo pickups? For example, let's say you're equipped with a backpack and have 90 shells remaining. Normally, if you run over a box of ammo, you'll be brought up to 100, having wasted 10 shells as a resultp. Is it possible to alter this behavior so that if you were in the same scenario, running over the box of shells would net you the 10 to bring you up to 100, but the box would remain on the ground, still good for 10 remaining shells? Perhaps we could apply the same principle to weapon pickups and even stimpacks/medikits?

By no means do I have the ability to make a .deh or whatever is necessary to make this happen, just an idea that I think would help with balancing gameplay.

Share this post


Link to post

I feel like someone did something similar in a recent mod (within the last year or two), where if you picked up a box of bullets, it would "make change" in the form of clips left behind, etc.

Share this post


Link to post
Salt-Man Z said:

I feel like someone did something similar in a recent mod (within the last year or two), where if you picked up a box of bullets, it would "make change" in the form of clips left behind, etc.

Oh, well, shoot. I didn't know that. Sort of invalidates this thread. : /

Share this post


Link to post

In DEHACKED, you can change all ammo pickups to give exactly 1 ammo (with sprite naming trickery, even the big ammo pickups!), then stack multiple ones on each other in your map. It appears as if you pick up 20 shells from a single shellbox, but you actually pick up 20 individual ones. Of course, if you exceed your maximum carrying capacity, the remaining ammo pickups will stay on the ground. This method cannot be applied to health pickups, because it's impossible to change their capacity via plain DEHACKED. Weapon pickups always give you 2x more ammo than a small pickup of the same ammo type, so that they're partially compatible with this trick.

A proper solution could be probably done in ZDoom's DECORATE via custom inventory combined with either ACS, or dummy map objects placed on its spot. Theoretically, it could be applied to any kind of pickup and on any map.

Share this post


Link to post
Job said:

Oh, well, shoot. I didn't know that. Sort of invalidates this thread. : /

Not at all. It just sounded awfully familiar, is all. I don't remember if the wad I remember was ever completed, or if it was just being spitballed, or what.

Share this post


Link to post
Salt-Man Z said:

Not at all. It just sounded awfully familiar, is all. I don't remember if the wad I remember was ever completed, or if it was just being spitballed, or what.

Regardless, I suppose the whole thing with using part of the stims/medikits would be pretty cool. It drives me bonkers when I know I've wasted however much of a pickup and try to ration items in a map accordingly.

Share this post


Link to post
Salt-Man Z said:

I feel like someone did something similar in a recent mod (within the last year or two), where if you picked up a box of bullets, it would "make change" in the form of clips left behind, etc.


Yea, I believe somebody over at the ZDoom forums made that there. Not sure what it's named but I wouldn't mind adding it to my "Must have" Doom mods that don't drastically alter tactical gameplay.

Share this post


Link to post

I've heard of the wad that "makes change" before, that would be a good place to start.

If I were to attempt that myself, I would prolly do the same thing, or similar, to what scifista said.

Also as scifista said, decorate and ACS would prolly be the best way to go. You don't even necessarily need to use both. Like he said, You can create or change the current ammo items and then stack them. With ACS, you could possibly put in a check inventory/ammo (I'm not sure the right commands, as a retarded MacGyver, I only encounter what I use). After that, with some if commands for certain ammo levels (I, as a player, would not be too upset with a few bullets going to waste due to not every number being represented in the script) you could leave ammo in certain amounts, like say, 5, 10... 45. If you really want it to look cool you could create a new decorate item to look like an open ammo box.

I'm no programmer, so I can't help you too much, but I love trickery and solving problems. If you have trouble in the future when I have more free time I could look more into it.

Share this post


Link to post

Do you mean like in the same way Half Life 2 did ammo pickups? I'm not entirely sure that's possible in Doom without doing what Scifista mentioned.

Share this post


Link to post

Hmmm... I'm not farmiliar with the way that HL2 did it.

Now keep in mind that I've never done this, so some details may be off, but the basic concepts should work when implemented:

For starters, you may have to start off by starting an invisible ammo counter (not to reuse the same word or anything lol). This depends on whether-or-not Doom will track ammo on its own in a way that allows you to actively alter it. We know already that it DOES track ammo, the key is can you mess with it. If I remember correctly, you can give/take ammo with ACS script, and I believe there are wads that use ammo as resources such as money. If this is the case, an invisible ammo counter would be redundant.

After that, you should be able to use "check" functions, combined with "if" functions to calculate how much ammo to leave on the floor. You don't need to mess with ammo given, the rest is wasted anyway, so no one will be any the wiser. Note that you will need to put in a check function for the backpack too, as that would destroy your hard work. After that one or two lines to put in the new DECORATE object with the right amount of ammo.

As for the invisible ammo counter, it may be tough to keep it lined up with real ammo. You need it to always add and subtract ammo as it's found and used, (used will be the tough part, I would think). Having said that, we also already know that Brutal Doom has successfully changed the way the game handles bullet ammo. You can tell because the original Doom HUD often displays the wrong values for bullet ammo, whereas the updated HUDs do. In addition, Brutal Doom has changed the ammo amounts that are picked up. I would have to say that through either trickery or ACS script this should be totally possible, but through other, more sophisticated means literally anything is possible in Doom.

You know, the more I think about it the more I love this idea. I love learning how stuff works. If anyone wants to colaborate on this idea, I'm sure we could figure it out. Hell, I'll prolly look into it even if I'm by myself on it. But this will have to wait until my map for Job's Father's Day is done and I've done the playtesting that I promised to others on their works.

*Edit* spell check, l9he isn't a word. Proof my phone is smarter than me >.<

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×