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

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
arkore
Forum Regular
Posts: 189
Joined: Mon Dec 17, 2012 8:01 pm

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

#1

Post by arkore » Mon Jul 13, 2015 2:15 am

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")
Last edited by arkore on Mon Jul 13, 2015 2:16 am, edited 1 time in total.
Creator of Zone-F, Rocket Arena, Jail Break, Hellway Invasion, Hellstop, Bosses from Hell, Chillax II, and ArkDoom.

Catastrophe
Retired Staff / Community Team Member
Posts: 2571
Joined: Sat Jun 02, 2012 2:44 am

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

#2

Post by Catastrophe » Mon Jul 13, 2015 7:21 am

Have you tried "goto fail" instead of "stop" in the pickup state?

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

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

#3

Post by Ænima » Mon Jul 13, 2015 11:12 am

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.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Post Reply