for Game.GetFormFromFile what is the Form ID?

Post » Sun Jul 13, 2014 4:58 pm

So this is not working:

Faction TestFaction = Game.GetFormFromFile(0x021A565B, "Duke Patricks - TEST.esp") as faction
if playerref.IsInFaction(TesTFaction)
debug.messagebox("player is in the faction")
endif
I think I am not using the right form id 021A565B * but that is the number I see in the CK when I look at the faction in the mod.
Am I looking at the wrong thing? Where do I get the correct form id?
* Then I add the 0x as it says in the Wiki.
User avatar
Umpyre Records
 
Posts: 3436
Joined: Tue Nov 13, 2007 4:19 pm

Post » Sun Jul 13, 2014 3:48 pm

The first byte (in your case, 0x02) is not used as this is specific to that mod.

Try Game.GetFormFromFile(0x1A565B, "Duke Patricks - TEST.esp") as faction

User avatar
Multi Multi
 
Posts: 3382
Joined: Mon Sep 18, 2006 4:07 pm

Post » Sun Jul 13, 2014 3:34 pm

Strip the first two digits. You only use the last 6 hex digits for GetFormFormFile. The first two are based on load order and they get chosen at run-time based on the name of the mod you give as the second parameter.Faction TestFaction = Game.GetFormFromFile(0x1A565B, "Duke Patricks - TEST.esp") as faction
User avatar
Dalley hussain
 
Posts: 3480
Joined: Sun Jun 18, 2006 2:45 am

Post » Sun Jul 13, 2014 7:21 pm

um... but I get this 1243240027 from this :

debug.messagebox(TestFaction.GetFormID())

when I run this in my test esp that has the test faction

I just thought to do this after I made the post. What number is 1243240027 this then?

User avatar
Petr Jordy Zugar
 
Posts: 3497
Joined: Tue Jul 03, 2007 10:10 pm

Post » Sun Jul 13, 2014 10:56 pm

= 0x4A1A565B

the "4A" (just like the 02) is dependent on mod load order. This is not needed when using GetFormFromFile

User avatar
Lawrence Armijo
 
Posts: 3446
Joined: Thu Sep 27, 2007 7:12 pm

Post » Sun Jul 13, 2014 4:00 pm

Neither one of these worked:

Faction TestFaction
TestFaction = Game.GetFormFromFile(0x1A565B, "Duke Patricks - TEST.esp") as faction
if playerref.IsInFaction(TestFaction)
debug.messagebox("player is in the faction note 1")
endif
TestFaction = Game.GetFormFromFile(0x240027, "Duke Patricks - TEST.esp") as faction
if playerref.IsInFaction(TestFaction)
debug.messagebox("player is in the faction note 2")
endif
I know the player is in the faction because I get another message that they are form the test mod.
I am seeing this number 1A565B next to the name of the faction in the CK, could I be looking at the wrong thing?
User avatar
Honey Suckle
 
Posts: 3425
Joined: Wed Sep 27, 2006 4:22 pm

Post » Sun Jul 13, 2014 10:51 pm

see here:

http://spookyfx.com/Skyrim/Image1.jpg

IS that the form id?

User avatar
Emily Shackleton
 
Posts: 3535
Joined: Sun Feb 11, 2007 12:36 am

Post » Sun Jul 13, 2014 3:02 pm

nevermind I did this:

Faction TestFaction
TestFaction = Game.GetFormFromFile(0x1A565B, "Duke Patricks - TEST.esp") as faction

debug.messagebox(TestFaction.getname())

and got "TEST"

which is indeed the name of the faction, so that part is working. I must be doing some other thing wrong.

OK, Thanks for the help guys!

User avatar
jaideep singh
 
Posts: 3357
Joined: Sun Jul 08, 2007 8:45 pm

Post » Sun Jul 13, 2014 10:01 am

FormIDs have two parts but are displayed as a single number 8 digit hex number. The first 2 digits are used to identify what plugin the form comes from. This will change depending on if you view it in the ck/tesedit (based on the masters of the plugin) or in game (based on load order). The last 6 digits are the numeric ID of the form in that plugin and will be the the same in both tools, like the CK or tesedit, and in game. GetFormFromFile uses only the last six digits and uses the filename instead of the first 2 digits.

Your issue might be that the player has rank -1 in the faction which is usually used as the may eventually join the faction rank. Try Player.getFactionRank instead. But getFactionRank will error if they aren't in the faction so to use it if and only if that mod is present do something like

TestFaction = Game.GetFormFromFile(0x1A565B, "Duke Patricks - TEST.esp") as factionif (testFaction)debug.messagebox(playerRef.GetFactionRank(testFaction))EndIf

PLB said he would look into addressing this in skse but I'm not sure its in the latest one.

User avatar
Jodie Bardgett
 
Posts: 3491
Joined: Sat Jul 29, 2006 9:38 pm

Post » Sun Jul 13, 2014 3:54 pm

yep, that was it. Thanks again to all of you.

I just wish I had more smart questions than dumb ones. :tongue:

User avatar
ChloƩ
 
Posts: 3351
Joined: Sun Apr 08, 2007 8:15 am


Return to V - Skyrim