player_calc_ratio

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:
- Naming and triggering: Name
calc_paramSets 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)
Health (0)item_nameFor "Inventory item count", names the item by its Item name. Only the player's own items count, not the items the team shares.
value_notionSets 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
Absolute (0)ammo_nameFor "Ammo", sets which ammo it counts.The 18 choices
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
calc_ratio- changes a numbertrigger_compare- compares two numbers- calc_ entities guide - how locus numbers are worked out
Changes since 1.38
player_calc_ratiois new, and its Value "Inventory item count" was added in SBO 2.1.0
