doswillrule Posted January 24, 2021 Share Posted January 24, 2021 (edited) Hi all. I've just come back to modding after a long layoff to update my mod Publick Occurrences Expanded. I'm not doing anything drastic at the moment, just adding more of the same things. The basic idea of the mod is this: you complete a quest, you go to Nat in Diamond City, she gives you a note about the quest. This is a function that's in the game already, when you receive 'View from the Vault' etc. When I originally made the mod, I managed to do this by adding greetings in DialogueDiamondCity/Misc, adding the right conditions, and then adding the following Papyrus fragment to each one: Game.GetPlayer().AddItem(Name of Book) This seemed to work fine for the existing entries. However, when I now try to add a new book and create a greeting for it, the fragment won't compile, giving me a 'variable X is undefined' error. I read somewhere that you could use an Alias to generate the book in an NPCs inventory and then give it to the player. So I tried adding a Quest Alias to DialogueDiamondCity instead, creating a reference to the book in NatAlias, and running the following fragment in the greeting: game.GetPlayer().AddItem(Alias_Name of Alias.GetReference())Suffice it to say that didn't work either. I've forgotten anything I knew about CK or Papyrus, so this is probably extremely simple, but I can't figure out how I got this to work in the original mod. Any pointers would be much appreciated. Edited January 24, 2021 by doswillrule Link to comment Share on other sites More sharing options...
NoCashNoExp Posted January 24, 2021 Share Posted January 24, 2021 (edited) Hi all. I've just come back to modding after a long layoff to update my mod Publick Occurrences Expanded. I'm not doing anything drastic at the moment, just adding more of the same things. The basic idea of the mod is this: you complete a quest, you go to Nat in Diamond City, she gives you an item (a note about the quest). When I originally made the mod, I seemingly managed to do this by adding greetings in DialogueDiamondCity/Misc, adding the right conditions, and then adding the following Papyrus fragment to each one: Game.GetPlayer().AddItem(Name of Book) If this variable X that is undefined is the name of your new book, you need to add it as a property to your script in order for the script to know about it. Create a new property of type book with the same name as the book's editor name that should fill it automatically. If it doesn't do it, make sure to fill it manually. You can now do AddItem(BookProperty) in the script fragment. Edited January 24, 2021 by NoCashNoExp Link to comment Share on other sites More sharing options...
doswillrule Posted January 24, 2021 Author Share Posted January 24, 2021 (edited) Hi all. I've just come back to modding after a long layoff to update my mod Publick Occurrences Expanded. I'm not doing anything drastic at the moment, just adding more of the same things. The basic idea of the mod is this: you complete a quest, you go to Nat in Diamond City, she gives you an item (a note about the quest). When I originally made the mod, I seemingly managed to do this by adding greetings in DialogueDiamondCity/Misc, adding the right conditions, and then adding the following Papyrus fragment to each one: Game.GetPlayer().AddItem(Name of Book) If this variable X that is undefined is the name of your new book, you need to add it as a property to your script in order for the script to know about it. Create a new property of type book with the same name as the book's editor name that should fill it automatically. If it doesn't do it, make sure to fill it manually. You can now do AddItem(BookProperty) in the script fragment. Would this be the script that's attached to DialogueDiamondCity (DialogueDiamondCityScript)? Or should there be a custom script added to that quest as well? There isn't a script assigned to either the greetings or the books. I've tried adding the property to that script, as below. But I'm still getting the same result when I go to compile the fragment (screenshots below). Edited January 24, 2021 by doswillrule Link to comment Share on other sites More sharing options...
NoCashNoExp Posted January 25, 2021 Share Posted January 25, 2021 It should be added here: Link to comment Share on other sites More sharing options...
doswillrule Posted January 25, 2021 Author Share Posted January 25, 2021 It should be added here: Awesome, thank you! I had clicked on that Properties button, but it wasn't working for the new greetings I'd made, probably because the fragment didn't exist! I duplicated the working ones, added it to their properties and it's working perfectly now. Thanks again for the help. Link to comment Share on other sites More sharing options...
Recommended Posts