[ZScript] Trouble with SisterWeapon and Extend Class

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
kinker31
Posts: 64
Joined: Mon Feb 05, 2018 12:18 am
Operating System Version (Optional): Arch, Linux-Zen
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Does anyone actually put anything serious here?

[ZScript] Trouble with SisterWeapon and Extend Class

Post by kinker31 »

Context/Problem:
I'm developing an addon for a weapons mod I've been slowly working on, and one of the new weapons I wanna get out is a time-limited upgrade to the fist as a rare replacement for Berserk.
I've already got the powerup itself, as well as the intended upgraded melee wepon to give to the player using an inhereted PowerWeaponLevel2 class called InternalFisty... problem is it don't work.
Nothing in the console, no warning messages, nuttin'. I just keep getting the base fist weapon I made for the base mod, and I'm not even sure it knows the sister weapon exists at all.

Relevant Codeblocks:
wepon.pk3's relevant code:

Code: Select all

class TenFingerDiscount : BaseFist
{
	Default
	{[...] +WEAPON.WIMPY_WEAPON; +WEAPON.NOALERT; +WEAPON.MELEEWEAPON; +WEAPON.NOAUTOSWITCHTO;}
	uint dMin; uint dMax; property DamageValues: dMin, dMax;
	[...]
	action void FistOverlay(bool hide)
	{if(hide){A_Overlay(2, null); A_Overlay(3, null);} else{A_Overlay(2, "LeftReady"); A_Overlay(3, "RightReady");} }
	[...]
}
adonn.pk3's relevant code:

Code: Select all

class FistPack : CustomInventory
{
	Default
	{
		+COUNTITEM; +INVENTORY.ALWAYSPICKUP; +INVENTORY.ISHEALTH;
		Inventory.PickupMessage "$SUPER_FISTWOW";
		Inventory.PickupSound "misc/p_pkup";
	}
	
	States
	{
	Spawn:		FPCK A -1 Bright; Stop;
	Pickup:
		TNT1 A 0 
		{
			A_GiveInventory("InternalFisty"); HealThing(50, 1); 
			A_SelectWeapon("TwentyFingerDiscount");
		}
		Stop;
	}
}

class InternalFisty : PowerWeaponLevel2 {Default {Powerup.Duration -90; Inventory.Icon "FPCKA0";}}
extend class TenFingerDiscount {Default {Weapon.SisterWeapon "TwentyFingerDiscount";}}

class TwentyFingerDiscount : TenFingerDiscount
{
	Default {+WEAPON.POWERED_UP; Weapon.SisterWeapon "TenFingerDiscount"; 
			Obituary "$SUPER_FISTOUCH"; Tag "$SUPER_FIST";}
	
	bool canFire, canAltfire, canMegaPunch;
	
	//Super Fist Overlay
	action void SFO(bool hide)
	{if(hide){A_Overlay(2, null); A_Overlay(3, null);} 
	 else{A_Overlay(2, "ReadyOne"); A_Overlay(2, "ReadyTwo");}}
	 [...]
}

Return to “Scripting”