Page 1 of 1

Can't select certain custom weapon

Posted: Thu Jun 04, 2009 9:40 am
by SFJake
I am simply using various custom weapons fromhttp://www.realm667.com/, and some of them can't be selected. You pick them up and they work, but once you switch you can never get back to them.

This only apply to certain of them. I tried looking at their code, but I have absolutely NO idea what causes this. I'm not really into Zdoom decorate stuff here: I know how it basically works, but I just want these custom weapons to work properly.

I'm posting here hoping someone can enlighten me on how to fix this. I couldn't find info about it. Here is one of the weapon that can't be selected.

Code: Select all

actor Flaregun : Weapon
{
  Scale 0.8
  obituary "%o was cooked by %k's Flare Gun."
  radius 20
  height 16
  attacksound "weapons/shotgf"
  inventory.pickupsound "misc/w_pkup"
  inventory.pickupmessage "You got the Flare Gun!"
  weapon.selectionorder 230
  weapon.kickback 30
  weapon.ammotype "Flares"
  weapon.ammouse 1
  attacksound "dsFLRFIR"
  weapon.ammogive 9
  states
  {
  Ready:
    FLAR A 1 A_WeaponReady
    loop
  Deselect: 
    FLAR A 1 A_Lower
	NULL AA 0 A_LOWER
    loop
  Select:
    FLAR A 1 A_Raise
	NULL AA 0 A_RAISE
    loop
  Fire:
    FFIR A 2 A_GunFlash
    FLAR A 0 Bright
    FLAR A 0 Bright A_PlayWeaponsound ("dsFLRFIR")
    FFIR B 2 Bright A_FireCustomMissile("FlareFire",0,1,9,0)
    FFIR C 2 bright
    FLAR BCD 2
	FLAR EFG 2
    FLAR A 1
    goto Ready
  Spawn:
    FGRN A -1
    stop
  }
}

Re: Can't select certain custom weapon

Posted: Thu Jun 04, 2009 9:56 am
by FuzzballFox
Do you have a KEYCONF lump in your wad?
You will need to add one in order to create a new key config for the new weapons so they can be selected by the player.
You can also go here to find out more.

Re: Can't select certain custom weapon

Posted: Thu Jun 04, 2009 10:09 am
by SFJake
Hah, so silly. I wasn't looking at the wrong place. That was the obvious problem, now its working.

I was also having a problem where a custom weapon would not let me select other, old weapons (a custom weapon on 3, wouldn't let me choose the original shotguns).

But it was using "setslot" instead. This fixed all my problems. Thanks for the quick answer!

Re: Can't select certain custom weapon

Posted: Thu Jun 04, 2009 2:37 pm
by Zippy
You don't need to use KEYCONF anymore as player classes [wiki=Classes:DoomPlayer]support directly setting the weapon slots on them[/wiki].

Re: Can't select certain custom weapon

Posted: Thu Jun 04, 2009 2:42 pm
by Gez
Zippy wrote:You don't need to use KEYCONF anymore as player classes [wiki=Classes:DoomPlayer]support directly setting the weapon slots on them[/wiki].
And weapons do, too, so you don't have to edit the player class to add a weapon. This should be the preferred method for stuff like Torm's Armory, because it's the most plug'n'play one. The weapon actor is all that needs to be coded, no modification of KEYCONF or of the player class.

Re: Can't select certain custom weapon

Posted: Thu Sep 06, 2012 3:42 pm
by X-DOOM
I dont want to resurect this post but i have the same problem.

I do not use the keyconf file. I did right in the doomplayer class and i cannot switch/select any weapon until i hit either number 1-9... if i hit these numbers i can then switch fine, which bug me.


my class is like this

Code: Select all

//===========================================================================
//
// ZD3K Player
//
//===========================================================================
ACTOR ZD3KPlayer : DoomPlayer
{
	Speed 1
	Health 100
	Radius 16
	Height 56
	Mass 100
	PainChance 255
	Player.DisplayName "James Falco"
	Player.CrouchSprite "PLYC"
	Player.StartItem "Fist"
	Player.WeaponSlot 1, WEAPON_ZD3KPunch, WEAPON_ZD3KKnife
	Player.WeaponSlot 2, WEAPON_ZD3KMagsec
	Player.WeaponSlot 3, WEAPON_ZD3KHR12
	Player.WeaponSlot 4, WEAPON_Chaingun, WEAPON_ZD3KAR33
	Player.WeaponSlot 5, WEAPON_RocketLauncher, WEAPON_ZD3KFlamethrower
	Player.WeaponSlot 6, WEAPON_PlasmaRifle, WEAPON_ZD3KPhoton
	Player.WeaponSlot 7, WEAPON_BFG9000, WEAPON_ZD3KDispersion
	Player.WeaponSlot 8, WEAPON_ZD3KRailgun
	Player.WeaponSlot 9, WEAPON_ZD3KZDK1000
	Player.WeaponSlot 0, WEAPON_ZD3KNightVision
	
	Player.ColorRange 112, 127
	Player.Colorset 0, "Green",			0x70, 0x7F,  0x72
	Player.Colorset 1, "Gray",			0x60, 0x6F,  0x62
	Player.Colorset 2, "Brown",			0x40, 0x4F,  0x42
	Player.Colorset 3, "Red",			0x20, 0x2F,  0x22
	// Doom Legacy additions
	Player.Colorset 4, "Light Gray",	0x58, 0x67,  0x5A
	Player.Colorset 5, "Light Brown",	0x38, 0x47,  0x3A
	Player.Colorset 6, "Light Red",		0xB0, 0xBF,  0xB2
	Player.Colorset 7, "Light Blue",	0xC0, 0xCF,  0xC2
	
	States
	{
		Spawn:
			PLAY X -1
			Loop
		See:
			PLAY ABCD 4
			Loop
		Missile:
			PLAY E 12
			Goto Spawn
		Melee:
			PLAY F 6 BRIGHT
			Goto Missile
		Pain:
			PLAY G 4
			PLAY G 4 A_Pain
			Goto Spawn
		Death:
			PLAY H 0 A_PlayerSkinCheck("AltSkinDeath")
		Death1:
			PLAY H 10
			PLAY I 10 A_PlayerScream
			PLAY J 10 A_NoBlocking
			PLAY KLM 10
			PLAY N -1
			Stop
		XDeath:
			PLAY O 0 A_PlayerSkinCheck("AltSkinXDeath")
		XDeath1:
			PLAY O 5
			PLAY P 5 A_XScream
			PLAY Q 5 A_NoBlocking
			PLAY RSTUV 5
			PLAY W -1
			Stop
		AltSkinDeath:
			PLAY H 6
			PLAY I 6 A_PlayerScream
			PLAY JK 6
			PLAY L 6 A_NoBlocking
			PLAY MNO 6
			PLAY P -1
			Stop
		AltSkinXDeath:
			PLAY Q 5 A_PlayerScream
			PLAY R 0 A_NoBlocking
			PLAY R 5 A_SkullPop
			PLAY STUVWX 5
			PLAY Y -1
			Stop
		Sit:
			PLAY Y 1
			loop
		Pain.Fire:
			EDFA G 3
			EDFA G 3 A_Pain
			goto See
		Pain.Disp:
			EDFA G 3
			EDFA G 3 A_Pain
			goto See
		Death.Fire:
			BURN A 8
			BURN B 8
			BURN C 8
			BURN D 8 A_Scream
			BURN E 8
			BURN F 8
			BURN G 8
			BURN H 8
			BURN I 8
			BURN J 8
			BURN K 8
			BURN L 8
			BURN M 8
			BURN N 8
			BURN O 8
			BURN P 8
			BURN Q 8 A_NoBlocking
			BURN R 8
			BURN S 8
			BURN T 8
			BURN U 8
			BURN V -1
		Death.Disp:
			PLAY G 8
			EDF1 B 8 A_Scream
			EDF1 C 8
			EDF1 D 8
			EDF1 E 8
			VIDE A -1 A_NoBlocking
	}
}

Re: Can't select certain custom weapon

Posted: Thu Sep 06, 2012 3:48 pm
by wildweasel
The game needs to know your player class exists; all you're doing is inheriting from DoomPlayer, and the game does not consider it a playable class unless you add it either through Keyconf or Gameinfo.

Re: Can't select certain custom weapon

Posted: Thu Sep 06, 2012 4:01 pm
by X-DOOM
i added this into gameinfo properties in my mapinfo

MAPINFO.txt

Code: Select all

GameInfo
{
	PlayerClasses = "ZD3KPlayer"
}
and did

KEYCONF.txt

Code: Select all

addplayerclass ZD3KPlayer
none works... the player class is loaded and work, i tested by dying from fire/flame and saw my flaming death state... but no weapons switchup
im starting to pull off few of my hair lol

Re: Can't select certain custom weapon

Posted: Thu Sep 06, 2012 4:53 pm
by wildweasel
I think I've figured out your problem. The weapon you're starting the class with, Fist, is not anywhere in the weapon slots, therefore when you roll the mouse wheel to switch weapons, ZDoom has no idea where it should be going. Seems like what you'll want to do in your case is change Player.StartItem to give you WEAPON_ZD3KPunch instead of Fist.

Re: Can't select certain custom weapon

Posted: Thu Sep 06, 2012 5:06 pm
by X-DOOM
wildweasel wrote:I think I've figured out your problem. The weapon you're starting the class with, Fist, is not anywhere in the weapon slots, therefore when you roll the mouse wheel to switch weapons, ZDoom has no idea where it should be going. Seems like what you'll want to do in your case is change Player.StartItem to give you WEAPON_ZD3KPunch instead of Fist.

Thanks to figuring out this. Damned dyslexia! I cannot beleive i couldn't see i had still the old fist weapon there... now i have lost some hairs for nothing, feel like homer simpson.