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

Trying to make a reusable inventory item (Zandronum)

Recommended Posts

I am trying to make an inventory item that can be used an unlimited number of times, but with a cool-down time. Can this be done with DECORATE, and if so, how? I was unable to find the answer in Zoom's wiki.

Share this post


Link to post

It's entirely possible. By having a CustomInventory's Use state end in Fail instead of Stop, it isn't consumed.

Then you can have it give you a dummy powerup ( something that inherits from PowerStrength is perfect if you're not using A_Punch ) to act as the cooldown, by having an A_JumpIfInventory that checks for that dummy powerup before doing anything else.

Share this post


Link to post

I thought I had it figured out, but Zandronum fails, giving the following error message:

Execution could not continue.

Script error, "opweapons2_b1.pk3:pickups.dec" line 37:
SC_GetNumber: Bad numeric constant "}".
Line 37 is the very last line in this code excerpt.
ACTOR PowerGhostLauncherTimer : PowerTargeter
{
  Powerup.Duration 20
  -INVENTORY.HUBPOWER
  States
  {
  Targeter:
    Stop
  }
}

ACTOR GhostLauncherTimer : PowerupGiver
{
  Inventory.MaxAmount 0
  Powerup.Type "GhostLauncherTimer"
  +Inventory.AutoActivate
}

ACTOR GhostLauncher : CustomInventory
{
  Inventory.MaxAmount 1
  +Inventory.INVBAR
  Translation "Ice"
  RenderStyle "Add"
  Alpha 0.65
  Inventory.Icon "SKULA1"
  States
  {
  Use:
    TNT1 A 0 A_JumpIfInventory ("GhostLauncherTimer", 1, "NotYet")
	TNT1 A 0 A_GiveInventory ("GhostLauncherTimer", 1)
	TNT1 A 0 A_FireCustomMissile("OPGhost1",0,1,0,0,0,0)
// Pass-through
  NotYet:
    fail
  }
}
This is bizarre. Why is it expecting a number there?

Share this post


Link to post

I don't what is expected to happen if you jump to "NotYet" when there is no frame defined for it at all. Remember, you can only jump to frames, and 'fail' is not a frame, so that would require A_Jump going to NULL.
Or at-least that sure could be the problem. Sure doesn't look like anything else is missing.

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
×