gooboo Posted August 20, 2015 Posted August 20, 2015 Hi everyone. Basically what I'm trying to do here is change one of the options in the dialogue in the Sexlab Submit mod. Instead of the killing option I'd like to make it so that they'll join your party instead. Rather than adding an entirely new dialogue tree, which looks like its way more work that what I'm willing to do here, I changed one of the options I've never really used. As you can see from the screenshot, the dialogue works fine. What I want to know is how do you get an NPC to become a follower by selecting that dialogue choice. Is it something that has to be scripted? Can it be done through the dialogue options in the ck? I'm only looking to make them generic followers, like anyone else, I don't really need anything fancy, but the whole dialogue/scripting business in Skyrim is way more complicated than anything I did in Morrowind or Oblivion. When is comes to modding I'm a modeller- I don't know shit about scripting. I tried looking at the dialogue trees of other npcs who become followers (like Mjoll or Illia) but I still just don't get how to do it. Can someone help me out here? Thanks!
WraithSlayer Posted August 20, 2015 Posted August 20, 2015 If you just want a very basic and temporary follower, giving the NPC a follow-player AI package and adding them to the player faction should be sufficient. However, if you want a more complete follower with the usual dialogue options (trade items, dismiss, etc), then that's more complicated, and I'm not sure if it will work well (or at all) with non-unique characters.
gooboo Posted August 20, 2015 Author Posted August 20, 2015 I want to be able to do this with any hostile npc I come across (like bandits, wizards, etc.) I already do this with the console command, I just type in bat follower and it turns nearly any npc into a follower, complete with all of the regular follower options, even for the generic npcs. I've always wanted to be able to do this via dialogue really just for roleplaying reasons; it takes some of the immersion away when I have to open the console command each time. It might not seem like a big deal, but it's something I've wanted for awhile.
WraithSlayer Posted August 20, 2015 Posted August 20, 2015 Well, show me the contents of your follower bat file, and I should be able to translate it into script code you can attach to the dialogue.
gooboo Posted August 20, 2015 Author Posted August 20, 2015 Sure- StopCombat RemoveFromAllFactions SetRelationShipRank Player 4 AddToFaction 0005A1A4 4 AddToFaction 0005C84D 4 SetPlayerTeamMate 1
WraithSlayer Posted August 20, 2015 Posted August 20, 2015 Alright, shouldn't be much of a problem. Open the dialogue topic where you want the follower code in, and check if there's already a script present in the Topic Info window. (bottom-right corner) If there isn't, type anything, such as ;temp into the End fragment section of the topic, then click somewhere else in the window. This will create a new script for you. Once the script is created, you can delete the ;temp bit you added. Select the script in the list, and go to Properties. In here, you'll add two faction properties. Go to Add Property, and select Type as Faction, and name as DunPlayerAllyFaction. Now repeat the process for another faction, PotentialFollowerFaction. The faction properties you defined in step 3 should automatically link to their respective factions, but if not, select them and use Edit Value to select the correct faction from the list. Press OK to go back to the Topic Info window, then add the following code into the End fragment: akSpeaker.StopCombat() akSpeaker.RemoveFromAllFactions() akSpeaker.SetRelationshipRank(Game.GetPlayer(), 4) akSpeaker.AddToFaction(DunPlayerAllyFaction) akSpeaker.AddToFaction(PotentialFollowerFaction) akSpeaker.SetFactionRank(DunPlayerAllyFaction, 4) akSpeaker.SetFactionRank(PotentialFollowerFaction, 4) akSpeaker.SetPlayerTeammate() That should do the trick. Press OK to save the changes (the script will take a couple seconds to compile) and you're done.
gooboo Posted August 20, 2015 Author Posted August 20, 2015 I seem to have run into some problems. When I try to add properties to the script, I get an error message, and I can't add any properties to the script in the next window. What am I doing wrong?
WraithSlayer Posted August 20, 2015 Posted August 20, 2015 I seem to have run into some problems. When I try to add properties to the script, I get an error message, and I can't add any properties to the script in the next window. What am I doing wrong? script1.jpg script2.jpg I assume the script 'submitfriendly' already existed? You might be missing the PEX file. Type ;temp into the the End fragment and press OK in the Topic Info window. This will recompile the script, and hopefully allow you add the properties without errors.
gooboo Posted August 20, 2015 Author Posted August 20, 2015 Okay fixed that problem, but now I've run into something else. I try to add the DunPlayerAllyFaction property and I get this error message-
WraithSlayer Posted August 20, 2015 Posted August 20, 2015 Okay fixed that problem, but now I've run into something else. I try to add the DunPlayerAllyFaction property and I get this error message- script3.jpg script4.jpg Right-click the script in the Topic Info window, select open, copy the source code here.
gooboo Posted August 20, 2015 Author Posted August 20, 2015 Is this it? ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment ;NEXT FRAGMENT INDEX 1 Scriptname TIF__0307322A Extends TopicInfo Hidden ;BEGIN FRAGMENT Fragment_0 Function Fragment_0(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor ;BEGIN CODE ;temp ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment Faction Property DunPlayerAllyFaction Auto Faction Property DunPlayerAllyFaction Auto Hidden Faction Property DunPlayerAllyFaction Auto
WraithSlayer Posted August 20, 2015 Posted August 20, 2015 Ah, this is a problem caused by a recent update of the creation kit. See if there's a scripts.rar file in your Skyrim\Data, you'll need to extract the contents of this file into Skyrim\Data\scripts\source (don't overwrite any files if it asks) After that, run the creation kit again and scripts should now hopefully compile.
gooboo Posted August 20, 2015 Author Posted August 20, 2015 Still getting an error. I unpacked the scripts.rar folder, restarted the ck, and I get this message- Here is the code I got- ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment ;NEXT FRAGMENT INDEX 1 Scriptname TIF__0307322A Extends TopicInfo Hidden ;BEGIN FRAGMENT Fragment_0 Function Fragment_0(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor ;BEGIN CODE ;temp ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment Faction Property DunPlayerAllyFaction Auto Faction Property DunPlayerAllyFaction Auto Hidden Faction Property DunPlayerAllyFaction Auto
WraithSlayer Posted August 20, 2015 Posted August 20, 2015 The first error you're getting (Unable to find flags file: TESV_Papyrus_Flags.flg) is what's causing the main problem. The scripts.rar should have a TESV_Papyrus_Flags.flg file that's now been placed in \Scripts\Source when you extracted it, is this not the case? Also, this thread might help with solutions for that error.
gooboo Posted August 20, 2015 Author Posted August 20, 2015 Oops I extracted the .rar file to the wrong place. Let me try this again.
WraithSlayer Posted August 20, 2015 Posted August 20, 2015 Oops I extracted the .rar file to the wrong place. Let me try this again. Okay, so assuming that takes care of it, the remaining errors in your compile log are all due to having multiple definitions of DunPlayerAllyFaction in the source script, due to the failed attempts to add the property. To fix those, right-click the script in the Topic Info window, Edit Source, and delete the duplicate definitions, there should only be one DunPlayerAllyFaction there. (you had 3 last time you've shown me the script source) Edit: Or rather, delete the script and start with a new one following my initial instructions, it's probably less confusing.
gooboo Posted August 20, 2015 Author Posted August 20, 2015 Deleting the old script seems to have fixed the problem, now I just need to test it in game.
gooboo Posted August 20, 2015 Author Posted August 20, 2015 It works great WraithSlayer. Thank you for all of your help- I would never have figured this out on my own.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.