Trouble with powerup giver giving multiple power-up types.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Trouble with powerup giver giving multiple power-up types.

Postby Amuscaria » Thu Dec 21, 2017 1:53 pm

Trying to make a power-up that gives the Speed, HighJump, and DoubleFiringSpeed power-ups at the same time, but only the DoubleFiringSpeed is given despite the Pickup state giving the other 2. Not sure why it's not working.

Code: Select allExpand view
actor ChronoSpeed : PowerupGiver //used for ChronoSphere
{
  powerup.type "Speed"
  powerup.duration 1050
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  states
  {
  Spawn:
    TNT1 A 1 Bright
    loop
  }
}

actor ChronoJump : PowerupGiver //used for ChronoSphere
{
  powerup.type "HighJump"
  powerup.duration 1050
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  states
  {
  Spawn:
    TNT1 A 1 Bright
    loop
  }
}

actor ChronoSphere : PowerupGiver 5215
{
  inventory.pickupmessage "Speedy!"
  inventory.pickupsound "misc/p_pkup"
  powerup.color "Cyan" 0.15
  powerup.type "DoubleFiringSpeed"
  powerup.duration 1050
  +COUNTITEM
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  states
  {
  Spawn:
    TIME ABCD 6 Bright
    loop
  Pickup:
   TIME A 0 Bright A_GiveInventory("ChronoSpeed",1)
   TIME A 0 Bright A_GiveInventory("ChronoJump",1)
   stop
  }
}
Last edited by Amuscaria on Thu Dec 21, 2017 1:57 pm, edited 1 time in total.
User avatar
Amuscaria
The Sentient Mushroom
 
Joined: 26 Jul 2004
Location: Growing from mycelium near you.

Re: Trouble with powerup giver giving multiple power-up type

Postby phantombeta » Thu Dec 21, 2017 1:55 pm

You need to inherit from CustomInventory to use the Pickup and Use states.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit

Re: Trouble with powerup giver giving multiple power-up type

Postby Amuscaria » Thu Dec 21, 2017 2:16 pm

Nvm. Problem fixed. I had to inherit from CustomInventory instead of PowerUpGiver.
User avatar
Amuscaria
The Sentient Mushroom
 
Joined: 26 Jul 2004
Location: Growing from mycelium near you.


Return to Scripting

Who is online

Users browsing this forum: FFFFRRRR and 2 guests