Jump to content

Followers on a script scale


kcaz

Recommended Posts

So I know there has been a lot of talk about making it possible to have many followers, so I have been looking around the way Bethesda has implemented the system. I am new to modding, but I am not new to scripting so I have a fairly good idea what is going on, although I still don't have the entire story.

 

The main connection from scripts to the creation kit comes in the form of the quest DialogueFollower. This contains everything the followers say, using the script DialogueFollowerScript to add followers and animals, to dismiss them, and to alter their states. Now this is the part I cannot understand. I was trying to make a spell which would make the target your pet, independent of the follower system. In the DialogueFollowerScript, to make someone your follower it basically calls SetPlayerTeammate() on the actor, sets the relationship status to ally, changes the follower alias to the actor, and sets the PlayerFollowerCount to 0.

 

In my spell, therefore, I figured that as long as I changed the relationship status and called SetPlayerTeammate(), everything should work, however when I do this the actor acts as my teammate, but will not literally follow me. The only way this can be possible, therefore, is that there is some other script which makes the follower follow the player. In the DialogueFollowerScript, there is a function to make the follower follow, for when you click on the follow me button and leaving the follower to wait. The only thing which effectively happens is it sets an AV called WaitingForPlayer to 0. That means that there has to be something else controlling the actors movement. I also tried in the spell function setting the target actors AV WaitingForPlayer to 0, but that didn't change anything.

 

So basically, I have no idea what makes followers follow you exactly. I am new to modding, however, so if there is an obvious answer sorry, and thanks for reading!

Link to comment
Share on other sites

NPC's have AI packages. The movement part you're not seeing will be because that has not been added. (PlayerFollowerPackage I think)

As you're new to modding then going over the Tutorials will give you a better idea of the game anatomy.

http://www.creationkit.com/Bethesda_Tutorial_Packages

 

BTW, this is an optimistic project for your first mod ;)

Link to comment
Share on other sites

So I know there has been a lot of talk about making it possible to have many followers, so I have been looking around the way Bethesda has implemented the system. I am new to modding, but I am not new to scripting so I have a fairly good idea what is going on, although I still don't have the entire story.

 

The main connection from scripts to the creation kit comes in the form of the quest DialogueFollower. This contains everything the followers say, using the script DialogueFollowerScript to add followers and animals, to dismiss them, and to alter their states. Now this is the part I cannot understand. I was trying to make a spell which would make the target your pet, independent of the follower system. In the DialogueFollowerScript, to make someone your follower it basically calls SetPlayerTeammate() on the actor, sets the relationship status to ally, changes the follower alias to the actor, and sets the PlayerFollowerCount to 0.

 

In my spell, therefore, I figured that as long as I changed the relationship status and called SetPlayerTeammate(), everything should work, however when I do this the actor acts as my teammate, but will not literally follow me. The only way this can be possible, therefore, is that there is some other script which makes the follower follow the player. In the DialogueFollowerScript, there is a function to make the follower follow, for when you click on the follow me button and leaving the follower to wait. The only thing which effectively happens is it sets an AV called WaitingForPlayer to 0. That means that there has to be something else controlling the actors movement. I also tried in the spell function setting the target actors AV WaitingForPlayer to 0, but that didn't change anything.

 

So basically, I have no idea what makes followers follow you exactly. I am new to modding, however, so if there is an obvious answer sorry, and thanks for reading!

 

Create a follower package for whichever creature you want to have be your follower and set a condition that your spell is cast on them for the follower package to go into effect. You would have to make custom dialogue scripts to control their actions after that. I'm not sure how dismissing them would work, but if it is required that the spell is an active effect, I suppose when the spell wears off the creature will no longer act as a follower.

Link to comment
Share on other sites

I made some companion mods for Oblivion which I never released so I have a little experience with this type of thing and I know what I'm looking at in the Ck scripts. The way it works in the CK is that when the Follower alias is called on a reference, that alias overlays their behavior. It is like asking someone to pretend to be someone else. You ask NPC X to pretend to be your follower and that is what they do. The follow and wait packages are built into the alias along with some follower factions. It even equips a hunting bow and some arrows. I have made about two dozen attempts to get around the follower limit in various ways but the stopping point is always getting a script that works with a new alias.

 

The way I see it is this, If you could duplicate every aspect of the follower set-up the way it is now with a given prefix ... let's just say "AAA", you could get it to work, in theory. The problem that I have had is that something gets lost in the translation. I have built the packages, factions, globals, aliases, quests, dialogues, scripts etc etc and I still end up not being able to get it working.

 

Also, just so you know, the follower function actually spans two quests. First, the player has to engage the NPC in the "DialogueFavorGeneric" quest where the dialogue entries for "Follow me. I need your help." appear. That quest actually checks the conditions and determines that the global "PlayerFollowerCount" equals 0 along with some othe r things. If it all checks out, it then engages the "(pDialogueFollower as DialogueFollowerScript).SetFollower(akspeaker)" at the end of the topic causing the alias switch to take place. This part seems odd to me because the aliases belong to the other quest, as does the script and functions. If "PlayerFollowerCount" equals more than 0 the dialogue in the "DialogueFollower" quest kicks in and you get a negative response. Oddly, that quest is also used after the person becomes your follower, to handle the other dialogue choices.

 

I have been really close a few times. I had all of the dialogue options working with up to 300 followers but they kept removing one NPC and replacing it with the other due to the follower alias limitation. I never have been able to get multiple aliases working, having each represent a new follower. It is my belief that without a new alias for each NPC, they just replace each other by default and I am having a bear of a time getting a new alias to work. If I understood the other functionality of aliases, I may even find that an Alias can be used across more than one NPC and that would also be a usable solution. Also, there would need to be a function which could determine whcih alias to apply to the NPC that you're talking to based on a follower count that could move up to some higher number. I used the "PlayerFollowerCount.Mod (1)" and "PlayerFollowerCount.Mod (-1)" to keep track of how many followers were with you. This allowed you to control conditions but this meant that you had to have a new topic for each of the 300 followers. There has to be a better way.

 

My main limitation is that I am not really a scripter. I dabble but that's it. When functionality start spanning 4 or so scripts I get pretty lost. This follower function involves at least 5 scripts. FavorDialogueSCRIPT, DialogueFollowerSCRIPT, FollowerAliasSCRIPT, ReferenceAliasSCRIPT, and the small script which is generated dynamically upon the topic generation which begins with "TIF_" after you put in the fragment after the initial dialogue.

 

I even tried a follower for followers thing where the followers followed each other instead of the player ... that didn't work so well but it seemed promising at one point.

 

I would like to work with you on your efforts if you're interested.

Link to comment
Share on other sites

You don't -have- to use dialogue or even quest aliases at all the create followers. In my mod I can have multiple followers which are manipulated using nothing more than a menu message, an OnActivate event in an Actor extended script and 1 AI package. I haven't tried more than a few followers but each is completely independent so the only real limitation is how far you can go until the game crashes, as far as I know.
Link to comment
Share on other sites

Thanks David!

 

I 'm not sure how I missed your mod but I definitely did. You have done some really good modding for Oblivion and I'm glad to see you doing it for Skyrim too. I have to admit though, even though your mod does provide multiple followers, I want to have the ability to make friends with a stock NPC and recruit them. For my personal use, I'm using your mod to attempt to do that. I know that the juice may not be worth the squeeze but that's never stopped me from squeezing. If I am able to adapt your mod to that purpose, I'll send you a message and see if you want to release it. Thanks again for the great work.

 

Wulf

Link to comment
Share on other sites

  • Recently Browsing   0 members

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