I dropped the code used in the character tab, instead of it I'm going to use the AI packages.
I duplicated the follower AI package, and put the following conditions:
pl getquestcompleted quest: "CW01A" 0 OR
pl getquestcompleted quest: "CWObj" 1 OR
This would make the package stop working when the first imperial quest was completed, and return to work after the war is over. So I deleted the standard follower package from the follower, and put this one in its place.
Then I made three travel packages, where I was going to use fragments.
The fragments were not working initially, they just didnt compiled.
However, I removed the "property" and "auto" from the code, and it compiled this time. The code stayed like this:
Actor npcfollower
Faction CurrentFollowerFaction
Faction PotentialFollowerFaction
Faction PotentialMarriageFaction
npcfollower.RemoveFromFaction(CurrentFollowerFaction)
npcfollower.RemoveFromFaction(PotentialFollowerFaction)
npcfollower.RemoveFromFaction(PotentialMarriageFaction)
This was put in the "on begin" tab of the first travel package.
I'm omitting the name of the follower so that we can focus in the template.
As condition, the travel package have:
pl getquestcompleted quest: "CW01A" 1 AND
The "on end" tab have this code:
Actor npcfollower
Faction MQ101StormcloakFaction
npcfollower.AddToFaction(MQ101StormcloakFaction)
npcfollower.ModActorValue("health", 5000.0)
The travel destination is one of the Stormcloaks camps, pointing around a smithing device there, with radius set as 10.
The health is increased by 5000 points. The second travel package have as conditions:
pl getquestcompleted quest: "CW02A" 1 AND
s getactorvaluepercent health <=0.10 AND
So to not mess with her bleedout (she is still a essential npc) I set the health very high, and when it reaches 500 points she will run. This is the code on begin of the travel package:
Actor npcfollower
Faction MQ101StormcloakFaction
npcfollower.RemoveFromFaction(MQ101StormcloakFaction)
npcfollower.ModActorValue("health", -5000.0)
The destination would be the Dawnstar Inn. The third travel package have these conditions:
pl getquestcompleted quest: "CWObj" 1 AND
The destination would be her initial point of recruitment, and this code would be executed on end of the travel:
Actor npcfollower
Faction CurrentFollowerFaction
Faction PotentialFollowerFaction
Faction PotentialMarriageFaction
npcfollower.AddToFaction(CurrentFollowerFaction)
npcfollower.AddToFaction(PotentialFollowerFaction)
npcfollower.AddToFaction(PotentialMarriageFaction)
However, nothing of this is working. First, I open the console and check her health, and get 191 as value. Then, I set the stage of CW01A as 200, completing the quest. She is still following me, and her health is still 191. No code have fired, not even the first travel package is working. It seems the conditions wont work for AI packages, or I'm missing something. How to make conditions work for AI packages? Is it possible to remove the follower AI package via script?