Heretic Max Ammo
Heretic Max Ammo
Hi,
In a .deh file this code works in Doom2, but not in Heretic.
What can I do to implement the same thing in Heretic? Is there any other way in Zandronum besides the .deh file?
Ammo 0
Max ammo = 500
Ammo 1
Max ammo = 500
Ammo 2
Max ammo = 500
Ammo 3
Max ammo = 500
Thanks
In a .deh file this code works in Doom2, but not in Heretic.
What can I do to implement the same thing in Heretic? Is there any other way in Zandronum besides the .deh file?
Ammo 0
Max ammo = 500
Ammo 1
Max ammo = 500
Ammo 2
Max ammo = 500
Ammo 3
Max ammo = 500
Thanks
- Sean
- IRC Operator
- Posts: 982
- Joined: Thu Jan 16, 2014 9:09 pm
- Location: United Kingdom
- Clan: Zandronum
- Clan Tag: [Za]
- Contact:
RE: Heretic Max Ammo
Unless you need support for less capable engines, http://zdoom.org/wiki/DECORATE
<capodecima> i dont say any more word without my loyer jenova
-
- Posts: 82
- Joined: Mon Nov 24, 2014 8:19 am
RE: Heretic Max Ammo
DeHackEd is Doom-only, for reference.
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
RE: Heretic Max Ammo
This pretty much seals the deal. And while Heretic's code may be very similar to Doom, it is not the same - it definitely has more objects, but more importantly, the object numbers are different. Dehacked works with certain numbers to identify each thing and modify them, and I highly doubt these are the same for Heretic.Arctangent wrote: DeHackEd is Doom-only, for reference.
While I believe it's possible to apply a Dehacked patch to Heretic with a PWAD (I've never tried it) there's no reason to do that over using Decorate which, as Sean mentioned, is a better tool for every purpose if you plan on using the ZDoom engine.
At first, I also thought Dehacked was simple to mess around with, and Decorate seemed too complex. But it's very easy to learn the basics if you use the ZDoom wiki, and it's far better.
Last edited by SwordGrunt on Fri Jan 01, 2016 5:42 am, edited 1 time in total.
RE: Heretic Max Ammo
Thanks for the info. Regarding this DECORATE thing, how does it really works? I mean, by writing some commands in the console, in a separate file or how exactly
Is this the code I need for implement what I want?
ACTOR MaxCrossbowAmmo : CrossbowAmmo replaces CrossbowAmmo
{
Ammo.BackpackMaxAmount 666
}
Is this the code I need for implement what I want?
ACTOR MaxCrossbowAmmo : CrossbowAmmo replaces CrossbowAmmo
{
Ammo.BackpackMaxAmount 666
}
Last edited by omyv on Sat Jan 02, 2016 11:12 pm, edited 1 time in total.
-
- Posts: 82
- Joined: Mon Nov 24, 2014 8:19 am
RE: Heretic Max Ammo
Ammo that inherits from another ammo actor ( besides the Ammo base class itself ) counts as the same ammo as its parent class, meaning you can't change the max amounts and such, only stuff relevant to an alternate ammo pickup ( such as pickupmessage, amount, etc. ).
You'll need remake the ammo pickups from scratch, including the alternate pickups for them as otherwise they'd give the old ammo type instead of the new one. You'll also have to redefine the weapons to use the new ammo type instead of the old, although that can be done mostly by just inheriting from the standard weapons and changing their ammotypes ( and their sister weapons, due to Heretic being the focus here ).
You'll need remake the ammo pickups from scratch, including the alternate pickups for them as otherwise they'd give the old ammo type instead of the new one. You'll also have to redefine the weapons to use the new ammo type instead of the old, although that can be done mostly by just inheriting from the standard weapons and changing their ammotypes ( and their sister weapons, due to Heretic being the focus here ).
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
RE: Heretic Max Ammo
Indeed, as mentioned in the wiki's Dehacked page: "The only thing that can't be done any other way is changing the default amounts of Doom's Ammo items."Arctangent wrote: Ammo that inherits from another ammo actor ( besides the Ammo base class itself ) counts as the same ammo as its parent class, meaning you can't change the max amounts and such, only stuff relevant to an alternate ammo pickup ( such as pickupmessage, amount, etc. ).
You'll need remake the ammo pickups from scratch, including the alternate pickups for them as otherwise they'd give the old ammo type instead of the new one. You'll also have to redefine the weapons to use the new ammo type instead of the old, although that can be done mostly by just inheriting from the standard weapons and changing their ammotypes ( and their sister weapons, due to Heretic being the focus here ).
Replacing the ammo pickups (small and large) is the first step, then you have to replace the weapons as Arctangent mentioned.
The code you posted replacing the ammo is fine, just remember you have to do it for every ammo type you want to change, and for the weapons that use them.
You should put the code in a text lump name Decorate (in wads, or Decorate.txt in a pk3 file) using a wad editor such as Slade 3.
RE: Heretic Max Ammo
Could you please help me with that, by posting the code that I need. It seems to be more complicated for me than I thought :(
Last edited by omyv on Sun Jan 03, 2016 2:49 pm, edited 1 time in total.
RE: Heretic Max Ammo
So, for one single type of ammo, is this enough?
ACTOR MaxPhoenixRod : PhoenixRod replaces PhoenixRod
{
Weapon.AmmoType1 "MaxPhoenixRodAmmo"
Weapon.SisterWeapon "MaxPhoenixRodPowered"
}
ACTOR MaxPhoenixRodPowered : PhoenixRodPowered replaces PhoenixRodPowered
{
Weapon.SisterWeapon "MaxPhoenixRod"
}
ACTOR MaxPhoenixRodAmmo : PhoenixRodAmmo replaces PhoenixRodAmmo
{
Ammo.BackpackMaxAmount 666
}
ACTOR MaxPhoenixRod : PhoenixRod replaces PhoenixRod
{
Weapon.AmmoType1 "MaxPhoenixRodAmmo"
Weapon.SisterWeapon "MaxPhoenixRodPowered"
}
ACTOR MaxPhoenixRodPowered : PhoenixRodPowered replaces PhoenixRodPowered
{
Weapon.SisterWeapon "MaxPhoenixRod"
}
ACTOR MaxPhoenixRodAmmo : PhoenixRodAmmo replaces PhoenixRodAmmo
{
Ammo.BackpackMaxAmount 666
}
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
RE: Heretic Max Ammo
That's almost exactly what you need. The only thing you need is to give MaxPhoenixRodPowered the new ammotype, which you forgot, and to replace the large ammo (PhoenixRodHefty) by inheriting from your new ammo type, and redefining the larger ammo count properties from the original PhoenixRodHefty (since you are not inheriting from it). Like this:
Here's another important thing: defining the weapon slots for the new weapons in a modified player class, and add that class in KEYCONF, a new text lump, which will look like this:
And all you have to do with the player class is inherit from the original, then redefine the weapon slots to accomodate your modified weapon(s). So if you're changing ONLY the Phoenix Rod, you only need to change that name, but include all the other ones because all weapon slot definitions are cleared upon inheriting from a playerclass (I might be wrong on this though).
Code: Select all
actor MaxPhoenixRodHefty : MaxPhoenixRodAmmo replaces PhoenixRodHefty
{
Inventory.PickupMessage "$TXT_AMMOPHOENIXROD2"
Inventory.Amount 10
States
{
Spawn:
AMP2 ABC 4
Loop
}
}
Code: Select all
clearplayerclasses
addplayerclass MyHereticPlayer
Code: Select all
actor MyHereticPlayer : HereticPlayer // replacing a player class will do nothing, KEYCONF is required!
{
Player.WeaponSlot 1, Staff, Gauntlets
Player.WeaponSlot 2, GoldWand
Player.WeaponSlot 3, Crossbow
Player.WeaponSlot 4, Blaster
Player.WeaponSlot 5, SkullRod
Player.WeaponSlot 6, MaxPhoenixRod
Player.WeaponSlot 7, Mace
}
RE: Heretic Max Ammo
When the ammo type does not inherit from the 'Ammo' internal class, it is the same type of ammo, and hence editing the weapons shouldn't be required, as you will replace the used ammo type with itself.
http://zdoom.org/wiki/Classes:Ammo
http://zdoom.org/wiki/Classes:Ammo
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there
- Sean
- IRC Operator
- Posts: 982
- Joined: Thu Jan 16, 2014 9:09 pm
- Location: United Kingdom
- Clan: Zandronum
- Clan Tag: [Za]
- Contact:
RE: Heretic Max Ammo
NO. Use Weapon.SlotNumber instead. Much, much easier. No new classes, KEYCONF lumps, or any of that shit. Just one property in the weapon definition.SwordGrunt wrote: Here's another important thing: defining the weapon slots for the new weapons in a modified player class, and add that class in KEYCONF, a new text lump
<capodecima> i dont say any more word without my loyer jenova
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
RE: Heretic Max Ammo
I did not know that! I don't think I've ever attempted to replace default ammo in any of my mods, so that's good to know, and makes it much easier for the thread author, too.Lollipop wrote: When the ammo type does not inherit from the 'Ammo' internal class, it is the same type of ammo, and hence editing the weapons shouldn't be required, as you will replace the used ammo type with itself.
http://zdoom.org/wiki/Classes:Ammo
Yeah, it's been a long time since I touched any playerclass mods so I forgot about the slot number defining in individual weapons, which is indeed a lot better. I looked at the ZDoom Wiki when posting here before and saw that the weapons were still defined in the player class, so I mistakenly assumed it was the preferable method. Thanks for the correction!Sean wrote:NO. Use Weapon.SlotNumber instead. Much, much easier. No new classes, KEYCONF lumps, or any of that shit. Just one property in the weapon definition.SwordGrunt wrote: Here's another important thing: defining the weapon slots for the new weapons in a modified player class, and add that class in KEYCONF, a new text lump
Last edited by SwordGrunt on Sun Jan 03, 2016 7:53 pm, edited 1 time in total.
RE: Heretic Max Ammo
I'm kind of lost now :( Could someone please post all the code that is needed in the file decorate.txt for one single weapon?
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
RE: Heretic Max Ammo
Actually I understand what Lollipop said now, I misread that. I have no idea how I overlooked the obvious ammo inheritance. If you inherit from an ammo type your class will use that ammo type's properties, so you need to create a new class derived from Ammo itself. The ZDoom wiki even mentions that you shouldn't copy code, unless "if what you want is changing Ammo capacity, you need to create a new type from Ammo."
So for the Phoenix Rod, you'd do this for the ammo, using 200 and 400 for maxamounts instead of 20 and 40 in this example:
And then you'd modify the Phoenix Rod itself to use this new ammo type:
Both can be included in the same Decorate.txt file, or if you're going to work with more weapons, I'd recommend using the PK3 structure's folders to keep each weapon and their ammotype in a different text file. For example, in the folder "actors" you can have "PhoenixRod.txt" and "Hellstaff.txt", and then in your Decorate.txt file (main directory, not inside any folders!) you'd have:
So for the Phoenix Rod, you'd do this for the ammo, using 200 and 400 for maxamounts instead of 20 and 40 in this example:
Code: Select all
ACTOR MyPhoenixRodAmmo : Ammo
{
Inventory.PickupMessage "$TXT_AMMOPHOENIXROD1"
Inventory.Amount 1
Inventory.MaxAmount 200
Ammo.BackpackAmount 1
Ammo.BackpackMaxAmount 400
Inventory.Icon "INAMPNX"
States
{
Spawn:
AMP1 ABC 4
Loop
}
}
actor MyPhoenixRodHefty : MyPhoenixRodAmmo
{
Inventory.PickupMessage "$TXT_AMMOPHOENIXROD2"
Inventory.Amount 10
States
{
Spawn:
AMP2 ABC 4
Loop
}
}
Code: Select all
actor MyPhoenixRod : PhoenixRod replaces PhoenixRod
{
Weapon.AmmoType1 "MyPhoenixRodAmmo"
Weapon.SisterWeapon "MyPhoenixRodPowered"
Weapon.SlotNumber 6
}
actor MyPhoenixRodPowered : PhoenixRodPowered // no need to replace, as you will never spawn the powered-up version of a weapon
{
Weapon.AmmoType1 "MyPhoenixRodAmmo"
Weapon.SisterWeapon "MyPhoenixRod"
// I don't think slot number is needed because the sisterweapon property should automatically share the slot
}
Code: Select all
#include "actors/PhoenixRod.txt"
#include "actors/Hellstaff.txt"
Last edited by SwordGrunt on Sun Jan 03, 2016 11:45 pm, edited 1 time in total.
RE: Heretic Max Ammo
Thanks for your help, but that code is not working propertly.
In the game there are two types of ammo in the hud, and when you pick some ammo, it goes to the "old one" and not to the "new one"
In the game there are two types of ammo in the hud, and when you pick some ammo, it goes to the "old one" and not to the "new one"
RE: Heretic Max Ammo
I'm relatively new to DECORATE, but I think you need to have the new ammo type replace the old one, like this:
ACTOR MyPhoenixRodAmmo : Ammo replaces PhoenixAmmo
and
ACTOR MyPhoenixRodHefty : MyPhoenixRodAmmo replaces PhoenixRodHefty
Leave the rest of the code as SwordGrunt had it. I might be wrong, but if I am, you wasted not much time.
ACTOR MyPhoenixRodAmmo : Ammo replaces PhoenixAmmo
and
ACTOR MyPhoenixRodHefty : MyPhoenixRodAmmo replaces PhoenixRodHefty
Leave the rest of the code as SwordGrunt had it. I might be wrong, but if I am, you wasted not much time.
"For the world is hollow, and I have touched the sky."
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
RE: Heretic Max Ammo
You're 100% correct, I forgot to replace the actual ammotypes, that's why it messed up for him. Thanks!Empyre wrote: I'm relatively new to DECORATE, but I think you need to have the new ammo type replace the old one, like this:
ACTOR MyPhoenixRodAmmo : Ammo replaces PhoenixAmmo
and
ACTOR MyPhoenixRodHefty : MyPhoenixRodAmmo replaces PhoenixRodHefty
Leave the rest of the code as SwordGrunt had it. I might be wrong, but if I am, you wasted not much time.
Also, the original weapon definitions use weapon.ammotype and not weapon.ammotype1. As far as I know they mean exactly the same but it's possible that it's not properly replacing the old ammo type, so try changing it (from weapon.ammotype1to weapon.ammotype)
Last edited by SwordGrunt on Mon Jan 04, 2016 5:14 am, edited 1 time in total.
RE: Heretic Max Ammo
Much better, thanks a lot.
But I still don't know why there are two types of weapons now.
Check the screenshot here http://asturcon.0lx.net/temp/heretic.png
But I still don't know why there are two types of weapons now.
Check the screenshot here http://asturcon.0lx.net/temp/heretic.png
RE: Heretic Max Ammo
That's because the "old" weapon still exists. If you play and pick the weapon up legit, there won't be the duplicates since you wil only pick up the "new" one.
𝕂𝕝𝕠𝕗𝕜𝕒𝕔