Jump to content

Can you check if the enemy was affected


Meira

Recommended Posts

So, I'd like to know when my character not only casts a specific spell successfully, but when the enemy fails the sawing throw and/or isn't able to avoid the effects of the spell. In other words, I want to know when the enemy is toast due a specific spell. I think that it might not be possible to check this, but maybe there's an combat AI expert out here who knows for sure.

Link to comment

There're as many as 200 stats in BG2, most of which are already used either by the game or by AI mods, so meddling in there is undesirable sort of.

 

You situation, however, may or may not have an easy solution, depending on the curcumstances. I presume you need to check if a certain creature (only one) is killed by a certain spell, so that it can be later reflected in, say, dialog.

 

The '(0x109) Script: Modify Global Variable [265]' effect added to the spell should generally work fine. Of course, it is quite possible that many other creatures will be hit with it before your encounter, so to avoid the mess you may want to set the variable back to 0 when starting your sequence.

Link to comment
You situation, however, may or may not have an easy solution, depending on the curcumstances. I presume you need to check if a certain creature (only one) is killed by a certain spell, so that it can be later reflected in, say, dialog.

Not exactly. I don't really care who or what the creature affected by the spell is. I just need to know when my character uses the spell successfully for the first time. The caster and the spell are know, but the target can be anybody.

 

The '(0x109) Script: Modify Global Variable [265]' effect added to the spell should generally work fine. Of course, it is quite possible that many other creatures will be hit with it before your encounter, so to avoid the mess you may want to set the variable back to 0 when starting your sequence.

 

I'll look into this. I'm I correct in assuming that by adding this effect to my (innate) spell I would be able to set a global variable when the spell affects it's target? That would be perfect.

Link to comment
I just need to know when my character uses the spell successfully for the first time.
Then it's even better, as ~IF !Global("meira's_spell","global",0) THEN ...~ would all that it takes to be detected.

 

I'm I correct in assuming that by adding this effect to my (innate) spell I would be able to set a global variable when the spell affects it's target?
If you assign the same type and value for a save as those of the real effect then both the global and the effect should apply at the same time, if the target fails it's save (or magic resistance, for that matter).
Link to comment

What about the reverse, where an innate from the PC is used on an NPC and they want to comment on it - or an NPC fails a save versus a specific spell?

 

Most of all, do you folks have a good example of usage for setting this via weidu, or do you suggest building the .eff in NI/DLTCEP and attaching it?

Link to comment
What about the reverse, where an innate from the PC is used on an NPC and they want to comment on it - or an NPC fails a save versus a specific spell?
For this case, I suppose '187 - Script: Store Local Variable' would be better.

 

Most of all, do you folks have a good example of usage for setting this via weidu, or do you suggest building the .eff in NI/DLTCEP and attaching it?
While I'm very fond of keeping everything in the code format, instead of tossing files from one folder to another, sometimes it may get paranoidal. This one is probably such a case :)
Link to comment
Most of all, do you folks have a good example of usage for setting this via weidu, or do you suggest building the .eff in NI/DLTCEP and attaching it?

 

Storing binary data in a textfile (tp2) is lame :)

You can get away with it if you do it only a few occasions, though.

Link to comment

Archived

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

×
×
  • Create New...