Replace Pistol

Archive of the old editing forum
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.
Locked
SuperflyTNT
Posts: 3
Joined: Mon Aug 15, 2011 5:39 pm

Replace Pistol

Post by SuperflyTNT »

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!
User avatar
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

Post by BlueFireZ88 »

A fairly easy fix my friend:

This is what you have:

Code: Select all

ACTOR Handgun : WEAPON
This is what you should have:

Code: Select all

ACTOR Handgun : WEAPON replaces Pistol
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.
User avatar
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

Post by NeuralStunner »

BlueFireZ88 wrote:You don't even need a new player class if you just replacing the weapon.
Unless you're replacing one of the starting weapons... Like the Pistol. :|
User avatar
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

Post by BlueFireZ88 »

NeuralStunner wrote:
BlueFireZ88 wrote:You don't even need a new player class if you just replacing the weapon.
Unless you're replacing one of the starting weapons... Like the Pistol. :|
Ok, ok, yeah your right, my bad. I just remembered that i recently had to do that for Expanded.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Replace Pistol

Post by Gez »

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.
SuperflyTNT
Posts: 3
Joined: Mon Aug 15, 2011 5:39 pm

Re: Replace Pistol

Post by SuperflyTNT »

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.
User avatar
TheDoomGuy
Posts: 260
Joined: Thu Dec 14, 2006 4:08 am

Re: Replace Pistol

Post by TheDoomGuy »

SuperflyTNT 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.
Yeah, it's all about inheritance. I'm still struggling with the basics, myself... and I've only been here five years. lol
User avatar
Tapwave
Posts: 2096
Joined: Sat Aug 20, 2011 8:54 am
Preferred Pronouns: No Preference
Graphics Processor: nVidia with Vulkan support

Re: Replace Pistol

Post by Tapwave »

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
Locked

Return to “Editing (Archive)”