Hi, I have been trying to replace the pistol for a while now and am having no luck. I have created a new player in my wad and told weapon slot 2 to be my handgun weapon (replacing pistol) and also told me to start with the handgun instead of the pistol but when I load the game it doesn't work.
I have created a zmapinfo to tell the game also to use my new player over the doomplayer. Whats going on?
I'm stumped, can any one check out my wad and have a look? Its here:
Handgun
Thanks!
Replace Pistol
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.
- BlueFireZ88
- Posts: 1087
- Joined: Tue Jan 18, 2011 9:04 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Tallon IV
- Contact:
Re: Replace Pistol
A fairly easy fix my friend:
This is what you have:
This is what you should have:
It works when I add that in. You have to indicate that this weapon is replacing the existing one. You don't even need a new player class if you just replacing the weapon.
This is what you have:
Code: Select all
ACTOR Handgun : WEAPON
Code: Select all
ACTOR Handgun : WEAPON replaces Pistol
- 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: Replace Pistol
Unless you're replacing one of the starting weapons... Like the Pistol.BlueFireZ88 wrote:You don't even need a new player class if you just replacing the weapon.

- BlueFireZ88
- Posts: 1087
- Joined: Tue Jan 18, 2011 9:04 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Tallon IV
- Contact:
Re: Replace Pistol
Ok, ok, yeah your right, my bad. I just remembered that i recently had to do that for Expanded.NeuralStunner wrote:Unless you're replacing one of the starting weapons... Like the Pistol.BlueFireZ88 wrote:You don't even need a new player class if you just replacing the weapon.
Re: Replace Pistol
Once again, the replaces keyword is only for spawning stuff in a map.
It has no effect on [wiki]weapon slots[/wiki]. It also has no effect on anything that give items directly, such as starting inventory or [wiki]A_GiveInventory[/wiki] and its equivalent ACS functions.
It has no effect on [wiki]weapon slots[/wiki]. It also has no effect on anything that give items directly, such as starting inventory or [wiki]A_GiveInventory[/wiki] and its equivalent ACS functions.
-
- Posts: 3
- Joined: Mon Aug 15, 2011 5:39 pm
Re: Replace Pistol
Just to finish up I managed to solve my problem. If anyone else has this problem feel free to ask me to post the solution as I know it can be hard getting to grips with this stuff. Thanks for everyone else who helped.
- TheDoomGuy
- Posts: 260
- Joined: Thu Dec 14, 2006 4:08 am
Re: Replace Pistol
Yeah, it's all about inheritance. I'm still struggling with the basics, myself... and I've only been here five years. lolSuperflyTNT wrote:Just to finish up I managed to solve my problem. If anyone else has this problem feel free to ask me to post the solution as I know it can be hard getting to grips with this stuff. Thanks for everyone else who helped.
- Tapwave
- Posts: 2096
- Joined: Sat Aug 20, 2011 8:54 am
- Preferred Pronouns: No Preference
- Graphics Processor: nVidia with Vulkan support
Re: Replace Pistol
Make a new playerclass, and write this or something close to this:
Actor Myplayer : Doomplayer
{
Player.startitem "mypistol"
Player.startitem "Clip" 50
}
And then in KEYCONF
clearplayerclasses
addplayerclass myplayer
Actor Myplayer : Doomplayer
{
Player.startitem "mypistol"
Player.startitem "Clip" 50
}
And then in KEYCONF
clearplayerclasses
addplayerclass myplayer