Sign in to follow this  
Followers 0

[ZDoom] Permanent Powerups

Hey all. I'm having a bit of trouble here. I'm trying to make a fairly simple powerup that is entirely permanent. That is, the player picks the item up once and then it stays in his inventory between levels and everything. So far, it works fine when first picked up, but I just can't seem to get it to carry over into the next level.

Here's what I've got so far:

ACTOR Test_Pickup : CustomInventory 10001
{
  + INVENTORY.AUTOACTIVATE
  + INVENTORY.ALWAYSPICKUP
  States
  {
  Spawn:
     TNT1 A 4
     loop
  Use:
    TNT1 A 0 A_GiveInventory ("JumpBooster", 1)
    TNT1 A 0 A_GiveInventory ("Test", 1)
    TNT1 A 0 
    stop
  }
}

ACTOR Test : CustomInventory
{
  + INVENTORY.AUTOACTIVATE
  + INVENTORY.ALWAYSPICKUP
  + INVENTORY.PERSISTENTPOWER
  + INVENTORY.HUBPOWER
  Inventory.Amount 1
  Inventory.MaxAmount 1
  Tag "test"
  States
  {
  Spawn:
     TNT1 A 4
     loop
  Use:
    TNT1 A 0 
    fail
  }
}
JumpBooster is a powerupgiver just like on the ZDoom wiki. Anyone have an idea as to why this isn't sticking around?

Share this post


Link to post

What's the point of the "Test" item, exactly?

Also, if I'm not mistaken, the INVENTORY.PERSISTENTPOWER flag works only on the power-ups themselves, not the actual power-up givers or custom inventory items.

ACTOR PowerPerHighJump : PowerHighJump
{
  Powerup.Duration 0x7FFFFFFF // "Infinite" duration
  +INVENTORY.PERSISTENTPOWER
  +INVENTORY.UNDROPPABLE // If you don't want, it remove it
  +INVENTORY.UNTOSSABLE // If you don't want, it remove it
  // The rest of the definition...
}

ACTOR PermanentHighJump : PowerupGiver
{
  Powerup.Type "PerHighJump"
  // The rest of the definition...
}

Share this post


Link to post

Right now? It gives a permanent high jump powerup. Hrm... doesn't seem to be working as of yet. Here's my current code for the powerup and powerupgiver.

ACTOR JumpBooster : PowerupGiver
{
  inventory.maxamount 0
  powerup.type "JumpBooster_Powerup"
  + AUTOACTIVATE
  states
  {
  Spawn:
    MEGA ABCD 4 bright
    loop
  }
}

ACTOR JumpBooster_Powerup : HighJump
{
  powerup.duration 0x7FFFFFFF
  + INVENTORY.PERSISTENTPOWER
  + INVENTORY.UNDROPPABLE
  + INVENTORY.UNTOSSABLE
  states
  {
  Spawn:
    MEGA ABCD 4 bright
    loop
  }
}
I'm getting errors with regard to the duration. *Sigh* Wish I was a little less green with Decorate, but we all have to start somewhere.

Share this post


Link to post
Membrain said:

ACTOR JumpBooster_Powerup : HighJump

It should be PowerHighJump, not just HighJump.

Also, you might want to put the power-up giver's definition after the power-up's, otherwise ZDoom will complain.

Share this post


Link to post

Aha! There we go. Thanks very much. This is a lot more concise than what I had, too.

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
Sign in to follow this  
Followers 0