[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

Permanent night visions problem:-

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


ACTOR Lightamp : PowerLightAmp
{
  powerup.duration 0x7FFFFFFF
  states
  {
  Spawn:
    MEGA ABCD 4 bright
    loop
  }
}

 

it seems not to work with this

NVision.zip

Share this post


Link to post

Your custom actors need to have different names from the originals.

Share this post


Link to post

And also from each other, because you're using "lightamp" for both the power and the item...

Share this post


Link to post

Will some correct this decorate if possible i am unable to have unlimited night vision with this[/quote]
You're giving PowerLightAmp, and not the super long version of the powerup.  Also, actors inheriting from Powerup MUST begin with the "Power" prefix.  Also also, it's not necessary to include the "Power" prefix when entering a powerup under Powerup.Type.

Also also also, you can define the duration of the powerup under the PowerupGiver. :)

Here's how I'd fix it...

ACTOR ExtendedLightamp : PowerupGiver
{
    Powerup.Duration 0x7FFFFFFFF
    Powerup.Type "SuperLightAmp"
    +AUTOACTIVATE
    +ALWAYSPICKUP
    States
    {
    Spawn:
        MEGA ABCD 4 bright
        Loop
    }
}

ACTOR PowerSuperLightamp : PowerLightAmp{} 
will someone correct me please
I am trying to change fucker.acs as following with decorate of above code will some one correct what i have to do get unlimited night vision in this 
http://www.moddb.com/mods/brutal-doom/addons/night-vision3

extracted files as follow of above are as follow
https://www.dropbox.com/s/g0b0965hupl10th/NVision.zip?dl=0
 #include "zcommon.acs"
#library "goggle"

int scriptrunning=1;

Script 901 (void)
{
     if (scriptrunning==1)
     {
            GiveInventory("PowerSuperLightamp",1);
            scriptrunning=0;
     }
     else
     {
            TakeInventory("PowerSuperLightamp",1);
            scriptrunning=1;
     }
}

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