Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Add follower to another faction


Wolfstorm321
 Share

Recommended Posts

I'm making a civil war scenario where two of my characters will fight each other in their respective playthroughs.

Usually my characters are turned into followers in each others playthroughs, so this character is a follower which will be turned into a enemy. She is set to essential, so she cannot die, so the idea would be that each time she is defeated she moves to another enemy camp until the war is over.

So far, I was able to duplicate the AI follower package where she will be no longer an follower if CW01A is completed and will become a follower again when CWObj is completed (when the war is over).

However, Im having issues to set her to the Stormcloak faction. If I do that in the character tabs, she will be attacked before the quest CW01A is completed, since I use civil war mods which set skirmishes down the road. So I need to use Papyrus, which I dont know how to use. I looked for events that would link to a quest but found none, then after research discovered that EOF means "event or function", so I decided to put a function in place of a event.

So far, I put this:

Scriptname npcnameStormcloaks extends Actor  

Actor property npcname auto

npcname.RemovefromFaction(CurrentFollowerFaction)
    if CW01A.IsCompleted()
    endif
npcname.AddToFaction(MQ101StormcloakFaction)
    if CW01A.IsCompleted()
    endif

Im omitting the name of character so that this can be used as reference for other characters as a template.

What I'm doing wrong here? I've got this message when trying to compile: "no viable alternative at input '.'" at line 5.

Link to comment
Share on other sites

It looks like you wrote your script backwards. Let's see this. This should be good:

if (CW01A.IsCompleted())
  npcname.RemovefromFaction(CurrentFollowerFaction)
  npcname.AddToFaction(MQ101StormcloakFaction)
endIf

How do you define npcname?

You have excellent reference pages:

Edited by ladyonthemoon
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...