The "How do I..." Thread
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- ShadowTiger
- Posts: 615
- Joined: Sat Nov 07, 2009 7:32 pm
- Location: New York
Re: The "How do I..." Thread
I'm putting in all manner of custom weapons (With alarming success for a newbie. Huzzah.) but now I want to disable the Fist, the Pistol, the Shotgun, etc. So how does one go about doing that, please? I see ways to add weapons to the KeyConf file, but not to negate.
That also implies that Chaingunners and Shotgun guys can't drop their items anymore. :-/ I would fix this using an "Inheritance" right?
That also implies that Chaingunners and Shotgun guys can't drop their items anymore. :-/ I would fix this using an "Inheritance" right?
- ChronoSeth
- Posts: 1631
- Joined: Mon Jul 05, 2010 2:04 pm
- Location: British Columbia
Re: The "How do I..." Thread
After an actor's name, put the keyword "replaces" and the name of the actor you want to replace
i.e.
would replace all spawned instances of the chaingun with "MyChaingun".
As for stopping the player from starting with the standard pistol, use the actor properties here to make a replacement player class (inheriting from DoomPlayer and not using the "replaces" keyword) to remove the starting inventory (player.startitem) and replace it with what you want your player to start with.
Add this code to your keyconf lump to make the new class the default one:
i.e.
Code: Select all
Actor MyChaingun Replaces Chaingun
{
(properties)
}
As for stopping the player from starting with the standard pistol, use the actor properties here to make a replacement player class (inheriting from DoomPlayer and not using the "replaces" keyword) to remove the starting inventory (player.startitem) and replace it with what you want your player to start with.
Add this code to your keyconf lump to make the new class the default one:
Code: Select all
ClearPlayerClasses
AddPlayerClass MyPlayer //or whatever the actor name of your player class is
- ShadowTiger
- Posts: 615
- Joined: Sat Nov 07, 2009 7:32 pm
- Location: New York
Re: The "How do I..." Thread
Sweet, player starts off with the right items, without Pistol or fist. Thank you very much. ^^,
Now, the question is, I want to ensure none of the Shotgun guys or Chaingun guys drop their weapons. The method you suggested gives an initial appearance of having to use the "Replaces" device only on newly established items. This implies that I can't just replace them with a Clip or Shells, as they already exist.
Do I have to replace them with a new item that is invisible and immediately dies?
Now, the question is, I want to ensure none of the Shotgun guys or Chaingun guys drop their weapons. The method you suggested gives an initial appearance of having to use the "Replaces" device only on newly established items. This implies that I can't just replace them with a Clip or Shells, as they already exist.
Do I have to replace them with a new item that is invisible and immediately dies?
- ChronoSeth
- Posts: 1631
- Joined: Mon Jul 05, 2010 2:04 pm
- Location: British Columbia
Re: The "How do I..." Thread
Okay, to make the chaingunguys for example drop two clips instead of shells using both replacements and inheritance.
Code: Select all
Actor MyChaingunGuy : ChaingunGuy Replaces ChaingunGuy
{
DropItem "Clip"
DropItem "Clip"
}
- ShadowTiger
- Posts: 615
- Joined: Sat Nov 07, 2009 7:32 pm
- Location: New York
Re: The "How do I..." Thread
Ahhh, so that's how you do it. Clever. Thanks!
I'm not sure I understand the syntax of it though. I mean, "ChaingunGuy Replaces ChaingunGuy?"

- InsanityBringer
- Posts: 3392
- Joined: Thu Jul 05, 2007 4:53 pm
- Location: opening the forbidden box
Re: The "How do I..." Thread
The : ChaingunGuy part of that statement tells it to inherit from the Chaingunner, so it pulls all of the states, properties, and the like from the [wiki=Classes:ChaingunGuy]ChaingunGuy[/wiki] class. The replaces ChaingunGuy part of the statement basically tells the game that, instead of spawning ChaingunGuys, it spawns your new object.
There was some confusion about what you can replace. In general, you can replace anything (but a few hardcoded spawn functions here and there ignore replaces) with anything. You could replace clips with Cyberdemons or replace shells with megaspheres or replace megaspheres with your own super awesome custom powerup.
If you want to remove something, use
There was some confusion about what you can replace. In general, you can replace anything (but a few hardcoded spawn functions here and there ignore replaces) with anything. You could replace clips with Cyberdemons or replace shells with megaspheres or replace megaspheres with your own super awesome custom powerup.
If you want to remove something, use
Code: Select all
Actor NotShells replaces Shells
{
states
{
spawn:
TNT1 A 1
stop
}
}
Re: The "How do I..." Thread
I'm having a problem with sprite names that the wiki isn't too clear on. I've used Decorate weapons that had different sprite names (AAAA, AAAB), but in trying to create a new player class, it gives me an error. Unfortunately I don't have the code on this computer. Is there a restriction on sprite names on some actors that aren't on others?
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: The "How do I..." Thread
Nope. You'll have to post your code whenever you can.Akira_98 wrote:Is there a restriction on sprite names on some actors that aren't on others?
- Demolisher
- Posts: 1749
- Joined: Mon Aug 11, 2008 12:59 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Winchester, VA
- Contact:
Re: The "How do I..." Thread
Akira, did you make sure to define a new display name?
Re: The "How do I..." Thread
...No, actually I didn't.
Didn't seem to cause this problem, though fixing that now probably stopped an error-in-progress. Thanks for the heads up. Anyways, here's the code:
Script error, "Archive.pk3:decorate.txt" line 65:
SC_GetNumber: Bad numeric constant "MDAA".
Oh, and in case you were wondering, I've been playing around with A_Jump and derivatives to see how far I can push it.

Spoiler:Here's the error I get:
Script error, "Archive.pk3:decorate.txt" line 65:
SC_GetNumber: Bad numeric constant "MDAA".
Oh, and in case you were wondering, I've been playing around with A_Jump and derivatives to see how far I can push it.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: The "How do I..." Thread
Code: Select all
Death2:
MDAA ABCD 10
MDAA E 10 A_NoBlocking
MDAA FGH // Right here, you need a frame duration.
MDAA I -1 // Parser thinks the sprite name on this line is suppoded to be it.
Stop
- juizzysquirt
- Posts: 126
- Joined: Sun Jan 04, 2009 3:29 pm
- Location: Knee-Deep in L.A. Meltdown
Re: The "How do I..." Thread
How do I get the pitch between two (fixed point) map z-coordinates? Something I can pass onto SetActorPitch (0, pitch). As you know, the values need to be between -0.25 and 0.25.
Giving values straight from VectorAngle() produces weird results. Player is never looking above 0.0, probably because that function doesn't produce negative values.
Giving values straight from VectorAngle() produces weird results. Player is never looking above 0.0, probably because that function doesn't produce negative values.
Re: The "How do I..." Thread
Doh. Yup, kind of mistake I make, forgetting something simple like that. Thanks NeuralStunner. I can't believe how many times I read over that and missed it.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: The "How do I..." Thread
Pretty sure it happens to everyone.Akira_98 wrote:Doh. Yup, kind of mistake I make, forgetting something simple like that.

- Apothem
- Posts: 2070
- Joined: Sat Nov 29, 2003 7:13 pm
- Location: Performing open heart surgery on an ACS compiler.
Re: The "How do I..." Thread
How do I triangulate a camera again? I remember figuring this out previously, but I forgot how the math works. Funny part is I'm pretty sure I was the one who originally came up with it. 
I've been messing with the following snippet:
SetActorPosition(2, x-cos(a)*xyr, y-sin(a)*xyr, z+512.0, 0);
I havent been able to figure out what exactly is going on with cos(a)*xyr and what exactly it's doing there. It's been so long since I've messed with this.
In case anyone is wondering where that snippet is from it's located in the article about the [wiki]Cleaned-up_third_person_camera[/wiki]

I've been messing with the following snippet:
SetActorPosition(2, x-cos(a)*xyr, y-sin(a)*xyr, z+512.0, 0);
I havent been able to figure out what exactly is going on with cos(a)*xyr and what exactly it's doing there. It's been so long since I've messed with this.
In case anyone is wondering where that snippet is from it's located in the article about the [wiki]Cleaned-up_third_person_camera[/wiki]