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

How can you break the 200 bullet cap? (DECORATE and ACS)

Question

I'm making a weapon that's supposed to give 400 ammo upon pickup, but by default(without backpack), doom caps the bullets to 200 at maximum.

 

- I've tried giving a backpack upon pickup, then removing everything else except the bullets, but it didn't work, and I only want the bullets cap to be doubled.

- I also tried using ACS, but to be honest, I don't really know how to implement ACS from a DECORATE script.

 

Does anyone know any ways to break the cap WITHOUT increasing the cap for any other weapons?

 

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 2
2 hours ago, Arctangent said:

When you inherit from an ammo actor that isn't itself Ammo, the base class of all ammo actors, you make a secondary pickup of that one ammo type, not a child ammo type. To illustrate this, you need not look farther than the big ammo pickups themselves. In fact, that's basically what Empyre posted, except with an attempt to change the details of the ammo type that does nothing because an ammo type isn't being defined, just a pickup for an already defined one.

I've made weapons, but I have never messed with the ammo before. I tried to learn about ammo just to answer this question. In that case, you would need to inherit not from Clip but from Ammo, and copy-and-paste the entire definition of Clip from the wiki, and then make the desired changes. That is unless Arctangent comes up with a better solution, which is possible likely.

Share this post


Link to post
  • 0

Assuming you want to double everything:

ACTOR DoubleClip : Clip replaces Clip
{
  Inventory.Amount 20
  Inventory.MaxAmount 400
  Ammo.BackpackAmount 20
  Ammo.BackpackMaxAmount 800
}
 
ACTOR DoubleClipBox : ClipBox replaces ClipBox
{
  Inventory.Amount 100
}

This will double the ammo for the pistol, too, though.

Share this post


Link to post
  • 0

You'll want to ignore Empyre's solution - what he posted will only accomplish doubling the amount of ammo you'll get from picking up clips and clip boxes. It won't actually touch their caps at all, for one important reason:

 

When you inherit from an ammo actor that isn't itself Ammo, the base class of all ammo actors, you make a secondary pickup of that one ammo type, not a child ammo type. To illustrate this, you need not look farther than the big ammo pickups themselves. In fact, that's basically what Empyre posted, except with an attempt to change the details of the ammo type that does nothing because an ammo type isn't being defined, just a pickup for an already defined one.

 

Before I drop a solution of my own, though, I want you to clarify a few things about what you want to do, and what you think you need to do:

  1. Is the weapon itself supposed to increase the ammo type's capacity to 400, or do you just want to be able to hold 400 of it in the first place?
  2. Is there a specific reason why you're using clips? Is this meant to be used in conjuction with the vanilla pistol and chaingun, or are you using replacement for them already?
  3. Is this supposed to be a hard limit on the ammo type, or would you prefer a backpack allowing a cap of 800?

Share this post


Link to post
  • 0

Okay, I'll clarify it a bit more.

 

1. I want the weapon to hold 400 ammo, and increase the bullet cap to 200.

2. I'm using them in conjunction with the vanilla pistol and chaingun, not replacing any of them.

3. I'd like it if i could just break the 200 ammo cap. A 800 ammo cap would be great.

Share this post


Link to post
  • 0
10 minutes ago, Valgilton said:

Okay, I'll clarify it a bit more.

 

1. I want the weapon to hold 400 ammo, and increase the bullet cap to 200.

2. I'm using them in conjunction with the vanilla pistol and chaingun, not replacing any of them.

3. I'd like it if i could just break the 200 ammo cap. A 800 ammo cap would be great.

In this case, there are two good solution:

  1. Utilize DeHackEd to change the ammo type's properties directly. I don't have a step-by-step guide for this on hand, but it should be easy to find because it's a pretty well-used feature at this point.
  2. Replace the Clip ammo type entirely, and subsequently replace both the pistol and the chaingun.

The latter is a bit more work due to several factors. One, as already established, you can't just make a new ammo type by inheriting from another one, but you can still just copy the Clip and ClipBox actors' code, rename them, make them replace the vanilla actors, and change the new ClipBox to inherit from the new Clip instead of the old one. Then, you'll need to replace the chaingun, but due to weapons not operating like ammo, you can just inherit from the chaingun and change its Weapon.AmmoType property. Same deal with the pistol. But at this point, we have to break away from DECORATE for two reasons:

  1. We need to replace the default player class.
  2. We need to replace the default weapon slots ... which can be done in DECORATE, but through a new player class, meaning we need to break out of DECORATE for #1 anyway.

Fortunately, both of these takes place in MAPINFO. But why do we have to make a new player class? Because, while it's important to replace the pistol in case the player plays your mod on a map that has the pistol on the ground, the "replaces" keyword does not affects items given to the player directly, like those they start with. So if we want to change the pistol the player starts with, we're going to have to make a new player class.

 

Fortunately, that's not terribly difficult - all we need to do is inherit from DoomPlayer, copy over its Player.StartItem properties ( all of 'em ), and replace the pistol in it with the new one. Then, we go to MAPINFO to finish the job. Both defining what player classes are available and defining the weapon slots are done in the GameInfo section of MAPINFO, utilizing the playerclass and weaponslot properties. The wiki can explain MAPINFO better than I can, but as a hint: if you look at all the properties you can set in GameInfo, don't panic! You don't need to define anything of that - the defaults from Doom will carry over if you don't touch them.

 

So, yeah. On the surface, just using DeHackEd would be a lot simpler, but all this stuff about player classes and MAPINFO and stuff is important if you want to get further into making these sorts of mods. After all, it isn't necessary just for changing the pistol's ammo type, but also for making it so that the player starts out with a completely different loadout. Up to you which one you decide to use, but the latter's something you might need to learn anyway!

Share this post


Link to post
  • 0

Oh, that's great. I already have a pistol replacer mod, so all I have to do is make a chaingun replacer, set up the custom ammo type, and I should be fine.

 

Thanks!

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
×