EarthQuake
9.5 on the Richter!

Posts: 2745
Registered: 05-03 |
You should format your code a little better to help improve readability.
code: script 1 (void)
{
If (CheckActorProperty(60, APROP_HEALTH, 700))
{
SpawnSpot("SpawnFire", 67, 0, 0);
Delay(10);
Thing_SpawnNoFog(67, T_BARON, 64, 68);
}
Else
{
ACS_Execute(16, 0, 0, 0, 0);
}
Delay(1);
}
The way you have the code written basically works like this:
code: Is the actor's health 700?
Yes, then spawn fire, delay, and spawn some barons.
No, then execute script 16.
Now wait 1 tic and exit the script.
As you can see, it doesn't make too much sense.
Here's what you probably want:
code: Script 1 (void)
{
// Get health of the target monster.
int Health = GetActorProperty(60, APROP_HEALTH);
// See if we're below 700 health.
If (Health < 700)
{
// If it is, spawn fire, wait, then spawn barons...
SpawnSpot("SpawnFire", 67, 0, 0);
Delay(10);
Thing_SpawnNoFog(67, T_BARON, 64, 68);
// The script will stop looping now...
}
Else
{
// Otherwise, wait a bit and restart the script
// so the target monster's health can be checked again...
Delay(1);
Restart;
}
}
I have no idea what Script 16 does, so I didn't include it in my correction. Note the use of GetActorProperty instead of CheckActorProperty. There are other ways of doing this as well, but this one might be the simplest to understand. Hope this helps.
Last edited by EarthQuake on 12-28-11 at 00:48
|