JustynThyme Posted January 4, 2017 Share Posted January 4, 2017 I created a god-mod for successive playthroughs, and, as I like to do, I added a narrative. It works fine if you start a new game, because I changed an early stage of MQ102 (Out of Time) to alter the SPECIALs (by adding a list of Game.GetPlayer().SetValue( Game.GetSPECIALAV(), 10 ) lines to the Papyrus Fragment field on the appropriate stage), and then just added the perks I wanted the player to have to the Player Actor entry's spell list. But then I wanted to expand the audience, to those who just want to give themselves a boost, but who are already past that stage of MQ102. The added perks work, but not the SPECIALs, obviously. So, I created a syringe you can pick up, and using it adds a perk, that calls a quest. The first test was having the quest change the SPECIALs, like I did with MQ102. It worked. Then I went looking online for the proper command to add perks. I even found specific examples of people adding perks through the Papyrus Fragment field of a quest. In every instance, those seeking help were told the command Game.GetPlayer().AddPerk(PerkEditorID) is supposed to work. When I tried my perk's EID and Awareness', neither would compile.I then went digging into the Creation Kit to find quests that grant perks. The first I found was the quest that gives the Friend of the Cats perk (EID DN054AtomCatsPerk). The relevant line in the Papyrus Fragment field was Game.getplayer().addperk(pDN054AtomCatsPerk). There was a "p" in front of the EID of the perk. The second quest I found was DialogueCovenant, which gives the Wired Reflexes perk (MS17WiredReflexesPerk). It gives the MS17WiredReflexesPerk, also by adding a "p" at the beginning. So, I tried that, using both my perk and Awareness. Neither would compile. I even tried creating another new quest, and then copy/pasting the lines to give the player the Friend of the Cats and Wired Reflexes quest reward perks. That wouldn't compile, either! At this point, I can't understand how those lines would compile for the devs the way they were written. I am at a loss. I just can't see what I'm doing wrong. Any assistance would be appreciated. Thanks!Compiles for me: Game.GetPlayer().SetValue( Game.GetAgilityAV(), 10 ) Game.GetPlayer().SetValue( Game.GetCharismaAV(), 10 ) Game.GetPlayer().SetValue( Game.GetIntelligenceAV(), 10 ) Game.GetPlayer().SetValue( Game.GetEnduranceAV(), 10 ) Game.GetPlayer().SetValue( Game.GetLuckAV(), 10 ) Game.GetPlayer().SetValue( Game.GetPerceptionAV(), 10 ) Game.GetPlayer().SetValue( Game.GetStrengthAV(), 10 ) Compiles for devs: Game.getplayer().addperk(pDN054AtomCatsPerk) Game.GetPlayer().AddPerk(pMS17WiredReflexesPerk) Will not compile for me: Game.getplayer().addperk(Awareness) Game.GetPlayer().AddPerk(pAwareness) Game.getplayer().addperk(MyPerk) Game.GetPlayer().AddPerk(pMyPerk) Game.getplayer().addperk(DN054AtomCatsPerk) Game.GetPlayer().AddPerk(MS17WiredReflexesPerk) Game.getplayer().addperk(pDN054AtomCatsPerk) Game.GetPlayer().AddPerk(pMS17WiredReflexesPerk) Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 4, 2017 Share Posted January 4, 2017 Take this with a grain of salt as this is coming from Skyrim and I don't have Fallout 4.For each perk that you want to add to the player, you need to have a property on the script with said perk assigned to the variable name that you are using to represent that perk in the add perk command. Example:If you want to use: Game.GetPlayer().AddPerk(MyPerk)You need a property declaration to go along with it: Perk Property MyPerk AutoThat said, if you are using this in a fragment, you need to add the property to the script before you can add the code. If F4 CK has the same restrictions as Skyrim CK, you need to create the fragment script first before you can even consider adding the property. Skyrim workflow:put a semi-colon (;) in the fragment boxcompile the fragmentadd your properties (there should be a properties button somewhere that will bring up a new window where you can add your properties and assign correct data to them)remove the semi-colon if desiredadd your codecompile the fragment Link to comment Share on other sites More sharing options...
JustynThyme Posted January 5, 2017 Author Share Posted January 5, 2017 Take this with a grain of salt as this is coming from Skyrim and I don't have Fallout 4.For each perk that you want to add to the player, you need to have a property on the script with said perk assigned to the variable name that you are using to represent that perk in the add perk command. Example:If you want to use: Game.GetPlayer().AddPerk(MyPerk)You need a property declaration to go along with it: Perk Property MyPerk AutoThat said, if you are using this in a fragment, you need to add the property to the script before you can add the code. If F4 CK has the same restrictions as Skyrim CK, you need to create the fragment script first before you can even consider adding the property. Skyrim workflow:put a semi-colon ( :wink: in the fragment boxcompile the fragmentadd your properties (there should be a properties button somewhere that will bring up a new window where you can add your properties and assign correct data to them)remove the semi-colon if desiredadd your codecompile the fragmentStrange that some of the commands require properties, but others do not. I know nothing about the fragment properties, so I'll have to see if I can find something to teach me. Thanks for the help! I hope this works. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 5, 2017 Share Posted January 5, 2017 It does not require a property. It requires that the variable name used is defined. Game.GetPlayer().SetValue( Game.GetAgilityAV(), 10 ) The above works as-is because you are passing into the two parameters of SetValue the end result of running the GetAgilityAV function and a value of 10. Game.getplayer().addperk(MyPerk) This one does not work as is because you are passing into the parameter on AddPerk a variable name that initially has no meaning. To make it compile, all you need is Perk MyPerkBut that merely tells the script that the variable MyPerk is supposed to be a perk, but it doesn't tell the script what perk to actually work with. Perk Property MyPerk Auto By changing it to a property, you not only tell the script that the MyPerk variable is supposed to be a perk, but you also tell the CK editor to allow you to assign the actual perk you wish to use to this variable. However, because fragments are handled a little bit differently than standard scripts, you cannot simply write the property statement in. You have to let the CK handle that by using the editor interface. Since I'm not familiar with the F4 CK, I cannot help you with that part, unfortunately. Link to comment Share on other sites More sharing options...
Recommended Posts