Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Immorpher

Item that gives health and ammo (ZDoom)

Question

How do you make an item that gives both ammo and health in ZDoom? I have created a new ammo type, but I also want it to give health. I have tried adding HealThing in a pickup state, but it doesn't seem to increase the player's health even though it does increase ammo. Perhaps the ammo type doesn't activate the pickup state?

ACTOR ContamMatter : Ammo
{
  Inventory.PickupMessage "Obtained corrupted matter."
  +Inventory.NoScreenFlash
  +Inventory.AlwaysPickUp
  Inventory.Amount 1
  Inventory.MaxAmount 100
  Ammo.BackpackAmount 1
  Ammo.BackpackMaxAmount 200
  Inventory.Icon "COMTE0"
  Inventory.PickupSound "NULL"
  States
  {
  Spawn:
	TNT1 A 0 
	TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7)
	COMT A -1
	COMT B -1
	COMT C -1
	COMT D -1
	COMT E -1
	COMT F -1
	COMT G -1
	Stop
  Pickup:
	TNT1 A 0 HealThing(1)
	stop
  }
}

Perhaps a solution could be spawning in another item in the exact same spot with no sprite or indication but gives the player 1 health?

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 1
Posted (edited)

I would try a CustomInventory actor that replaces the ammo, uses the ammo's sprite,  and gives both the ammo and health in its Pickup state.

Share this post


Link to post
  • 0

CustomInventory worked! I may not have implemented in the best way, but I defined the ammo through "ContamMatter" in the traditional sense but the user only really sees drops of "CorruptMatter" which gives health and contammatter. And most importantly it works thanks to your help!

 

ACTOR ContamMatter : Ammo
{
  Inventory.PickupMessage "Obtained corrupted matter."
  +Inventory.NoScreenFlash
  +Inventory.AlwaysPickUp
  Inventory.Amount 1
  Inventory.MaxAmount 100
  Ammo.BackpackAmount 1
  Ammo.BackpackMaxAmount 150
  Inventory.Icon "COMTE0"
  Inventory.PickupSound "NULL"
  States
  {
  Spawn:
	COMT E -1
	Stop
  }
}


ACTOR CorruptMatter : CustomInventory
{
  Inventory.PickupMessage "Obtained corrupted matter."
  +Inventory.NoScreenFlash
  +Inventory.AlwaysPickUp
  Inventory.PickupSound "NULL"
  States
  {
  Spawn:
	TNT1 A 0 
	TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7)
	COMT A -1
	COMT B -1
	COMT C -1
	COMT D -1
	COMT E -1
	COMT F -1
	COMT G -1
	Stop
  Pickup:
	TNT1 A 0 A_GiveInventory ("ContamMatter", 1)
	TNT1 A 0 HealThing(1)
	stop
  }
}

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×