GetFormFromFile - load order dependent?

Post » Sun Jun 24, 2012 2:48 pm

since this query uses a hard form ID, does that mean it has to be load order dependent? sounds useless if thats the case
User avatar
Krystina Proietti
 
Posts: 3388
Joined: Sat Dec 23, 2006 9:02 pm

Post » Sun Jun 24, 2012 2:28 pm

Load order is only really used for the purposes of conflict resolution. Once the game is in runtime, all forms that are going to be present, are present. It shouldn't matter.
User avatar
Yvonne Gruening
 
Posts: 3503
Joined: Mon Apr 23, 2007 7:31 pm

Post » Sun Jun 24, 2012 2:17 pm

so then i can just reference the form ID as it appears in that mod's esp in the CK regardless of load order?
User avatar
Vicky Keeler
 
Posts: 3427
Joined: Wed Aug 23, 2006 3:03 am

Post » Sun Jun 24, 2012 1:21 pm

Yes, because it retrieves the form based on the lower bits of the FormID. The upper bits can change depending on load order.

Obtains the form specified by its form ID number which originated in the specified file. The ID for a form changes based on the load order of the file it loaded from. So a form which shows up as 0101ABCD in the editor may show up as 0401ABCD in game depending on how many other files load before it. This function lets you blindly grab a form based on the lower bytes of its ID and the expected file which created the form.
User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Sun Jun 24, 2012 7:05 pm

awesome. thanks
User avatar
Clea Jamerson
 
Posts: 3376
Joined: Tue Jun 20, 2006 3:23 pm

Post » Sun Jun 24, 2012 11:24 am

While we're on the subject, I'm seeing this in my Papyrus logs:

[06/22/2012 - 11:06:45PM] error: Native static function GetFormFromFile could find no matching static function on linked type Game. Function will not be bound.

Anyone know what the deal with that is? I'm upgraded to the latest version of Skyrim. I'm getting an error like this for most of the new functions at the top of my log when loading a save game saved on... 1.5 I believe.
User avatar
JESSE
 
Posts: 3404
Joined: Mon Jul 16, 2007 4:55 am

Post » Sun Jun 24, 2012 10:17 am

MiscObject GoldMISC = Game.GetFormFromFile(0x1A00000F, "Skyrim.ESM") As MiscObject
...and...
MiscObject GoldMISC = Game.GetFormFromFile(0x0000000F, "Skyrim.ESM") As MiscObject
...will both set GoldMISC to Gold001 "Gold" [MISC:0000000F]

Chesko: Have 1.6's PEX files been overwritten by SKSE's? If so, copypasta the SKSE functions to the bottom of 1.6's Game.PSC and compile, then all the Game functions should be available to work with.
User avatar
OnlyDumazzapplyhere
 
Posts: 3445
Joined: Wed Jan 24, 2007 12:43 am

Post » Sun Jun 24, 2012 11:36 am

MiscObject GoldMISC  = Game.GetFormFromFile(0x1A00000F, "Skyrim.ESM") As MiscObject
...and...
MiscObject GoldMISC  = Game.GetFormFromFile(0x0000000F, "Skyrim.ESM") As MiscObject
...will both set GoldMISC to Gold001 "Gold" [MISC:0000000F]

Chesko: Have 1.6's PEX files been overwritten by SKSE's? If so, copypasta the SKSE functions to the bottom of 1.6's Game.PSC and compile, then all the Game functions should be available to work with.

I'm actually not using SKSE right now (trying to keep my development environment clean), but that's a good suggestion. I'll try recompiling Game just for the heck of it.
User avatar
Quick Draw III
 
Posts: 3372
Joined: Sat Oct 20, 2007 6:27 am

Post » Sun Jun 24, 2012 7:07 am

this is awesome. i can finally rebuild my esm from scratch and use this to "record" the user's progress before they update to the new version and then sync the changes afterward
User avatar
suzan
 
Posts: 3329
Joined: Mon Jul 17, 2006 5:32 pm

Post » Sun Jun 24, 2012 4:56 am

Would just like to report that recompiling Game made my 1.6 function errors in my papyrus log go away. Thanks!
User avatar
Charlotte Henderson
 
Posts: 3337
Joined: Wed Oct 11, 2006 12:37 pm


Return to V - Skyrim