Jump to content


Photo

Can you check if the enemy was affected


7 replies to this topic

#1 Meira

Meira

    I'm the snow on your lips

  • Gibberlings
  • 1987 posts
  • Location:Helsinki, Finland

Posted 24 June 2009 - 07:52 AM

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.
Ihmeellinen meri

Kummalliset kalat liukuvat syvyydessä,
tuntemattomat kukat loistavat rannalla;
olen nähnyt punaista ja keltaista ja kaikki toiset värit -
mutta ihana meri on vaarallista nähdä,
se herättää tulevien seikkailujen janon:
mitä on tapahtunut sadussa, on tapahtuva minullekin.

- Edith Södergran



Amber - The BG2 NPC Mod Project Now released!
Amber's discussion forum at Gibberlings 3

#2 Ardanis

Ardanis

    A very GAR character

  • Members
  • 2243 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 24 June 2009 - 01:18 PM

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.
"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#3 Meira

Meira

    I'm the snow on your lips

  • Gibberlings
  • 1987 posts
  • Location:Helsinki, Finland

Posted 24 June 2009 - 01:54 PM

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.

Edited by Meira, 24 June 2009 - 01:56 PM.

Ihmeellinen meri

Kummalliset kalat liukuvat syvyydessä,
tuntemattomat kukat loistavat rannalla;
olen nähnyt punaista ja keltaista ja kaikki toiset värit -
mutta ihana meri on vaarallista nähdä,
se herättää tulevien seikkailujen janon:
mitä on tapahtunut sadussa, on tapahtuva minullekin.

- Edith Södergran



Amber - The BG2 NPC Mod Project Now released!
Amber's discussion forum at Gibberlings 3

#4 Avenger

Avenger
  • Modders
  • 3395 posts
  • Gender:Male
  • Location:Hungary

Posted 24 June 2009 - 02:01 PM

You can add a resistable+saving throw to the modify global variable effect.
I'm almost sure it will set the variable only when the spell works.

#5 Ardanis

Ardanis

    A very GAR character

  • Members
  • 2243 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 24 June 2009 - 02:02 PM

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).
"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#6 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 6907 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 24 June 2009 - 07:59 PM

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?
I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams

#7 Ardanis

Ardanis

    A very GAR character

  • Members
  • 2243 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 25 June 2009 - 08:25 AM

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 :)
"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#8 Avenger

Avenger
  • Modders
  • 3395 posts
  • Gender:Male
  • Location:Hungary

Posted 26 June 2009 - 04:26 AM

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.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users