-
Notifications
You must be signed in to change notification settings - Fork 94
add_hp_down_trigger
Ryzom Core Wiki edited this page Jul 8, 2024
·
3 revisions
title: Add HP Down Trigger description: published: true date: 2023-03-16T23:04:48.097Z tags: editor: markdown dateCreated: 2023-03-16T22:20:45.349Z
The addHpDownTrigger native AI script function registers a trigger on HP decreases. Whenever the HP level of a bot downcrosses the threshold, it triggers the specified user event or script function. Several triggers can be registered on the same group, even with the same threshold and event.
()addHpDownTrigger(threshold: f, user_event_n: f) // addHpDownTrigger_ff_
()addHpDownTrigger(threshold: f, callback: s) // addHpDownTrigger_fs_
- threshold (float): The HP threshold that triggers the event or function.
- user_event_n (float): The user event number to trigger.
- callback (string): The name of the script function to call.
()addHpDownTrigger(0.5, 5);
This example code registers a trigger that will trigger user event 5 when the HP level of a bot downcrosses 0.5.
()addHpDownTrigger(0.5, "onHPDecrease");
This example code registers a trigger that will call the "onHPDecrease" script function when the HP level of a bot downcrosses 0.5.