Deleted3507349User Posted March 3, 2016 Share Posted March 3, 2016 I added a perk property to a script and compiled it, but of course the property also needs to be added to the script entries in FO4Edit. Either it's not possible or I'm just not seeing how to do it..anyone know which? Also, it would appear that the Game.GetPlayer().AddPerk(PerkRef) is no longer valid. It now requires an additional argument to compile - Game.GetPlayer().AddPerk(PerkRef, 1) compiles...although I have zero clues as to what the second argument does. Strap in for some changes when the FO4 G.E.C.K. comes out, I guess :) Link to comment Share on other sites More sharing options...
Reneer Posted March 3, 2016 Share Posted March 3, 2016 (edited) It's possible, but annoying. The easiest method right now, I've found, is to do this:Perk Property YourPerk Auto Event OnLoad() YourPerk = Game.GetFormFromFile(0xFormIDHere, "Fallout4.esm") As Perk EndEventAlternatively, you have to find an existing script that contains the number of properties you need for your script and, using FO4Edit, copy the VMAD record to your script in your ESP file, then manually modify the property to point to the FormID of what you need. There is a tool that makes this easier, and it is outlined here. As for the AddPerk command, it is located in the Actor.pex file (if you want to decode it with Champollion) and the format is:Function AddPerk(Perk akPerk, bool abNotify) nativeSo the second variable is simply whether the player gets notified about the perk being added. Edited March 3, 2016 by Reneer Link to comment Share on other sites More sharing options...
Deleted3507349User Posted March 3, 2016 Author Share Posted March 3, 2016 Ahhh...thank you, Reneer. I'll do it through script as you describe, definitely seems easier and more elegant. I do have Actor.pex decompiled (I decompiled all the scripts on general principle)...I just didn't think to look there to see what was up. Link to comment Share on other sites More sharing options...
AceSevenFive Posted March 5, 2016 Share Posted March 5, 2016 It's possible, but annoying. The easiest method right now, I've found, is to do this:Perk Property YourPerk Auto Event OnLoad() YourPerk = Game.GetFormFromFile(0xFormIDHere, "Fallout4.esm") As Perk EndEventAlternatively, you have to find an existing script that contains the number of properties you need for your script and, using FO4Edit, copy the VMAD record to your script in your ESP file, then manually modify the property to point to the FormID of what you need. There is a tool that makes this easier, and it is outlined here. As for the AddPerk command, it is located in the Actor.pex file (if you want to decode it with Champollion) and the format is:Function AddPerk(Perk akPerk, bool abNotify) nativeSo the second variable is simply whether the player gets notified about the perk being added.I seem to recall using formIDs to be dangerous, no? Link to comment Share on other sites More sharing options...
Reneer Posted March 5, 2016 Share Posted March 5, 2016 (edited) I seem to recall using formIDs to be dangerous, no?Bethesda uses GetFormFromFile in their own code. The EditorID is simply a more convenient way to remember the FormID for humans, and the Papyrus compiler simply substitutes the FormID for "EditorID" when the script is compiled. Using FormIDs instead of EditorIDs is not dangerous, it is simply skipping a step and assigning the Script Property directly in the code. The issue you might be thinking of that used to happen (and can still do if you don't use GetFormFromFile) is that the load order of a FormID can change based upon where the mod is loaded (e.g 01 56b9a1 versus 02 56b9a1). By using GetFormFromFile, you specifically tell the game engine which mod you are wanting to look at, and so the game simply substitutes that mod's load order number (01, 02, etc) for the beginning of the FormID. Essentially it chops off the first two numbers and puts in whatever it finds that corresponds to YourMod.esp and thus you don't need to specify the load order numbers. So you could write the FormID you want as only six numbers instead of eight (as Bethesda does in their use of GetFormFromFile), since the engine is smart enough to figure that out. Edited March 5, 2016 by Reneer Link to comment Share on other sites More sharing options...
SephDragoon Posted March 6, 2016 Share Posted March 6, 2016 Also, it would appear that the Game.GetPlayer().AddPerk(PerkRef) is no longer valid. It now requires an additional argument to compile - Game.GetPlayer().AddPerk(PerkRef, 1) compiles...although I have zero clues as to what the second argument does. Strap in for some changes when the FO4 G.E.C.K. comes out, I guess :smile:This is why I am not using the third party compilers for scripts. I figure as the game is updated for the GECK, certain things may break, and scripts may even corrupt the save games on new patches. I was seriously curious how people were making it work with FO2Edit though. I knew where it was, but reading it was impossible. Link to comment Share on other sites More sharing options...
Reneer Posted March 7, 2016 Share Posted March 7, 2016 This is why I am not using the third party compilers for scripts. I figure as the game is updated for the GECK, certain things may break, and scripts may even corrupt the save games on new patches. I was seriously curious how people were making it work with FO2Edit though. I knew where it was, but reading it was impossible.Yes, there are differences between the Skyrim and Fallout 4 function calls. That only makes sense. The game will be updated by Bethesda, but they are not going to change the scripting system to such a degree that it will break any mods made pre-CK, because they would be breaking their own scripts in the process. Unlike what happened when Skyrim came out, the modding community has a great deal more information on how the Fallout 4 ESM / ESP format works and what the records contain because Bethesda hasn't changed the system to such a degree that they did between Oblivion / FO3 and Skyrim. Link to comment Share on other sites More sharing options...
zilav Posted March 8, 2016 Share Posted March 8, 2016 VMAD field in records (the one that holds scripts and properties information) has version information that defines used format. If they are going to make drastic changes in scripting, that would be new version like in Skyrim that has both VMADs version 4 and 5 in master file. So I'm pretty sure that the all currrently made mods will work no matter what they are going to change in future. Link to comment Share on other sites More sharing options...
Recommended Posts