Jump to content

Home

Door question...


Ferc Kast

Recommended Posts

Thanks for answering that question. That got me started with everything else in my cutscene. However, now that I've gotten most of my cutscene's scripts made & working, I have another question.

 

 

Where I have multiple friendlies & multiple hostiles fighting each other, is there a way so that a specific friendly fights only a specific hostile?

Link to comment
Share on other sites

Yeah, with a script:

 

void main ()
{
object oNPC = GetObjectByTag([color="Lime"]"YOUR_TAG_HERE"[/color]);
object oOPP = GetObjectByTag([color="Lime"]"YOUR_TAG_HERE"[/color]);

ChangeToStandardFaction(oNPC, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oOPP, STANDARD_FACTION_PREDATOR);

ExecuteScript("k_ai_master", oOPP, 1005);
}

 

I tried it to see if it works, and it works for me!;)

Link to comment
Share on other sites

Are you saying that once they reach 1hp they stop attacking?

 

How long is infinitely? I know that's a self-explanatory question, but is it really necessary to be continuous?

 

You could always pump up their defense and their hp if that's the case.

 

_EW_

Link to comment
Share on other sites

Are you saying that once they reach 1hp they stop attacking?

 

How long is infinitely? I know that's a self-explanatory question, but is it really necessary to be continuous?

 

You could always pump up their defense and their hp if that's the case.

 

_EW_

 

After a few seconds, they stop fighting. But, I want them to keep fighting until and unless I tell to stop. I'd prefer it to continuous b/c i'm gonna have cameras showing each jedi/sith pair fighting. And, I dunno how long I'll want to show them fighting.

Link to comment
Share on other sites

I think there is....Uncheck the minimum 1 hp of your utcs, and use this script:

 

void main ()
{
object oNPC = GetObjectByTag("YOUR_TAG_HERE");
object oOPP = GetObjectByTag("YOUR_TAG_HERE");

ChangeToStandardFaction(oNPC, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oOPP, STANDARD_FACTION_PREDATOR);

ExecuteScript("k_ai_master", oOPP, 1005);

int nCurrentHP1;
nCurrentHP1=GetCurrentHitPoints(oNPC);
if (nCurrentHP<=40) {
effect EffectHeal(200);
 }


int nCurrentHP2;
nCurrentHP2=GetCurrentHitPoints(oOPP);
if (nCurrentHP<=40) {
effect EffectHeal(200);
 }

}

 

Haven't tested this one, though....

Link to comment
Share on other sites

I'm getting the following error message when I try to compile that script:

error.png

 

Looking at it, those lines are the effect heal lines.

 

Try removing the "(200)" afterward on each one. I think it might be because the heal effect doesn't take a parameter like that.

 

_EW_

Link to comment
Share on other sites

Try removing the "(200)" afterward on each one. I think it might be because the heal effect doesn't take a parameter like that.

 

_EW_

 

When I do that, I have a syntax error at the if:

 

void main ()
{
object oNPC = GetObjectByTag("YOUR_TAG_HERE");
object oOPP = GetObjectByTag("YOUR_TAG_HERE");

ChangeToStandardFaction(oNPC, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oOPP, STANDARD_FACTION_PREDATOR);

ExecuteScript("k_ai_master", oOPP, 1005);

int nCurrentHP1;
nCurrentHP1=GetCurrentHitPoints(oNPC);
if (nCurrentHP<=40) {
effect EffectHeal;
 }


int nCurrentHP2;
nCurrentHP2=GetCurrentHitPoints(oOPP);
[color="Lime"]if [/color](nCurrentHP<=40) {
effect EffectHeal;
 }

}

 

At the green-colored if

Link to comment
Share on other sites

When I do that, I have a syntax error at the if:

 

void main ()
{
object oNPC = GetObjectByTag("YOUR_TAG_HERE");
object oOPP = GetObjectByTag("YOUR_TAG_HERE");

ChangeToStandardFaction(oNPC, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oOPP, STANDARD_FACTION_PREDATOR);

ExecuteScript("k_ai_master", oOPP, 1005);

int nCurrentHP1;
nCurrentHP1=GetCurrentHitPoints(oNPC);
if (nCurrentHP<=40) {
effect EffectHeal;
 }


int nCurrentHP2;
nCurrentHP2=GetCurrentHitPoints(oOPP);
[color="Lime"]if [/color](nCurrentHP[b]2[/b]<=40) {
effect EffectHeal;
 }

}

 

At the green-colored if

 

 

Your second if checks a variable that doesn't exist.

 

Add a "2" after that (as I've shown) to refer to the right thing and it should work ;)

 

_EW_

Link to comment
Share on other sites

If I may add, it doesn't look like the NPC's will actually be doing any healing, so here's what I'd put.

 

void main ()
{
object oNPC = GetObjectByTag("YOUR_TAG_HERE");
object oOPP = GetObjectByTag("YOUR_TAG_HERE");

ChangeToStandardFaction(oNPC, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oOPP, STANDARD_FACTION_PREDATOR);

ExecuteScript("k_ai_master", oOPP, 1005);

int nCurrentHP;
nCurrentHP=GetCurrentHitPoints(oNPC);
if (nCurrentHP<=40) {
int nMax=GetMaxHitPoints(oNPC);
effect eHeal=EffectHeal(nMax);

ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHeal, oNPC, 0.0);
 }


int nCurrentHP2;
nCurrentHP2=GetCurrentHitPoints(oOPP);
if (nCurrentHP2<=40) {
int nMax2=GetMaxHitPoints(oOPP);
effect eHeal2=EffectHeal(nMax2);

ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHeal2, oOPP, 0.0);
 }

}

 

That should make each NPC heal each time they go below 40 HP. ;)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...