Aller au contenu

Photo

Mephit AI


  • Veuillez vous connecter pour répondre
9 réponses à ce sujet

#1
rjshae

rjshae
  • Members
  • 4 491 messages

I'm trying to get mephits to use their special abilities rather than just melee attacking, but they just seem to ignore the former. Thus far I haven't been able to track down an AI switch to use. Any ideas?

 

Ed.: I should have posted this to the Scripts forum. Sorry.



#2
Dann-J

Dann-J
  • Members
  • 3 161 messages

There are some local variables you can set on a creature that sets the chance of using spells rather than melee. Something to do with hold-overs from the NWN beholder AI. I've set them on some of my spellcasting hostiles, and they seem to make a difference.

 

http://forum.bioware.../#entry17080728



#3
rjshae

rjshae
  • Members
  • 4 491 messages

Thanks. I tried setting X2_L_BEH_MAGIC to 100, but it made no difference; it goes straight to melee.



#4
Dann-J

Dann-J
  • Members
  • 3 161 messages

The AI doesn't bother trying to cast spells against players who are highly resistant or immune. Hostiles won't bother casting fire-based spells on a character with 10 levels of RDD, for instance (due to immunity to fire). Monks or drow with high spell resistance will often get wimpy spellcasters trying to slap them in the face, rather than cast spells at them.

 

Are your mephits using the standard special abilities from the existing blueprints? Some abilities are invisible to the AI (something  about them not having entries in henchspells.2da I think).



#5
andysks

andysks
  • Members
  • 1 650 messages

I would write a script and use the X2_SPECIAL_COMBAT_AI_SCRIPT variable to reference the script. That way your creatures will even do exactly what you want them to, randomly or queued, depending on your script.



#6
andysks

andysks
  • Members
  • 1 650 messages

This is from this thread.

 

http://forum.bioware...se-spells-only/

#include "hench_i0_ai"

void FinishAI(object oTarget = OBJECT_SELF)
{	
  SetLocalInt(oTarget, "X2_SPECIAL_COMBAT_AI_SCRIPT_OK",TRUE);
}

void main()
{	
  object oTarget = GetNearestSeenOrHeardEnemyNotDead();	
  int nSpellId = SPELL_MAGIC_MISSILE;		
  // If we have spells, cast them.	
  if(GetHasSpell(nSpellId))	
  {	
    ClearAllActions(TRUE);	
    ActionCastSpellAtObject(nSpellId, oTarget);	
    FinishAI(OBJECT_SELF);	
    return;	
  }	
	
  // Otherwise, do nothing. 	
  FinishAI(OBJECT_SELF);
}

ColorsFade is not around any more, don't know why. But I am using his scripts and as far as I know, mentioning his name at the top, or leaving the comments as they are is all that he asks in order to use them. I could send them to you to take a look.

 

The above is just an example. His scripts go way further, using a big library filled with functions where you can even specify targets and AoE locations etc. Honestly, I don't need them all, and I don't think you will either. But you can find the spots that will make these mephits useful, or I point you there since the library contains some 1000 lines of code :).


  • rjshae aime ceci

#7
kevL

kevL
  • Members
  • 4 061 messages
(Colors should pack those up and put them on the Vault, i'm sure they're great scripts/functions)

but the ice & fire mephits in Underneath, or what's it called in the OC, were casting breath at me just fine (though i had addons, like Tony's + Kaedrin's).

#8
rjshae

rjshae
  • Members
  • 4 491 messages

The AI doesn't bother trying to cast spells against players who are highly resistant or immune. Hostiles won't bother casting fire-based spells on a character with 10 levels of RDD, for instance (due to immunity to fire). Monks or drow with high spell resistance will often get wimpy spellcasters trying to slap them in the face, rather than cast spells at them.

 

Are your mephits using the standard special abilities from the existing blueprints? Some abilities are invisible to the AI (something  about them not having entries in henchspells.2da I think).

 

I was wondering about that: the test character being too tough to try and use a breath weapon upon. He's a 15th level assassin, so probably high Reflex and thief evade abilities. I'll try a character with a low Reflex save.

 

I do have a custom breath weapon, but I tried changing the breath weapon to Cone of Cold and it made no difference. (Good tip about the henchspells.2da. Thanks.)

 

This is from this thread.

 

http://forum.bioware...se-spells-only/

 

Thanks, I'll give that a try.



#9
andysks

andysks
  • Members
  • 1 650 messages

I tried using breaths as special attacks and to be honest I don't remember if they worked. But I found out in general, that a creature's special ability works exactly as a spell. So not all creatures have to be turned to wizards in order to cast a spell listed in their special ability.

 

In any case, I think Colors is just extremely busy at the moment but I'll ask if I can upload the scripts on his behalf. Or with some hope he still follows this forums and he will see this soon :).



#10
rjshae

rjshae
  • Members
  • 4 491 messages

I was wondering about that: the test character being too tough to try and use a breath weapon upon. He's an 18th level assassin, so probably high Reflex and thief evade abilities. I'll try a character with a low Reflex save.

 

Yes, that was it. I changed to a different character and the mephit used the breath weapon right away. Thanks.