I'm trying to make an ACS execute after a certain mob that has a TID of 3 loses 50% of its health points or more (in this case the monster has 100 base HP).
I've tried with:
script 1 OPEN
{
When (GetActorProperty (3, APROP_HEALTH,"monstername") <= 50)
{
Acs_Execute(2,0);
}
}
and also:
script 1 OPEN
{
if (GetActorProperty (3, APROP_HEALTH) <= 50)
Acs_Execute(2,0);
}
Yet none worked. What am I doing wrong?
Triggering script based on enemy's HP?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Re: Triggering script based on enemy's HP?
It's pretty close. There's no "when", but there's "while" and delays, so you can do this:
Usually, you'll be writing scripts that wait a lot like that to time your triggers.
Code: Select all
script 1 OPEN
{
while(50 < GetActorProperty(3, APROP_HEALTH))
{
Delay(1);
}
Acs_Execute(2, 0);
}
-
- Posts: 3
- Joined: Sat Nov 16, 2019 8:59 am
Re: Triggering script based on enemy's HP?
Thank you very muchKeksDose wrote:It's pretty close. There's no "when", but there's "while" and delays, so you can do this:
Usually, you'll be writing scripts that wait a lot like that to time your triggers.Code: Select all
script 1 OPEN { while(50 < GetActorProperty(3, APROP_HEALTH)) { Delay(1); } Acs_Execute(2, 0); }