Difference between revisions of "GetFormID - Form"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Rhavlovick
m (1 revision: Clobber re-import by Henning)
 
imported>Pufthemajicdragon
(Cleaned up notes text, making it easier to understand.)
 
(3 intermediate revisions by 2 users not shown)
Line 20: Line 20:
; Obtains the form id of the main quest
; Obtains the form id of the main quest
int formID = mainQuest.GetFormID()
int formID = mainQuest.GetFormID()
</source>
== Notes ==
* The value returned by GetFormID is always in decimal. This can be confusing to anyone expecting the return value to be the hex value for a form found in the Creation Kit. You will have to convert the value yourself. This can be easily done with the windows calculator, by selecting "View → Programmer" and selecting "Dec", pasting the value in, and then selecting "hex".
Example:
<source lang="papyrus">
Int myFormID = SomeTree.GetFormID()
;result...
768339 = BB953; or 000BB953 in the editor.
</source>
</source>


Line 25: Line 35:
*[[Form Script]]
*[[Form Script]]
*[[GetForm - Game]]
*[[GetForm - Game]]
*[[Arrays (Papyrus)#Creating_a_FormID Array|FormID Array]]

Latest revision as of 15:47, 12 January 2016

Member of: Form Script

Returns this form's form ID.

Syntax[edit | edit source]

int Function GetFormID() native

Parameters[edit | edit source]

None

Return Value[edit | edit source]

The form ID of this form.

Examples[edit | edit source]

; Obtains the form id of the main quest
int formID = mainQuest.GetFormID()

Notes[edit | edit source]

  • The value returned by GetFormID is always in decimal. This can be confusing to anyone expecting the return value to be the hex value for a form found in the Creation Kit. You will have to convert the value yourself. This can be easily done with the windows calculator, by selecting "View → Programmer" and selecting "Dec", pasting the value in, and then selecting "hex".

Example:

Int myFormID = SomeTree.GetFormID()
;result...
768339 = BB953; or 000BB953 in the editor.

See Also[edit | edit source]