Giving custom inventory like weapon upgrades via backpack.

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!)

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Giving custom inventory like weapon upgrades via backpack.

Re: Giving custom inventory like weapon upgrades via backpac

by Void Weaver » Thu Jul 11, 2019 11:51 pm

doomguy214 wrote:Pickup:
TNT1 A 0 A_GiveInventory("ShellBox", 1)
The 'Pickup:' state should be used only for CustomInventory NOT for Inventory or BackpackItem.

Anyway you should either make ZScript custom Backpack OR make CustomInventory with ammo cap increasing via ACS smth like as:
'SetAmmoCapacity("<your_ammo_type>",GetAmmoCapacity("<your_ammo_type>")+<additional_cap_value_of_your_ammo_type>);' and with yours weapon upgrades, both into Pickup state.

Giving custom inventory like weapon upgrades via backpack.

by doomguy214 » Thu Jul 11, 2019 10:20 pm

Is it possible to give custom inventory via backpack with code below :-

Code: Select all

ACTOR AmmoSuply : BackpackItem Replaces Backpack
{
	Game Doom
	Height 26
	+COUNTITEM
	+DONTGIB
	+INVENTORY.ALWAYSPICKUP
	inventory.pickupsound "BACKPK2"
	Inventory.PickupMessage "$GOTBACKPACK"
	States
	{
	Spawn:
		CMPK ABCDEFG 1 
		Loop
    Pickup:
        TNT1 A 0 A_GiveInventory("ShellBox", 1)
        TNT1 A 0 A_GiveInventory("ClipBox", 1)
        TNT1 A 0 A_GiveInventory("CellPack", 1)
        TNT1 A 0 A_GiveInventory("RocketBox", 1)
        Stop
	}
}
Inventory code as below.
ACTOR Doom2016ShotgunUpgradeSpawner : CustomInventory //Weapon Spawn
{
	-COUNTITEM
	-INVENTORY.ALWAYSPICKUP
	Inventory.Amount 0
	Inventory.MaxAmount 1
	Inventory.PickupMessage ""
	States
	{
	Spawn:
        TNT1 A 0
		TNT1 A 0 A_JumpIf(CallACS("GameplayPreset_IB")==1, "SpawnNothing")//Arsenal
		TNT1 A 0 A_JumpIf(CallACS("GameplayPreset_IB")==2, "Spawn4Reel")//Doom 2016
		TNT1 A 0 A_JumpIf((CallACS("GameplayPreset_IB")==3)||(CallACS("GameplayPreset_IB")==7), "SpawnNothing")//Conjoined (:P)
		TNT1 A 0 A_JumpIf(CallACS("GameplayPreset_IB")==4, "Spawn4Reel")//JRMYXD Arsenal
		TNT1 A 0 A_JumpIf(CallACS("GameplayPreset_IB")==5, "SpawnNothing")//JRMYXD Classic
		TNT1 A 0 A_JumpIf(CallACS("GameplayPreset_IB")==6, "SpawnNothing")//JRMYXD Insanity
		
		TNT1 A 0 A_JumpIf(CallACS("UpgradePresets_IB")==1, "SpawnNothing")//Default
		TNT1 A 0 A_JumpIf(CallACS("UpgradePresets_IB")==2, "Spawn4Reel")//Doom 2016
		TNT1 A 0 A_JumpIf(CallACS("UpgradePresets_IB")==3, "SpawnNothing")//Extra Arsenal
		TNT1 A 0 A_JumpIf(CallACS("UpgradePresets_IB")==4, "Spawn4Reel")//JRMYXD Arsenal
		TNT1 A 0 A_JumpIf(CallACS("UpgradePresets_IB")==5, "SpawnNothing")//JRMYXD Classic
		TNT1 A 0 A_JumpIf(CallACS("UpgradePresets_IB")==6, "SpawnNothing")//JRMYXD Insanity
	Spawn4Reel:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("DisableUpgrade")==1,"SpawnNothing")
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("NoDoom2016ShotgunUpgrade")==1,"SpawnNothing")
		TNT1 A 0 A_JumpIF(ACS_NamedExecuteWithResult("IBArsenalUpgradeToggle")==1,"SpawnNothing")
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("Doom2016UpgradeToggle")==1,"SpawnNothing")
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("JRMYXDARsenalUpgradeToggle")==1,"SpawnNothing")
		Goto Spawn2
		
	SpawnNothing:
	TNT1 A 0 A_SpawnItem("ShellBoxSpawnIBNew")
	Goto Derp
	
	Spawn2:
	TNT1 A 0 A_SpawnItem("Doom2016GrenadeShotgun")
	Goto Derp
    
	Derp:
	TNT1 A 0
	//TNT1 A -1
	Stop
	}
}

Top