Page 1 of 1

How to make new sphere (CustomInventory) not always pickup?

Posted: Mon Jul 13, 2015 2:15 am
by arkore

Code: Select all

ACTOR T3SuperSphere : CustomInventory 30300
{
//$Category Powerups
//$Title "Supersphere"
//$Sprite SUSPA0

  Inventory.PickupSound "powerups/supersphere"
  Inventory.Pickupmessage "Super Sphere!"
  Inventory.Icon "SUSPA0"
  +FLOATBOB
  +COUNTITEM
  -INVENTORY.ALWAYSPICKUP
  -FLOAT
  States
  {
  Spawn:
    SUSP ABCD 10 Bright
    Loop
  Pickup:
    TNT1 A 0
    TNT1 A 0 A_JumpIfInventory("Health", 250, "HealthIsFull")
    TNT1 A 0 A_GiveInventory("SuperSphereHealth", 1)
    TNT1 A 0 A_GiveInventory("SuperSphereArmor", 1)
    Stop
  HealthIsFull:
    TNT1 A 0
    TNT1 A 0 A_JumpIfInventory("BasicArmor", 250, "Done")
    Goto Pickup+2
  Done:
    TNT1 A 0
    Fail
  }
}

Code: Select all

ACTOR SuperSphereHealth : Health
{
    Inventory.Amount 250
    Inventory.MaxAmount 250
}

Code: Select all

ACTOR SuperSphereArmor : BlueArmor
{
Armor.SavePercent 60
Armor.SaveAmount 250
}
I also tried:

Code: Select all

A_JumpIfInventory("BlueArmor", 250, "Done")
or

Code: Select all

Both
A_JumpIfInventory("SuperSphereHealth", 250, "Done")
and
A_JumpIfInventory("SuperSphereArmor", 250, "Done")

RE: How to make new sphere (CustomInventory) not always pickup?

Posted: Mon Jul 13, 2015 7:21 am
by Catastrophe
Have you tried "goto fail" instead of "stop" in the pickup state?

RE: How to make new sphere (CustomInventory) not always pickup?

Posted: Mon Jul 13, 2015 11:12 am
by Ænima
Yeah you need a Fail state. Also note that every special in the Pickup state is called instantly regardless of the specified delays, therefore it's necessary to jump outside of the pickup state for special conditions.