Custom Berserk Wont give power.

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.
User avatar
Mayhem666
Posts: 501
Joined: Sun Feb 26, 2012 6:17 pm
Location: Canada,Qc

Custom Berserk Wont give power.

Post by Mayhem666 »

I have these codes :

Code: Select all

ACTOR 64Berserk : CustomInventory Replaces Berserk
{
	Game Doom
    Scale 0.82
	SpawnID 134
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.PickupMessage "$GOTBERSERK"
	Inventory.PickupSound "misc/p_pkup"
    Inventory.PickupSound "BERSPKUP"
	States
	{
  Spawn:
    PSTR A -1
    Stop
	Pickup:
		    TNT1 A 0 A_SetBlend ("ff0000", 0.75, 70)
    		TNT1 A 0 A_GiveInventory("PowerStrength")
    		TNT1 A 0 HealThing(125, 0)
    		TNT1 A 0 A_SelectWeapon("64Fist")
    		Stop
	}
}
And it wont give the PowerStrenght, When i hit a monster it just damage as normal.
Whats the problem?
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Re: Custom Berserk Wont give power.

Post by TheDarkArchon »

Summon the item, pick it up and "printinv" in the console to double check that it's there. It may be the problem is with your fist.
User avatar
insightguy
Posts: 1730
Joined: Tue Mar 22, 2011 11:54 pm

Re: Custom Berserk Wont give power.

Post by insightguy »

If your fist is custom. You will need to use a A_jumpifinventory.
User avatar
Mayhem666
Posts: 501
Joined: Sun Feb 26, 2012 6:17 pm
Location: Canada,Qc

Re: Custom Berserk Wont give power.

Post by Mayhem666 »

insightguy wrote:If your fist is custom. You will need to use a A_jumpifinventory.
Yes my Fist is Custom, It use A_CustomPunch

And when i do Printinv, PowerStrength and 64fist are present.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: Custom Berserk Wont give power.

Post by Blue Shadow »

Unlike [wiki]A_Punch[/wiki], [wiki]A_CustomPunch[/wiki] doesn't detect the presence of [wiki=Classes:PowerStrength]PowerStrength[/wiki] in the player's inventory and modify the damage output. To achieve that effect, [wiki]A_JumpIfInventory[/wiki] can be of use. Here is an example using the fist from Doom:

Code: Select all

  Fire:
    PUNG B 4
    TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, "Berserked")
  Normal:
    PUNG C 4 A_CustomPunch(2 * random(1, 10), TRUE)
    Goto FireEnd
  Berserked:
    PUNG C 4 A_CustomPunch(20 * random(1, 10), TRUE)
  FireEnd:
    PUNG D 5
    PUNG C 4
    PUNG B 5 A_ReFire
    Goto Ready

Return to “Editing (Archive)”