Jump to content

AI Packages


Recommended Posts

Posted

Has anybody messed with these?

All I can find on the internet is video tutorials about giving NPCs a schedule to work and sleep, which is good, but I'm trying to actually understand how does package system work, in hopes to be able to manipulate combat. (For the most, I just want to make NPCs able to cast custom spells that the base system does not acknowledge)

 

For starters, when does the game evaluate packages?

I know IE scripts are handled by events, and you can put conditions and happenings when an event triggers, but a package can carry conditions and make "procedures" happen, but I cant find anywhere that explains clearly when is this checked by the game.

The video tutorials say to put a schedule to make them happen, but if I want a combat package, I don't want a schedule, I want an AI behavior to constantly be active during combat

 

Second, how do I control how the package ends or repeats?

As a first experiment, I'll try to use a "UseMagic" package, but for what I understand, it is said to end once the magic has been used.

In this case, I'm messing with a cloak spell, and I want the character to use it in combat, and do it again if it wears off, and also I don't want the character to keep on spamming it instead of fighting, I want it to be activated and then move on to actual combat.

But if the package was already "completed" I'm thinking it will not be used again, at least, if my understaing is not failing, until "the next package evaluation" is run, which brings me back to the first question cause I've no idea when is that supposed to happen.

 

Anyone knows?

Posted

sounds like you want to manipulate combat class

 

I think where you see in AI section "use magic", that would be used in a scene.  

 

 

- 1 quick tip when testing with npcs using magic, they typically just won't use any magic if they are low level, make sure your toon is at least lvl 20 for testing. 

 

 

combat class is assigned to npc in AI Data section after clicking on npc in actors tab, and combat class itself can be found in misc section(ck) 

 

cant remember if there is mod that has npcs use candlelight spell when in dark areas, think there is but it might be they just use torches and lanterns. 

 

 

Posted (edited)
29 minutes ago, Heroine HoneyCrotch said:

sounds like you want to manipulate combat class

 

Uhm... no.

 

If you meant Combat Style, I have messed with and it changes inclination to use certain weapons among other things, but this AI package thing has other uses like IE controlling the use of custom spells

 

Increasing magic use in Combat Style cannot make NPCs use unrecognized magic spells.

I also dont know what makes a spell "recognized" or not, but you can IE edit a fireball with certain tweaks and a character will still use the spell if it's on their spell list, but if you give them Heal Other spell they will not use them. Same thing if a custom spell varies too much from the known types NPCs use, so the only way to make them use such magics is with AI packages

Edited by Myst42
Posted
16 minutes ago, Myst42 said:

Increasing magic use in Combat Style cannot make NPCs use unrecognized magic spells.

I also dont know what makes a spell "recognized" or not, but you can IE edit a fireball with certain tweaks and a character will still use the spell if it's on their spell list, but if you give them Heal Other spell they will not use them.

 

 

I get you.  Looking at a custom follower with a heal other spell should tip you off. I think they do that via script in a magic effect. 

 

 

Posted (edited)
21 minutes ago, Myst42 said:

so the only way to make them use such magics is with AI packages

 

still stay that is only for custom scenes, been wrong plenty so Im not betting the house

Edited by Heroine HoneyCrotch
Posted (edited)
2 hours ago, Myst42 said:

I'm messing with a cloak spell, and I want the character to use it in combat, and do it again if it wears off

As long as you have the "recover" flag for it set and it has the highest magnitude(or maybe mana cost) it should be the first spell cast In combat and recast when it wears off regardless of what it does. At least that's how I remember it working, I haven't messed with magic for followers in a couple years now. But generally as long as the spells are affecting enemies or the npc itself they should work with the correct flags, even if they differ a lot from vanilla.

Edited by yorpers
Posted

Most healer followers out there do this via AI package, I already checked there.

 

I have not tested the recover flags, but if you're right it might be the closest I've heard about an explanation on what controls what spells do NPCs use

The one I was trying to apply is basically a copy of the Sun aura drom Dawnguard... It may have the wrong flags set I guess, though that's only a theory for now

 

I did manage to get it working with a UseMagic AI package, and I dipped my toes into AI editing, but I still feel like I havent even begun to understand how the mechanic of the system works.

I'm referring back to the original questions in the OP

 

Reading some documentation, seems that every package is made of procedures, and every procedure ends when it ends (depends on the specific procedure, each ends with unique things) - Which kinda answers my second question, though the documentation is still a bit vague on a lot of them

The first question is still unanswered, and my working theory for now, is that the packages may get re-evaluated after a certain time interval?

The one I did was "simple" UseMagic, but I set it to use it when say, the enemy had Undead keyword, up till there it was fine, ecxept my NPC became inactive and stuck in holding the spell after it was casted, when I needed combat behavior now. So I set a condition to not run the package if the magic effect was active, and that seemed to effectively stop it when needed. If it runs off, I guess the package becomes active again, cause I've seen battle re-casts.

 

 

Posted
33 minutes ago, Myst42 said:

and my working theory for now, is that the packages may get re-evaluated after a certain time interval?

This was my theory as well, It would make sense to just update them on a game tick basis. Otherwise ones involved with quests would probably bug out more than they already seem to?

 

That is just speculation.

 

Looking at the sun aura it doesn't have the recovery flag, but does have a magnitude. I know isran casts it instantly, but I dont know if he recasts it. Your Ai package idea is probably a good call to make sure it works as intended instead of messing with flags.?

34 minutes ago, Myst42 said:

the Sun aura drom Dawnguard

 

Posted (edited)
11 hours ago, yorpers said:

Looking at the sun aura it doesn't have the recovery flag, but does have a magnitude. I know isran casts it instantly, but I dont know if he recasts it. Your Ai package idea is probably a good call to make sure it works as intended instead of messing with flags.?

 

I'm taking the victory for now, but it would be really interesting to learn about what makes NPCs use or not use spells

 

Relevant info for this is, Isran has his own version of the sun aura spell, and he uses it naturally on combat start.

There is 1 difference with the player spell, and it's a condition on the spell that on player version, asks if the magic effect is active to apply a light effect.

Giving Isran's version to an NPC works well, they use it as well, however...

1 change, I switched the magic effect from Isran's to the Player's so the condition on the other effect worked, and created a custom version, and that's when it stopped working

I did not investigate further though, but I guess it would be useful to know why the change made it stopped working, it could be the spell change itself, or it could be the magic effect, and then it would help to know if it's "the magic effect itself" or something in it, like as you proposed, a flag.

 

Healer spells are irredeemable though. In more than a decade, haven't seen a single mod that makes NPCs use those without AI packages

Edited by Myst42
Posted (edited)

Spell use depends on 3 things.

Mana use, damage and distance.

To have fllowers use all spells, you need to modify those.

High damage uses 1/3 of mana. As soon as mana down, the follower uses the next in manna pool fitting with highest damage.

The followers use healing after combat or, you need to set defensive higher than attack in combat package.

 

For the ai pack, you need to set a subroutine, repeat when finished. 

Subroutines define the behaviour stacked. Every stacked routine can be used e.g. to cast a spell.

Every function in a routine must be defined.

 

To get an idea about super stacked ai, download this and check the packages.

 

https://www.nexusmods.com/skyrim/mods/33002

 

cave eats

Ai pack still set as template.

Templates are empty, there is nothing defined.

Best copy an ai, not template, and modify this one.

Ceck all flags, must finish, repeat when complete and so on.

 

 

Edited by Tlam99
Posted

Turns out my "victory" was only partial as the AI package only seems to work on LE

 

Ported my work to SE and the package is completely ignored and the spell is never ever casted.

Sad, infuriating and very frustrating cause  had just found out how to make a very complex thing and I was very glad it was working.

I even had planned to come back here to post about continued discoveries on packages, like IE, the "must complete" flag works like a charm to stop package use once a magic spell has been used.

 

Except it doesn't because on SE the package isn't even acknowledged.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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