Jump to content

[LE] Need help making a follower use a spell on command (using AI packages)


Recommended Posts

I've been trying to make a follower use a certain spell when the player commands it (using AI packages) but I can't get it work. Which is weird because I already got her to use a healing spell on the player when they are below 50% health using an almost identical package.

 

Now, I'm a complete noob with packages and I got the healing package work properly by using another mod as a template. But I did get it work and assumed it would be easy to make a "use on command" package using the healing package as a template. I copied the package and made necessary changes - changed the spell used and conditions from the player being at low health to the player having a magic effect on them. Well, also the cooldown since it's supposed to be an extremely powerful spell that has casting limits. The "command" was a self-cast spell that applied to the player the effect that was used for the check. Yet this "command" package didn't work for some reason and I tried changing different things - switched it from being a power to an orditary spell, switched conditions to check for the command command effect on the follower and making the command spell a target spell, removed the healing package and left only the command package in case they conflicted... nothing works. In fact, it even got weirder with leaving only the command package because the follower began to constantly sheath/resheath her weapon in combat which never happened with the healing package. And the first one is based off the second one! I'm really at a loss here. Could anyone tell me what's wrong? Obviously you'll need to see the packages so here is the .esp of my mod. I'm using dropbox because the forums won't let me attach it directly, saying "You aren't permitted to upload this kind of file". Healing package ID is _BrigitteLindholmReapiPackAIPackage (yeaaahhh, I misspelled it, didn't notice for a long time and then didn't bother changing it, it's supposed to be "RepairPack", not "ReapiPack" because that's what the healing spell is), command package ID is _BrigitteLindholmRallyPackage.

Link to comment
Share on other sites

Not modding atm but I can mention some things

 

A basic example would be for your command to make a change to the follower that the package is watching for. Say... a faction rank, When you want them to do whatever action like cast something, you set their faction rank to whatever faction and rank you setup in the AI pack, to that rank. Then shortly afterwards revert the faction rank to whatever it was so they dont cast again till wanted. If you want more conditions you can add them too like if its a high mana cost spell, you can regulate that with a CurrentMagiicka > 500 or whatever amount, so that they wont always cast that one

 

As for targeting that can be trickier. Ofc player is easy boom cast at player. But if you want a dynamic target you have to basically scan for one. You use object list and target selector for that

 

If you would like examples, Follower Live Package has some pretty advanced packages you can use as a guide

Link to comment
Share on other sites

Changing faction rank would require scripting, wouldn't it? I can't do that, the best I can do when it comes to scripts is understand what they should do (unless they're too complex for me to understand) and maybe put together something up using existing scripts as templates but I won't be able to make a new script from scratch yet. And it would be better to use as few scripts as possible anyway.

 

But aside from achieving desired functionality for my mod, in this case I also really want to know what the heck is wrong with the command package. It's almost completely identical to the healing package, the difference being in the spell used and the player value used for the check yet one of the packages works just as it should and the other doesn't work at all. Like... why? Although... the spell that should be used on command is a cloak spell and the healing spell is a simple targeted spell. Could it not work becasue of the spell being a cloak?

Link to comment
Share on other sites

I'm not sure, but you have the package "useMagic" but I think it's "shout."

I've only ever used ai to force an npc to shoot at practice dummies.

What if you just add a quest with one line of dialogue that says something like, "cast rally, please." and she replies with some generic dialogue like, "I understand." Or use XVASynth to write/record original lines. Anyway, the dialogue can end with a script fragment that forces the follower to cast a spell.

Link to comment
Share on other sites

Dialogue isn't really an option because it won't be available in combat and the whole purpose of Rally is to greatly increase combat capabilities of nearby allies. While using dialogue before an encounter is possible, telling the follower to use a combat buff spell outside of combat is awkward, some encounters are sudden (like a dragon swooping out of the blue sky) and, more importantly, I want to eventually make my mod as immersive as possible, with the follower actively reacting to the surroudnings and stuff. Not having an option to ask her to use her ultimate ability in a fight whee things suddenly went south and instead having to reload a save, enter dialogue and ask her to cast it before the fight would be quite immersion-breaking.

 

Regarding the "UseMagic"/shout thing, shouts are magic as far as the game's concerned and there is no "UseShout". Not to mention that Rally isn't a shout in the first place.

Link to comment
Share on other sites

Its just called Shout not UseShout but yes Shouting can be done on command too and visually looks different aka they shout vs use their hands to cast. Yes script is my goto means for commanding but I suppose you could use diff conditions like IsPlayerBlocking or whatever its called in CK. Basically though the problem in combat is stuff may get delayed so A) it doesnt nec happen the exact moment you want it to and B) conditions to do it may no longer apply when its "turn" in the AI stack comes up

 

So yeah doing it without script is possible but won't be as easy or reliable imo

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...