XmodXmasterX Posted January 10, 2020 Share Posted January 10, 2020 Do you know the dialogue option where you can sell firewood to certain NPCs? Let's say I made a custom NPC named 'Skooma Buyer' and I wanted to have an option like that for him to buy skooma, how would I do it? Link to comment Share on other sites More sharing options...
Urakhah Posted January 12, 2020 Share Posted January 12, 2020 (edited) Hi XmodXmasterX, I made myself some time to figure it out for you. Here is the result: Because dialogues are created in quest objects, I started my search under the quest-section in the object window. I found a quest-object called "FavorJobsGatherWheat", which contained the dialogue options I waslooking for ( selling crops to an NPC ). I investigated that quest object and was able to reproduce the same thing with Skooma. You need: - a faction - an actor - a quest - a "SEQ-file" for Start Game Enabled Quests The faction In the object window navigate to "Character - Faction" and filter the items by "FavorJobsGatherWheatFaction". Duplicate this object and rename it. Faction done, nothing has to changed furthermore on this object. The actor In the object window navigate to "Actors - Actor". I simply right-clicked and created a complete new object. Type in an ID and a name. In the "Factions"-tab right-click, select "New" and select your created faction-object. In the "Keywords"-tab right-click, select "New" and type in a keyword, i.e. "AddictSkooma". In the "Inventory"-tab you can give this actor an outfit / clothes, but that's optional I guess. Place the actor somewhere. The quest In the object window navigate to "Character - Quest", right click and create a new object. Give it an ID and (optional) a name. Set priority to 45 and check "Start Game Enabled". In the white box under "Quest Dialogue Conditions" right-click and select "New". Pick "GetInFaction" from the first dropdown menu "Condition Function". Click the button beside that dropdown menu, which is labelled "INVALID" and select your faction-object. Click OK. Now hop over to the "Scripts" tab of the quest object and click the "Add"-button. In the window showing up, double-click "[new script]". Type in the Name "SellSkoomaScript" and click OK. Double-click the new item and select "Add Property". Pick the type "Potion" and call it "Skooma" - with this name, the property value will get auto-filled. Click OK. Add another property of type "MiscObject" and call it "Gold001" - it will get auto-filled again. Click Ok. Add two more properties from type Int called "PlayerSkoomaCount" and "PlayerGoldReward". Click OK on the properties window, right-click on the script-item and select "Edit source". Below the already existing code, paste in this block: Function SellSkooma(Actor Addict) ;Count the amount of skooma the player has PlayerSkoomaCount = Game.GetPlayer().GetItemCount(Skooma) ;Make the Addict the player's friend If Addict.GetRelationshipRank(Game.GetPlayer()) == 0 Addict.SetRelationshipRank(Game.GetPlayer(), 1) EndIf ;Calculate the amount of gold to give the player PlayerGoldReward = (PlayerSkoomaCount * (Skooma.GetGoldValue())) Game.GetPlayer().RemoveItem(Skooma, PlayerSkoomaCount) Game.GetPlayer().AddItem(Gold001, PlayerGoldReward) EndFunction Press Ctrl + S to save and compile the script, then close the window and navigate to the "Dialogue Views"-tab. In the left table, right-click, select "New" and just append "View" to the suggested ID. Click OK and select the new item. In the white area on the right side, right-click and select "Create branch". Append "Branch" to the suggested ID, click OK and click OK in the second PopUp (for the topic) as well. You'll see a yellow box, which has another box inside it. Double-click the yellow area inside the inner box. For "Topic Text" type in "I have Skooma to sell" and double-click into the white area below, which brings up the Response window. Type in a response text - that's what the NPC will answer to the player. Click OK. In the next window you can see your Topic Text and further down the response. Look for the white box labelled "Conditions", right-click and select "New". From the first dropdown menu, pick "HasKeyword" and from the "INVALID" button, select the Keyword, you attached to your actor. Click OK. Right-click again into the white box and select "New". Now pick "GetItemCount" from the dropdown menu and select "Skooma" from the button "INVALID". From the dropdown menu "Comparison" select the operator ">=". From the drowpown menu below, labelled "Run on", pick "Target". Click OK. At the bottom of the window is a section labelled "Scripts" and in there a white box labelled "End", where the tab "Papyrus Fragments" should be selected. In that box write / paste this line of code: (GetOwningQuest() as SellSkoomaScript).SellSkooma(akSpeaker) Click the "Compile" button below the box - you'll see an item appearing in the box to the right. Quest object done! Congrats! Click OK everywhere, save your plugin and close the CreationKit. The SEQ-file Open the command prompt with "Win + R" or just typing "cmd" in the startmenuNavigate to the Skyrim SE Game Folder, where the "creationkit.exe" is locatedType in this line of code - replace "[PLUGINNAME]" with the name of your .esp-file: creationkit.exe -GenerateSEQ:[PLUGINNAME].esp This will open the CreationKit - it might not really open but crash, but that shouldn't matter as long as you have a file called: "[PLUGINNAME].SEQ" in your Skyrim SE Game Folder.Move this file into "[skyrim SE Game Folder]/Data/SEQ" -- create the "SEQ"-folder, if it's not there already :happy:Congrats! You made it :laugh: It should work now, you can test it ingame. Ingame Testing Navigate to your placed actor and open the console. Type in this line of code: "player.addItem 00057a7a 5" You'll get 5 x Skooma. Now talk to your Skooma Addict and you should be able to sell it to him. If you have further questions, just ask them :wink: Edited January 12, 2020 by Urakhah Link to comment Share on other sites More sharing options...
XmodXmasterX Posted January 12, 2020 Author Share Posted January 12, 2020 Hi XmodXmasterX, I made myself some time to figure it out for you. Here is the result: Because dialogues are created in quest objects, I started my search under the quest-section in the object window. I found a quest-object called "FavorJobsGatherWheat", which contained the dialogue options I waslooking for ( selling crops to an NPC ). I investigated that quest object and was able to reproduce the same thing with Skooma. You need: - a faction - an actor - a quest - a "SEQ-file" for Start Game Enabled Quests The faction In the object window navigate to "Character - Faction" and filter the items by "FavorJobsGatherWheatFaction". Duplicate this object and rename it. Faction done, nothing has to changed furthermore on this object. The actor In the object window navigate to "Actors - Actor". I simply right-clicked and created a complete new object. Type in an ID and a name. In the "Factions"-tab right-click, select "New" and select your created faction-object. In the "Keywords"-tab right-click, select "New" and type in a keyword, i.e. "AddictSkooma". In the "Inventory"-tab you can give this actor an outfit / clothes, but that's optional I guess. Place the actor somewhere. The quest In the object window navigate to "Character - Quest", right click and create a new object. Give it an ID and (optional) a name. Set priority to 45 and check "Start Game Enabled". In the white box under "Quest Dialogue Conditions" right-click and select "New". Pick "GetInFaction" from the first dropdown menu "Condition Function". Click the button beside that dropdown menu, which is labelled "INVALID" and select your faction-object. Click OK. Now hop over to the "Scripts" tab of the quest object and click the "Add"-button. In the window showing up, double-click "[new script]". Type in the Name "SellSkoomaScript" and click OK. Double-click the new item and select "Add Property". Pick the type "Potion" and call it "Skooma" - with this name, the property value will get auto-filled. Click OK. Add another property of type "MiscObject" and call it "Gold001" - it will get auto-filled again. Click Ok. Add two more properties from type Int called "PlayerSkoomaCount" and "PlayerGoldReward". Click OK on the properties window, right-click on the script-item and select "Edit source". Below the already existing code, paste in this block: Function SellSkooma(Actor Addict) ;Count the amount of skooma the player has PlayerSkoomaCount = Game.GetPlayer().GetItemCount(Skooma) ;Make the Addict the player's friend If Addict.GetRelationshipRank(Game.GetPlayer()) == 0 Addict.SetRelationshipRank(Game.GetPlayer(), 1) EndIf ;Calculate the amount of gold to give the player PlayerGoldReward = (PlayerSkoomaCount * (Skooma.GetGoldValue())) Game.GetPlayer().RemoveItem(Skooma, PlayerSkoomaCount) Game.GetPlayer().AddItem(Gold001, PlayerGoldReward) EndFunction Press Ctrl + S to save and compile the script, then close the window and navigate to the "Dialogue Views"-tab. In the left table, right-click, select "New" and just append "View" to the suggested ID. Click OK and select the new item. In the white area on the right side, right-click and select "Create branch". Append "Branch" to the suggested ID, click OK and click OK in the second PopUp (for the topic) as well. You'll see a yellow box, which has another box inside it. Double-click the yellow area inside the inner box. For "Topic Text" type in "I have Skooma to sell" and double-click into the white area below, which brings up the Response window. Type in a response text - that's what the NPC will answer to the player. Click OK. In the next window you can see your Topic Text and further down the response. Look for the white box labelled "Conditions", right-click and select "New". From the first dropdown menu, pick "HasKeyword" and from the "INVALID" button, select the Keyword, you attached to your actor. Click OK. Right-click again into the white box and select "New". Now pick "GetItemCount" from the dropdown menu and select "Skooma" from the button "INVALID". From the dropdown menu "Comparison" select the operator ">=". From the drowpown menu below, labelled "Run on", pick "Target". Click OK. At the bottom of the window is a section labelled "Scripts" and in there a white box labelled "End", where the tab "Papyrus Fragments" should be selected. In that box write / paste this line of code: (GetOwningQuest() as SellSkoomaScript).SellSkooma(akSpeaker) Click the "Compile" button below the box - you'll see an item appearing in the box to the right. Quest object done! Congrats! Click OK everywhere, save your plugin and close the CreationKit. The SEQ-file Open the command prompt with "Win + R" or just typing "cmd" in the startmenuNavigate to the Skyrim SE Game Folder, where the "creationkit.exe" is locatedType in this line of code - replace "[PLUGINNAME]" with the name of your .esp-file: creationkit.exe -GenerateSEQ:[PLUGINNAME].esp This will open the CreationKit - it might not really open but crash, but that shouldn't matter as long as you have a file called: "[PLUGINNAME].SEQ" in your Skyrim SE Game Folder.Move this file into "[skyrim SE Game Folder]/Data/SEQ" -- create the "SEQ"-folder, if it's not there already :happy:Congrats! You made it :laugh: It should work now, you can test it ingame. Ingame Testing Navigate to your placed actor and open the console. Type in this line of code: "player.addItem 00057a7a 5" You'll get 5 x Skooma. Now talk to your Skooma Addict and you should be able to sell it to him. If you have further questions, just ask them :wink: Wow, thank you so much! I'm very new to this and you're a great help. I will give you credit on my mod page. Link to comment Share on other sites More sharing options...
XmodXmasterX Posted January 12, 2020 Author Share Posted January 12, 2020 Now hop over to the "Scripts" tab of the quest object and click the "Add"-button. In the window showing up, double-click "[new script]". Type in the Name "SellSkoomaScript" and click OK. Double-click the new item and select "Add Property".When I click OK, this pops up: Starting 1 compile threads for 1 files... Compiling "SellSkoomaScript"... <unknown>(0,0): Unable to find flags file: TESV_Papyrus_Flags.flg No output generated for SellSkoomaScript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on SellSkoomaScript Link to comment Share on other sites More sharing options...
Urakhah Posted January 12, 2020 Share Posted January 12, 2020 This didn't happen for me. But fortunately the error message is pretty straightforward. Obviously you're missing the file "TESV_Papyrus_Flags.flg". It should be in "[skyrim Game Folder]\Data\Source\Scripts".I found this thread, where someone had the same problem and in the fourth post Tydeth links to this Modders Resource File on NexusMods. I'd say you download this file, unpack it and move the "TESV_Papyrus_Flags.flg" file to the path mentioned above. You can find the file in the "Papyrus Compilers" folder. I hope this helps ;) Link to comment Share on other sites More sharing options...
XmodXmasterX Posted January 13, 2020 Author Share Posted January 13, 2020 This didn't happen for me. But fortunately the error message is pretty straightforward. Obviously you're missing the file "TESV_Papyrus_Flags.flg". It should be in "[skyrim Game Folder]\Data\Source\Scripts". I found this thread, where someone had the same problem and in the fourth post Tydeth links to this Modders Resource File on NexusMods. I'd say you download this file, unpack it and move the "TESV_Papyrus_Flags.flg" file to the path mentioned above. You can find the file in the "Papyrus Compilers" folder. I hope this helps :wink:Oh thanks, I feel stupid as I should have read it more carefully and googled it. Link to comment Share on other sites More sharing options...
Urakhah Posted January 13, 2020 Share Posted January 13, 2020 Ah, nevermind, it's okay.It didn't take nowhere near as long as to figure it out in the first place :D ( was that proper english actually? ) Link to comment Share on other sites More sharing options...
XmodXmasterX Posted January 14, 2020 Author Share Posted January 14, 2020 Ah, nevermind, it's okay. It didn't take nowhere near as long as to figure it out in the first place :D ( was that proper english actually? )I think it should just be "It didn't take very long to figure it out anyway." Where are you from? In your other comments, your English was very good. Link to comment Share on other sites More sharing options...
Urakhah Posted January 14, 2020 Share Posted January 14, 2020 Haha okay, thx ;)I'm from germany. Yeah, most of the time my english is pretty awesome, thank you :D There are only a few things I don't know how to say sometimes.Back to topic:Did you manage to solve your problem? Link to comment Share on other sites More sharing options...
Recommended Posts