trilioth Posted January 30, 2013 Share Posted January 30, 2013 (edited) FNV Companion Tutorialwith functioning companion wheelIntroduction:This tutorial is for users that have a decent understanding of using the GECK. This will be a basic guide for creating companions. There is more advanced things that can be done, but my intent is to keep it pretty simple. Nothing in this tutorial relates to custom voices.For a visual reference to this guide check out on creating companions. I wrote this guide after watching his videos and creating my own companion mod.This is not a setup to limit the number of followers you can have. I may write guide for that kind of setup later. As I have not actually tried and tested that kind of setup, I am sticking to the simple version.Step 1: Create an NPC and put it in the world.On the factions tab right click on the factions list and select new. Select DontTazeMeBroFaction. You may want to create a faction specifically for your new companion. The videos mention adding the player faction. Vanilla companions are not set with the player faction, instead they have other factions, but I have not noticed any problems with using the player faction.To make this simpler, I will be referring to the NPC as Bob, his Editor ID will be BobComp, and he will be located in Goodsprings in the WastelandNV worldspace. I will go along using Editor IDs, Reference IDs, Script Names to match with the name of the NPC.If you want your companion to have a special weapon that doesn't use ammo, like Boone's Sniper Rifle, you will need to create a new weapon, uncheck the playable option under flags and switch Ammunition to AmmoCompanion. If you do this, be sure to add it and 1 AmmoCompanion to the NPC's inventory.When you put the NPC in the world, be sure to give the NPC a Reference ID, such as BobCompREF.You will also want to create a home marker for Bob and give this marker a Reference ID, such as BobCompMarker.Note: I had trouble creating an "African-American" NPC. The only way I was able to resolve the body skin color not matching the race is by making the file into an esm.Step 2: Create an Object Script and an NPC script.The Object Script: scn BobCompScript int DoOnce ; These variables will be used in topic conditions. int HasBeenHired int L38 ; These variables are used by the companion wheel. int CombatStyleRanged int CombatStyleMelee int IsFollowingDefault int IsFollowingLong int FollowerSwitchAggressive int Waiting int WeaponOut ; with this variable you won't need to a pencil (commented out below) Begin GameMode if DoOnce == 0 ; Shouldn't have to set these to zero as they are set to 0 by default ; Set HasBeenHired to 0 ; Set L38 to 0 Set CombatStyleRanged to 1 ; Set CombatStyleMelee to 0 ; Set IsFollowingDefault to 0 ; Set IsFollowingLong to 0 ; Set FollowerSwitchAggressive to 0 ; Set Waiting to 0 ; don't need use pencil see post linked in the note below ; additem Pencil01 1 1 ; removeitem Pencil01 1 1 Set DoOnce to 1 endif End Note: the additem and removeitem functions are there to make sure the NPC doesn't do something like this. I asked for help with this issue here.The Quest Script: Be sure that you set script type to Quest.It is my understanding that the quest requires that you have a script set. The following script doesn't do anything, but set the DoOnce variable to 1. You could however set up some other variables related to topic conditions, but I won't get into that. scn BobCompQS int DoOnce Begin GameMode if DoOnce == 0 set DoOnce to 1 endif End Step 3: Create AI PackagesIn the Object Window under Actor Data is a section called Packages. This is where you will need to create the new forms.I added some conditions to the AI Packages that the are not shown in the tutorial vidoes. These differences reflect what I see in the vanilla companions.You will need five AI Packages for a basic setup. BobCompFollowDefaultBobCompFollowLongBobCompHomeBobCompL38BobCompWait BobCompFollowDefault:Set Package Type to FollowFollow Tab:Under Follow Target select Specific Reference and chose PlayerRef in Ref box. The cell box doesn't matter.Set Follow Distance to 330. This is a typical distance for default, which is basically the "stay close" option.Flags Tab:Check:Always RunAllow SwimmingAllow FallsContinue During CombatOptionally you can uncheck Enable Fallout Behavior and chose your desired options. I chose to have only Friendly fire comments and Allow Idle Chatter. Conditions Tab:Create three conditions using the GetScriptVariable Function. The variable checks should be as follows:Reference: 'BobCompREF', HasBeenHired == 1 ANDReference: 'BobCompREF', Waiting == 0 ANDReference: 'BobCompREF', IsFollowingDefault == 1 AND BobCompFollowLong:To make things easier, after closing the first package open it and rename it, changing Default to Long in the Editor ID.Follow Tab:This can remain the same except change Follow Distance to 500.Flags Tab:This can remain the same or you can choose to tweak it some.Conditions Tab:Change the condition pointing to IsFollowingDefault to IsFollowingLong. BobCompHome:The setup for Home can vary depending on how you want the NPC to act at home, but I chose the following.Set Package Type to Sandbox.Sandbox Tab:Wander Location Dialog:Click on the button under Wander Location to bring up a Location Dialog.Select the Near Reference OptionChoose Goodsprings (-18,0) in the Cell drop-down box.Choose BobCompMarker in the in the Ref drop-down box.This could be done simply using an entire cell by selecting the In Cell option.Set Radius for however far you want Companion to move around. I chose 500. Flags Tab:I checked the Enable Fallout Behavior option and no other option.Conditions Tab:Create two conditions using the GetScriptVariable Function.Reference, 'BobCompREF', HasBeenHired == 0 ANDReference, 'BobCompREF', L38 == 0 AND BobCompL38:Just like BobCompHome except:On the Sandbox Tab under Wander Location, choose the In Cell option and select Lucky38SuiteFloor22.On the Condtions Tab change the condition for L38 variable to equal 1. BobCompWait:Package Type: GuardGuard Tab:Reference to Guard: (I am not sure what effect this has.)Cell: Goodsprings (-18,0)Ref: BobCompREFCheck Guard Location:Set the Near Current Location in by clicking the button underneath.Radius: 500 (Boone's is set to 0. I suppose the radius allows them to wander a bit.)Continue in Combat Behavior:Select Remain Near Guard Location Flags Tab:Continue During CombatFriendly Fire commentsAllow Idle ChatterConditions Tab:Create two conditions using the GetScriptVariable Function.Reference, 'BobCompREF', HasBeenHired == 1 ANDReference, 'BobCompREF', Waiting == 1 AND Add the New AI Packages to BobComp.Step 4: DialogCreate a new Quest with an ID such as: BobCompQuestQuest Data:Priority: 50Check Start Game EnabledScript Process Delay: DefaultNote: You will have to click OK and then open the quest again, before being able to attach a quest script. If your quest script is set as a quest script, then you will be able to find it.Set the Quest Script to BobCompQSQuest Topics:In the list pane on the left, right click and select Add Topic. Find and add the following topics: FollowersFiredFollowersFiredNoFollowersFiredYesFollowersFiredYesSuiteFollowersHiredFollowersLetsGoFollowersTacticsFollowersTacticsCombatFollowersTacticsCombatAggressiveFollowersTacticsCombatENDFollowersTacticsCombatGOODBYEFollowersTacticsCombatMeleeFollowersTacticsCombatPassiveFollowersTacticsCombatRangedFollowersTacticsDistanceFollowersTacticsDistanceDefaultFollowersTacticsDistanceENDFollowersTacticsDistanceGOODBYEFollowersTacticsDistanceLongFollowersTacticsEndFollowersTradeFollowersWaitGREETING For a basic setup I simply added one response for the top list pane. Take note of the Conditions list pane, the Choices list pane, the Goodbye checkbox and the Result Script (Begin) box. In the Choices list, the order they show up in the list is the order they will be displayed in dialog.Note: Some of the lines I will be showing for the Result Script (Begin) box where not covered in the tutorial videos. I found them by looking through the VNPCFollowers quest. They will be denoted with *** in a comment at the end of each line. There is also a condition for FollowersFiredSuite that was not used in the tutorial videos. This condition checks the VNPCFollowers quest to see if you have gained access to the Lucky 38.FollowersFired:Response:Are you sure about that?Conditions:GetScriptVariable; Reference: 'BobCompREF', HasBeenHired == 1 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDChoices:FollowersFiredNoFollowersFiredYesFollowersFiredYesSuite FollowersFiredNo:Response:Ok.Conditions:GetIsID; NPC: 'BobCompREF' == 1 ANDCheck Goodbye FollowersFiredYes:Response:Ok.Conditions:GetIsID; NPC: 'BobCompREF' == 1 ANDCheck GoodbyeResult Script (Begin):Set BobCompREF.Waiting to 0Set BobCompREF.L38 to 0Set BobCompREF.HasBeenHired to 0BobCompREF.SetPlayerTeammate 0BobCompREF.RemoveFromFaction FollowerFaction ; ***BobCompREF.EvaluatePackage FollowersFiredYesSuite:Response:Ok.Conditions:GetScriptVariable; Reference: 'VNPCFollowers', bSuiteAvailable == 1 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDCheck GoodbyeResult Script (Begin):Set BobCompREF.Waiting to 0Set BobCompREF.L38 to 1Set BobCompREF.HasBeenHired to 0BobCompREF.SetPlayerTeammate 0BobCompREF.RemoveFromFaction FollowerFaction ; ***BobCompREF.EvaluatePackage FollowersHired:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', HasBeenHired == 0 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDCheck GoodbyeResult Script (Begin):Set BobCompREF.HasBeenHired to 1Set BobCompREF.IsFollowingDefault to 1BobCompREF.SetPlayerTeammate 1BobCompREF.SetIngoreFriendlyHits 1BobCompREF.AddToFaction FollowerFaction 1 ; ***BobCompREF.SetFactionRank TeammateFaction 1 ; ***BobCompREF.EvaluatePackage FollowersLetsGo:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', Waiting == 1 ANDGetScriptVariable; Reference: 'BobCompREF', HasBeenHired == 1 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDCheck GoodbyeResult Script (Begin):Set BobCompREF.Waiting to 0BobCompREF.EvaluatePackage FollowersTactics:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', HasBeenHired == 1 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDChoices:FollowersTacticsCombatFollowersTacticsDistanceFollowersTacticsEnd FollowersTacticsCombat:Response:Ok.Conditions:GetIsID; NPC: 'BobCompREF' == 1 ANDChoices:FollowersTacticsCombatAggressiveFollowersTacticsCombatPassiveFollowersTacticsCombatMeleeFollowersTacticsCombatRangedFollowersTacticsCombatENDFollowersTacticsCombatGOODBYE FollowersTacticsCombatAggressive:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', FollowerSwitchAggressive == 0 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDResult Script (Begin):Set BobCompREF.FollowerSwitchAggressive to 1 FollowersTacticsCombatEND:Response:Ok.Conditions:GetIsID; NPC: 'BobCompREF' == 1 AND FollowersTacticsCombatGOODBYE:Response:Ok.Conditions:GetIsID; NPC: 'BobCompREF' == 1 ANDCheck Goodbye FollowersTacticsCombatMelee:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', CombatStyleMelee == 0 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDResult Script (Begin):BobCompREF.SetCombatStyle FollowersCombatStyleMeleeSet BobCompREF.CombatStyleRanged to 0Set BobCompREF.CombatStyleMelee to 1 FollowersTacticsCombatPassive:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', FollowerSwitchAggressive == 1 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDResult Script (Begin):Set BobCompREF.FollowerSwitchAggressive to 0 FollowersTacticsCombatRanged:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', CombatStyleRanged == 0 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDResult Script (Begin):BobCompREF.SetCombatStyle FollowersCombatStyleRangedSet BobCompREF.CombatStyleRanged to 1Set BobCompREF.CombatStyleMelee to 0 FollowersTacticsDistance:Response:Ok.Conditions:GetIsID; NPC: 'BobCompREF' == 1 ANDChoices:FollowerTacticsDefaultFollowerTacticsLongFollowerTacticsENDFollowerTacticsGOODBYE FollowersTacticsDistanceDefault:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', IsFollowingDefault == 0 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDResult Script (Begin):Set BobCompREF.IsFollowingLong to 0Set BobCompREF.IsFollowingDefault to 1BobCompREF.EvaluatePackage FollowersTacticsDistanceEND:Response:Ok.Conditions:GetIsID; NPC: 'BobCompREF' == 1 AND FollowersTacticsDistanceGOODBYE:Response:Ok.Conditions:GetIsID; NPC: 'BobCompREF' == 1 ANDCheck Goodbye FollowersTacticsDistanceLong:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', IsFollowingLong == 0 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDResult Script (Begin):Set BobCompREF.IsFollowingLong to 1Set BobCompREF.IsFollowingDefault to 0BobCompREF.EvaluatePackage FollowersTacticsEnd:Response:Ok.Conditions:GetIsID; NPC: 'BobCompREF' == 1 AND FollowersTrade:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', HasBeenHired == 1 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDCheck GoodbyeResult Script (Begin):BobCompREF.OpenTeammateContainer FollowersWait:Response:Ok.Conditions:GetScriptVariable; Reference: 'BobCompREF', HasBeenHired == 1 ANDGetScriptVariable; Reference: 'BobCompREF', Waiting == 0 ANDGetIsID; NPC: 'BobCompREF' == 1 ANDResult Script (Begin):Set BobCompREF.Waiting to 1BobCompREF.EvaluatePackage GREETING:Response:Hello.Conditions:GetIsID; NPC: 'BobCompREF' == 1 AND Afterward:I was up all night working on this. Hopefully there are no mistakes. If you notice any discrepancies or anything missing, please let me know.The spoiler sections are an attempt to reduce the display length of the post. The formatting is an attempt to make this easy to read and understand.I recommend watching the videos mentioned at the beginning of this post. I also provided a link to my mod. It is very similar to this tutorial.If you are not familiar with using the GECK, then I please take the time to work through the tutorials provided at the GECK website. Edited November 29, 2015 by trilioth Link to comment Share on other sites More sharing options...
DizzasterJuice Posted January 30, 2013 Share Posted January 30, 2013 Note: the additem and removeitem functions are there to make sure the NPC doesn't do something like this. I asked for help with this issue here.Thank you very much for this info....it has been driving me crazy especially since my follower is sportin' a gatling laser. :biggrin: excellent tutorial. Link to comment Share on other sites More sharing options...
trilioth Posted February 2, 2013 Author Share Posted February 2, 2013 (edited) Edits: (This is where I will make note of the changes I make to the original post.)2/2/2013:[step 1:] On the factions tab right click on the factions list and select new. Select DontTazeMeBroFaction. You may want to create a faction specifically for your new companion. The videos mention adding the player faction. Vanilla companions are not set with the player faction, instead they have other factions, but I have not noticed any problems with using the player faction.[step 3:] Add the New AI Packages to BobComp.[step 4 > FollowersFiredYes: > Result Script (Begin):] BobComp.SetPlayerTeammate 0[step 4 > FollowersFiredYesSuite: > Result Script (Begin):] BobComp.SetPlayerTeammate 0(I checked my mod and I didn't forget to do any of these things, thankfully.)2/6/2013:[step 4:] I misspelled the references names in FollwersFiredYes and FollowersFiredYesSuite (see above).[step 4 > FollowersFiredYes: > Result Script (Begin):] BobCompREF.SetPlayerTeammate 0[step 4 > FollowersFiredYesSuite: > Result Script (Begin):] BobCompREF.SetPlayerTeammate 0[step 4 > FollwersTrade: > Result Script (Begin): Didn't need the one after OpenTeammateContainer. Conditions prevent this option if the NPC is not a teammate.11/28/2015:[step 2: Create an Object Script and an NPC script. > The Object Script:] Commented out the lines that remove and add the pencil and added the WeaponOut variable. That variable will prevent the need for the pencil trick.[step 3: Create AI Packages > BobCompFollowDefault:] was "Enable Fallow Behavior" where it should have been "Enable Fallout Behavior". Other Notes: There are few issues that this tutorial does not address. (They are not necessarily problems.)2/2/2013:The tutorial videos mention setting up the NPC in the player faction. The vanilla companions are not done this way, they have their own factions. My companion is set in the player faction. I don't know if this would cause problems or not.When you first meet Victor at the entrance of the Lucky 38, Vanilla companions are set to wait, but Bob will not be set to wait.There appears to be no penalty for entering Penthouse with your companion.The vanilla companions when fired use ResetAI rather than EvaluatePackage in their result scripts. (Is this what causes them to simply disapper? I don't see any moveto funcitons being used. My companion simply walks to the locations set in the AI Packages.)The vanilla companions when fired also have a line for removing a CompanionSuite Perk in their result scripts (example: VeronicaREF.removeperk CompanionSuite)The CompanionSuite Perk is added to vanilla companions when hired.I don't know what would happen if you had the custom companion with you when begining Dead Money.Given my experience with this mod (spoiler warning for mod content), I am assuming that custom companions will have no trouble entering Big MT, Zion or the Divide.Basically nothing is provided by this tutorial to prevent your followers from going into DLC content.As stated, I did not provide the solution for limiting the number of companions you can have.2/6/2013:I noticed some code in Boone's Object Script that handles how he gets healed at the end of combat. This tutorial doesn't cover that.I am currently delving into the settings related to vanilla companions to solve the issues listed above.11/28/2015:Two Years and 9 months later, I am getting back to this post. That's because I decided to get back into FONV after FO4 came out. (That's right. I don't have it yet. :tongue: Feel free to gift it to me. I'll tell you my steamid if you PM me with the promise. :wink: ) Since I am making a companion mod right now. I am following my own tutorial on making a companion. I wanted a legitimate pack brahmin and didn't want to wait until I got to the strip. You'll be able to purchase it in Novac.Custom Companion Issues is an thread I wrote containing much about setting up a companion to follow the specific rules that vanilla companions follow. It discusses solutions that avoid editing vanilla assets. Please feel free to discuss, in general, how different things can be done for custom companions. Edited November 29, 2015 by trilioth Link to comment Share on other sites More sharing options...
trilioth Posted February 11, 2013 Author Share Posted February 11, 2013 (edited) Just a quick update here. When I get time I will edit the original post. Apparently using a reference for SetIngoreFriendlyHits (eg: BobCompREF.SetIngoreFriendlyHits 1) causes a problem. Just use SetIngoreFriendlyHits 1. Edit: It looks like my indents where nixed by the new forum code.Edit Again: New forum code will take some getting used to. Edited February 11, 2013 by trilioth Link to comment Share on other sites More sharing options...
Rooker75 Posted April 25, 2014 Share Posted April 25, 2014 Thank you for this. I was worried it would be complicated and it turns out it's just enormously tedious. Now if only Skyrim had the companion wheel... I noticed a couple of mistakes. FollowersFiredYesSuite: Response:Ok.Conditions:GetScriptVariable; Reference: 'VNPCFollowers', bSuiteAvailable == 1 ANDThat should be "GetQuestVariable" BobCompREF.SetIngoreFriendlyHits 1Misspelling "ignore". I do the same thing with that word. FollowersTacticsDistance:SpoilerResponse:Ok.Conditions:GetIsID; NPC: 'BobCompREF' == 1 ANDChoices:FollowerTacticsDefaultFollowerTacticsLongFollowerTacticsENDFollowerTacticsGOODBYE Should be Choices:FollowerTacticsDistanceDefaultFollowerTacticsDistanceLongFollowerTacticsDistanceENDFollowerTacticsDistanceGOODBYE Link to comment Share on other sites More sharing options...
Galcyon Posted July 17, 2014 Share Posted July 17, 2014 I followed this guide to the letter, and well... there's a tiny, itty-bitty problem. I speak to the possible companion, get no choices (or even a voiceless text option,) and then the dialogue exits without my input. And thus, can't hire the companion. What's the fix? Link to comment Share on other sites More sharing options...
trilioth Posted July 17, 2014 Author Share Posted July 17, 2014 I followed this guide to the letter, and well... there's a tiny, itty-bitty problem. I speak to the possible companion, get no choices (or even a voiceless text option,) and then the dialogue exits without my input. And thus, can't hire the companion. What's the fix?I don't know. I didn't have that problem. It's been a long time since I did this and I currently don't have access to FONV to review the procedure. It seems like there is an issue with the companion's dialogue. I recommend watching the videos, if you haven't and reviewing each step of my tutorial to see if you have missing something. Link to comment Share on other sites More sharing options...
jet4571 Posted July 17, 2014 Share Posted July 17, 2014 Galcyon, on 17 Jul 2014 - 01:10 AM, said:I followed this guide to the letter, and well... there's a tiny, itty-bitty problem. I speak to the possible companion, get no choices (or even a voiceless text option,) and then the dialogue exits without my input. And thus, can't hire the companion. What's the fix? You have to setup the GREETING dialogue. Add the getisid conditions and to right of that add all the top level dialogue to the choices box. There is no greeting in the vanilla companions quest because it is the individual dialogue quests. Example open VDialogueCass quest and find the GREETING topic. select "{In Party, Random Opener from Wheel}Oh, you look like you got something else to say besides ordering me around." and you will see some of them there as an example. Link to comment Share on other sites More sharing options...
Galcyon Posted July 18, 2014 Share Posted July 18, 2014 Galcyon, on 17 Jul 2014 - 01:10 AM, said:I followed this guide to the letter, and well... there's a tiny, itty-bitty problem. I speak to the possible companion, get no choices (or even a voiceless text option,) and then the dialogue exits without my input. And thus, can't hire the companion. What's the fix? You have to setup the GREETING dialogue. Add the getisid conditions and to right of that add all the top level dialogue to the choices box. There is no greeting in the vanilla companions quest because it is the individual dialogue quests. Example open VDialogueCass quest and find the GREETING topic. select "{In Party, Random Opener from Wheel}Oh, you look like you got something else to say besides ordering me around." and you will see some of them there as an example. Did you read what I wrote? I put down that I followed the guide to the letter. That means I already set up the dialogue, according to what was in the OP. I've compared the entire dialogue tree I made to the OP's Tara companion tree. And double-checked the dialogue portion of the guide. Hell, even tried setting mine up as a .esm to fix this. Everything looks like it works as it should, the Tara companion fires off like it should, mine doesn't. And I don't know why. I'm about ready to hand the mod off to someone to see if they can't make heads or tails of this... Link to comment Share on other sites More sharing options...
Carosellrarity Posted September 16, 2014 Share Posted September 16, 2014 (edited) <EDITED> Sorry he had accidently unticked the Allow PC Dialog box when creating his Companion. He rectified the Problem. By the way this was an amazing Tutorial. Made it so easy to actually do this even I could follow it. Edited September 16, 2014 by Carosellrarity Link to comment Share on other sites More sharing options...
Recommended Posts