Jump to content

Detecting an in-party battle


WizWom

Recommended Posts

In BG1, Ajantis starts battles with the evil characters in the party from BAJANTI with:

Attack([0.0.0.0.0.0.MASK_EVIL])

 

Simple, straightforward, and, oddly, he has no code to be unselectable while doing it, or anything else.

 

So, I wanted my PC to join in to this attack, because I'm a good guy, and I won't see someone fight evil without helping.

I figured this:

IF
InParty(LastTargetedBy("Ajantis"))
!ActuallyInCombat()
THEN
RESPONSE #100
	MakeUnselectable(6)
	Attack(LastTargetedBy("Ajantis"))
	Continue()
END

 

But it actually din't pick up on the battle happening.

 

So I tried

See(LastTargetedBy("Ajantis"))

!ActuallyInCombat()

 

And that didn't work.

 

Nor did

See(NearestEnemyOf("Ajantis"))

!ActuallyInCombat()

 

 

Well, at least I get to see Ajantis cut down Xzar over and over. And then say "It it unfortunate that our companion died before he could recant his ways."

Link to comment

Hm.

 

I sort of have prepared for this, adding couple values to specific.IDS

 

I guess If I really want, I should have ajantis set the specific for a priority target, and code to attack that. Might make it simpler to participate in the other party battles, too - I just set the specific to make them priority and let the AI decide how to deal wth them.

 

Oh, but then I need to make sure that my AI script is correct and active, that is, not diabled by turning off party AI. yuck.

 

I could so what the other battle scripts do, and put some simple battle scripting in the override script. At least I could do it so I wouldn't have to make target selections.

Link to comment

Archived

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

×
×
  • Create New...