UndergroundPupp Posted February 17, 2020 Share Posted February 17, 2020 Hi, I know nothing about scripting so looking online for how to do this has been dread-full. Anyway, I want the player to select a dialogue option which gives the npc they're talking to 5 gold. All the dialogue is set up but I have no idea how to code... So, how would I go about doing this?Many thanks. Link to comment Share on other sites More sharing options...
foamyesque Posted February 17, 2020 Share Posted February 17, 2020 Okay, so the code itself is pretty simple -- I think there's multiple tutorials on this exact question, but it's four lines or so -- but how familiar are you with navigating the dialogue trees in quests? Link to comment Share on other sites More sharing options...
UndergroundPupp Posted February 18, 2020 Author Share Posted February 18, 2020 Okay, so the code itself is pretty simple -- I think there's multiple tutorials on this exact question, but it's four lines or so -- but how familiar are you with navigating the dialogue trees in quests?I've gotten a bit familiar with it, though the papyrus parts I'm not too familiar with. Link to comment Share on other sites More sharing options...
Ghaunadaur Posted February 18, 2020 Share Posted February 18, 2020 At first, read the notes from this article. It's an important step when adding fragment scripts and properties. It applies to topic info fragments too. Once you've added the script, open the properties window and add a new property. Give it the name Gold001, and for the type choose MiscObject.After that, click the 'Auto-fill' button. The property should now be filled with the actual gold object. Remove all previous code and paste the following line of code to the code box, either 'On Begin' or 'On End', that's up to you. Compile the script again. Game.GetPlayer().RemoveItem(Gold001, 5, false, akSpeaker) If you haven't done already, you should also add a condition to the topic info, so it will only show up if the player has 5 or more gold. Link to comment Share on other sites More sharing options...
NexusComa Posted February 18, 2020 Share Posted February 18, 2020 What you're asking is one of the hardest things to get down modding. Best thing I could suggest is looking at how others did it.as far as the actual code part other than the dialog it would be a simple player remove item and add item to the npc. That dialog stuff is a mess to work with .. good luck. Really wish I had a simple answer for you. Link to comment Share on other sites More sharing options...
UndergroundPupp Posted February 18, 2020 Author Share Posted February 18, 2020 At first, read the notes from this article. It's an important step when adding fragment scripts and properties. It applies to topic info fragments too. Once you've added the script, open the properties window and add a new property. Give it the name Gold001, and for the type choose MiscObject.After that, click the 'Auto-fill' button. The property should now be filled with the actual gold object. Remove all previous code and paste the following line of code to the code box, either 'On Begin' or 'On End', that's up to you. Compile the script again. Game.GetPlayer().RemoveItem(Gold001, 5, false, akSpeaker) If you haven't done already, you should also add a condition to the topic info, so it will only show up if the player has 5 or more gold. Unbenannt-1.jpgThank you so f*#@ing much! I think all I needed to do was make gold a property in the the dialogue views tab and I would've been done with this days ago! Many, many thanks Link to comment Share on other sites More sharing options...
UndergroundPupp Posted February 18, 2020 Author Share Posted February 18, 2020 What you're asking is one of the hardest things to get down modding. Best thing I could suggest is looking at how others did it.as far as the actual code part other than the dialog it would be a simple player remove item and add item to the npc. That dialog stuff is a mess to work with .. good luck. Really wish I had a simple answer for you.Cheers, you'd think it'd be easy to get all the resources to learn from but the creation kit wiki barely ever helps (maybe I'm just a bad reader?). I have no idea how modders do what they do and make these grand mods which are so well polished. Anyways I got that problem with the donating sorted out now so yay! Link to comment Share on other sites More sharing options...
UndergroundPupp Posted February 18, 2020 Author Share Posted February 18, 2020 What you're asking is one of the hardest things to get down modding. Best thing I could suggest is looking at how others did it.as far as the actual code part other than the dialog it would be a simple player remove item and add item to the npc. That dialog stuff is a mess to work with .. good luck. Really wish I had a simple answer for you.Cheers, you'd think it'd be easy to get all the resources to learn from but the creation kit wiki barely ever helps (maybe I'm just a bad reader?). I have no idea how modders do what they do and make these grand mods which are so well polished. Anyways I got that problem with the donating sorted out now so yay! Link to comment Share on other sites More sharing options...
NexusComa Posted February 19, 2020 Share Posted February 19, 2020 I can do most anything with the kit and make anything i want. But I can't seem to get that dialog stuff to work right ... gave up on it years ago. Link to comment Share on other sites More sharing options...
foamyesque Posted February 19, 2020 Share Posted February 19, 2020 What you're asking is one of the hardest things to get down modding. Best thing I could suggest is looking at how others did it.as far as the actual code part other than the dialog it would be a simple player remove item and add item to the npc. That dialog stuff is a mess to work with .. good luck. Really wish I had a simple answer for you.Cheers, you'd think it'd be easy to get all the resources to learn from but the creation kit wiki barely ever helps (maybe I'm just a bad reader?). I have no idea how modders do what they do and make these grand mods which are so well polished. Anyways I got that problem with the donating sorted out now so yay! The CK resource is one of those things that's a lot easier to understand once you stop needing to understand it. The tutorials are okay, but the reference pages are very much written as reminders, not to teach. I can do most anything with the kit and make anything i want. But I can't seem to get that dialog stuff to work right ... gave up on it years ago. The dialogue UI is a nightmare and a half and the claim on the Wiki that you can write nearly as quickly in it as you can type dialogue in a textbox is a flat lie, and that's before you get into the horrorshow of dealing with voiced lines. The actual logical structure of dialogue isn't too bad though, and adding fragments is more or less the same as it is on quest stages or whatnot -- frequently it is used to manipulate quest stages, even. Link to comment Share on other sites More sharing options...
Recommended Posts