A_JumpIfInventory help

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
HellBlade64
Forum Regular
Posts: 107
Joined: Mon Aug 13, 2012 9:03 pm
Contact:

A_JumpIfInventory help

#1

Post by HellBlade64 » Tue Jun 10, 2025 11:17 pm

I'm trying to make a rune that powers up weapons when collected using the following code:

Code: Select all

actor AbyssRevolver : Weapon 20018
{
Tag "Abyss Magnum"
+WEAPON.NOAUTOAIM
Inventory.PickupMessage "The Abyss Revolver!"
Inventory.PickupSound "dsshck"
Weapon.AmmoGive 20
Weapon.AmmoType "Clip2"
Weapon.AmmoUse 10
Weapon.AmmoGive2 0
Weapon.AmmoType2 "DemonSoul"
Weapon.AmmoUse2 10
Weapon.Kickback 100
Obituary "%o was quick-shot by %k's Abyss Revolver!"
AttackSound "dsarevfir3"
States
{
Spawn:
HGUN C -1
Loop

Ready:
//REVG GFEDIJ 1 
REVG A 0 A_PlaySound("dsarevck") 
REVG A 1 A_WeaponReady(WRF_ALLOWRELOAD)           
Goto Ready+1                
                                  
Deselect:
REVG A 0 A_Lower
REVG A 1 A_Lower
Goto Deselect+1

Select:
REVG A 1 A_Raise
Loop

Fire:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("AbyssRune",1,"SFire")
TNT1 A 0 A_Recoil(2.5)
REVG A 0 A_GunFlash
REVG A 0 A_CheckReload
REVG A 0 A_TakeInventory("RevolverShot",1,TIF_NOTAKEINFINITE) 
REVG A 0 A_FireBullets(0,0,1,0,BulletChip,0,1000)
REVG A 0 A_RailAttack(random(300,750),0,5,"none","FFFFFF",RGF_NOPIERCING,0,0,0,0,1000)
REVG BCDIJ 2 Bright
REVG A 0 A_JumpIfInventory("RevolverShot",1,1)
Goto Reload
REVG A 10
REVG A 0 A_ReFire
Goto Ready+1

SFire:
TNT1 A 0 A_Recoil(2.5)
REVG A 0 A_GunFlash
REVG A 0 A_CheckReload
REVG A 0 A_TakeInventory("RevolverShot",1,TIF_NOTAKEINFINITE) 
REVG A 0 A_FireBullets(0,0,1,0,"ARevolvExp",0,1500)
REVG A 0 A_RailAttack(random(300,750),0,5,"none","FFFFFF",RGF_NOPIERCING,0,0,0,0,1500)
REVG BCDIJ 2 Bright
REVG A 0 A_JumpIfInventory("RevolverShot",1,1)
Goto Reload
REVG A 10
REVG A 0 A_ReFire
Goto Ready+1

Flash:
TNT1 AA 1 A_Light1
TNT1 A 1 A_Light0
Goto LightDone

AltFire:
REVG A 0 A_GunFlash
REVG A 0 A_CheckReload
REVG A 0 A_TakeInventory("RevolverShot",1,TIF_NOTAKEINFINITE)
REVG A 0 A_PlayWeaponSound("dsarevfir3")
REVG A 0 A_FireCustomMissile("ABRDComet",0,5)
RVG2 BCDIJ 1 Bright
REVG A 0 A_JumpIfInventory("RevolverShot",1,1)
Goto Reload
REVG A 2
REVG A 0 A_ReFire
Goto Ready+1

Reload:
TNT1 A 0 A_CheckReload
REVG A 0 A_PlaySound("DSAREVRS")
REVG JIDEFG 1
TNT1 A 10
Goto Reloading

Reloading:
TNT1 A 1 A_JumpIfInventory("RevolverShot",6,"ReloadEnd")
TNT1 A 0 A_PlaySound("DSAREVRL")
TNT1 A 0 A_SpawnItemEx("VPBulletCasing",3,-8 - ACS_NamedExecuteWithResult("vp_casedist",0,0,0,0),36 - ACS_NamedExecuteWithResult("vp_caseheight",0,0,0,0),frandom(0,1),0,frandom(0,1),frandom(265,275),SXF_NOCHECKPOSITION | SXF_CLIENTSIDE)
TNT1 A 5 A_GiveInventory("RevolverShot",1)
Loop

ReloadEnd:
TNT1 A 2 A_PlaySound("DSAREVRE")
REVG GFEDIJ 1
Goto Ready+1
}
}
I can't figure out why, but Zand keeps ignoring A_JumpIfInventory.
I have another weapon it works on, a custom melee weapon that, thanks to A_JumpIfInventory, can be boosted by berserk.
What am I missing? All help is appreciated.

User avatar
TheHelten
New User
Posts: 9
Joined: Tue Aug 28, 2012 7:41 am
Location: The Hive
Clan: Liquid Metal
Clan Tag: [LiMe]

Re: A_JumpIfInventory help

#2

Post by TheHelten » Thu Jun 12, 2025 2:46 am

Unfortunately, JumpIfInventory does not check for actual runes. Lacking the code of the rune itself, I can only guess, but if you have a type of powerup present, it needs to check for its inheritor.

A good example of this is detecting the RageRune powerup. If you want to see if someone has the RageRune, you sadly can't just check that (without ACS?) but you CAN check for its inherited property, which is called "RuneDoubleFiringSpeed". In this way if the rune isn't necessarily functioning as a rune for any other purpose, you may want to consider making it a CustomInventory actor which will let you control its quantity and how its properties are used/detected in weapons or other functions a lot better. You will however have to define more about the item up front, but that's more of a blessing than a curse. :wink:

If your AbyssRune item type has a inherited powerup or property, you have to figure out what its actor name is, and look for that. You can also have it inherit a property of its own, by making your own powerup actor. Here's an example:

Code: Select all

Actor RuneDrainer : PowerDrain
{
    Powerup.Strength 0.25
}

Actor DrainRunePowerup : DrainRune replaces DrainRune
{
	Inventory.Amount 1
	Inventory.MaxAmount 20
	Inventory.InterHubAmount 20
	Inventory.Icon DRARA0
	Rune.Type "Drainer"
	Tag "Drain"
	SpawnID 182
	Game Doom
	-INVENTORY.AUTOACTIVATE
	//+INVENTORY.UNDROPPABLE
	+COUNTITEM
	+NOGRAVITY
}
In this, the Drain Rune is checking for Rune Type (or Rune.Type :lol: ) "Drainer", but you see there's no actor called that. Instead we're looking for RuneDrainer, which when defined as an actor, the second half of the name is automagically turned into a rune type. So because RuneDrainer exists, now Drainer is a rune type. You could do the same thing for the AbyssRune item you have.

Hope this helps. :biggrin:

User avatar
HellBlade64
Forum Regular
Posts: 107
Joined: Mon Aug 13, 2012 9:03 pm
Contact:

Re: A_JumpIfInventory help

#3

Post by HellBlade64 » Thu Jun 12, 2025 3:11 am

I should have been a little clearer about that. It isn't a rune in skulltag terms, just a custominventory item.

Code: Select all

Actor AbyssRune : CustomInventory { Inventory.MaxAmount 1 }

User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

Re: A_JumpIfInventory help

#4

Post by Ænima » Thu Jun 12, 2025 4:30 am

Looks like it should work. Use the "PrintInv" CCMD to double-check that the item is indeed in your inventory.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
HellBlade64
Forum Regular
Posts: 107
Joined: Mon Aug 13, 2012 9:03 pm
Contact:

Re: A_JumpIfInventory help

#5

Post by HellBlade64 » Thu Jun 12, 2025 7:15 pm

Figured it out. Stupid me as usual. Changed actor type from "CustomInventory" to just "Inventory" and now it works perfectly. Thanks for y'alls help.

Post Reply