Jump to content

Trying to make a reusable inventory item (Zandronum)


Empyre

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...