Skip to main content

player_calc_ratio

player_calc_ratio icon
Point entityPorted from Featureful

A player_calc_ratio gives a number from a player to the keys that take a locus number: the player's health, armor, ammo, inventory items or maximum speed, as the value itself or as a share of its maximum.

It does nothing when you trigger it, and it works out its value each time a key of another entity reads it. The player is the activator of the chain of triggers that reads it, for example the player who pressed a button.

Attributes​

The entity also has these common keys:

KeyDescriptionDefault
Valuecalc_param

Sets what it reads from the player.

  • Health (0)
  • Armor (1)
  • Ammo (2)
  • Ammo, with the loaded clips (3) - It also adds the bullets in every weapon of that ammo type
  • Inventory item count (4)
  • Maximum speed (5)
Default Health (0)
Inventory itemitem_name

For "Inventory item count", names the item by its Item name. Only the player's own items count, not the items the team shares.

Number asvalue_notion

Sets whether it gives the value itself or a share of its maximum.

  • Absolute (0) - The value itself
  • Fraction [0..1] (1) - The value as a share of its maximum, from 0 to 1. The maximum is the player's maximum health for health, 100 for armor and the player's normal speed for speed
  • For ammo, the maximum is the most the player can carry. With "Ammo, with the loaded clips", the magazine sizes are added to it
  • For an inventory item, the fraction is 1 if the player has any and 0 if they have none
Default Absolute (0)
Ammo typeammo_name

For "Ammo", sets which ammo it counts.

The 18 choices
  • Grenades (Vindico Grenade Launcher, MP5) (ARgrenades)
  • Rockets (Nuclear RPG: always 0, no spare rockets) (rockets)
  • Hand grenades (Hand Grenade)
  • Satchel charges (Satchel Charge)
  • Tripmines (Trip Mine)
  • Pitbulls (Snarks)
  • .444k Bear Killer (K444m)
  • Vindico Federal (federalm)
  • Croon PM 66 (pm66m)
  • Croon RC 28 (rc28m)
  • Croon FA 18 (fa18m)
  • Croon NM 33 Sniper Rifle (nm33m)
  • Vindico Plasma Sniper Rifle (swm)
  • Saan Auto-Shotgun (spam)
  • Benelli (benm)
  • Vindico Avenger Minigun (chainm)
  • Canon of Terror (canonm)

Notes​

  • It gives no number if the activator isn't an alive player, for example a dead player or the world. The entity that reads it then does nothing that time
  • It also gives no number if "Ammo" has no Ammo type, or if "Inventory item count" has no Inventory item

See also​

Changes since 1.38​

  • player_calc_ratio is new, and its Value "Inventory item count" was added in SBO 2.1.0