Skip to content

Custom Gauges

Pheonix KageDesu edited this page Apr 19, 2024 · 3 revisions

⚠️ Information actual for version 0.9.3 and above

custom_gauge_example

You can create custom gauges on screen. For example, it's can be used for make some boss HP gauge or for some variables. Gauge can be global (visible on all maps), binded to ceratin map, binded to enemy (or event), show enemy HP or value of any variable.


1. You should add custom gauge visual config via Plugin Parameter Custom Gagues

Custom Gauges PP Snag_3a2547b6

2. Add gauge to game via Script calls

Create gauge for variable value

uAPI.addCustomGaugeForVariable(GAUGE_ID, VARIABLE_ID, BINDED_EVENT_ID, X, Y, IS_GLOBAL);

Where:
GAUGE_ID - ID from gauge visual config in Plugin Parameter Custom Gauges
VARIABLE_ID - variable Id for Gauge value, should be from 0 to 100 (%)
BINDED_EVENT_ID - 0 - player, X - event ID, -1 (or null) - screen
X,Y - offset in pixels, or certain position on screen if (BINDED_EVENT_ID is -1)
IS_GLOBAL - if true - then this gauge will be visible on all maps, be sure is BINDED_EVENT_ID not set to certain event exists only on current map

Example:
uAPI.addCustomGaugeForVariable("myTestGauge", 1, 0, 100, 200, true); // global gauge on screen in position 100, 200 that show value of variable 1

Create gauge for ABS enemy

uAPI.addCustomGaugeForEnemy(GAUGE_ID, ENEMY_EVENT_ID, BINDED_EVENT_ID, X, Y);

Where:
All same as above, but
ENEMY_EVENT_ID - enemy event ID, gague will show this enemy HP Rate.

⚠️ When enemy is died (HP <= 0), gauge will dissaper automatically!

Snag_3a25a18e


3. Removing added Gauges

  • Remove Gauge (added for variable)
uAPI.removeVariableCustomGauge(VARIABLE_ID);`
  • Remove Gauge (added for enemy)
uAPI.removeEnemyCustomGauge(ENEMY_EVENT_ID);

4. Caption

After update 0.9.3 custom gauges supports caption text, see Caption plugin parameter in Gauge settings

Custom Gauge Caption Text

In Format field:

  • Value $1 will be replaced by current value
  • Value $2 will be replaced by max value
  • Value $3 will be replaced by rate in %

Example: Health: $3 %