Thanks Henesua, I noticed the extra bracket but didn't catch the straight line thingy.
So my next question is thus:
if (GetCurrentHitPoints(oHench1) || GetCurrentHitPoints(oHench2) >= 1)
{
object oHostile = GetFirstObjectInShape(SHAPE_SPHERE, 17.0, lPlayerDying, TRUE, OBJECT_TYPE_CREATURE);
while (GetIsObjectValid(oHostile))
{
if (!GetIsReactionTypeHostile(oHostile))
//If not, bring player to 1 HP and remove immortality, destroy bloodstain after 10 minutes
{
SetPlotFlag(oPlayer, FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(2), oPlayer);
CleanUpBloodSpatter(oPlayer);
}
oHostile = GetNextObjectInShape(SHAPE_SPHERE, 17.0, lPlayerDying, TRUE, OBJECT_TYPE_CREATURE);
}
}
This script is
supposed to get all the creatures in a 17 meter sphere around the player and check to see if any of them are hostile, if none are then the character is healed out of the dying state, if there are hostile creatures (and this part I haven't gotten around to coding yet), then it will simply loop back through.
I'm either going to use a series of DelayCommands, but I can see that getting extremely clunky, quickly.
My questions are
1) Will the script I have quoted work as intended or am I "doing it wrong"?
&
2) Would it be possible to create a function (Foo), that uses a single delay command and calls itself everytime it finds a hostile creature, thereby creating a loop or "pseudo-heartbeat"?
EDIT:
And a very random, left-field question... can Henchmen wear items that aren't identified?
Modifié par NineCoronas2021, 04 février 2013 - 10:11 .