Difference between revisions of "BuildRef"
Jump to navigation
Jump to search
imported>Odessa (New page, correct capitalization) |
imported>Odessa (more concise) |
||
Line 3: | Line 3: | ||
|summary = Takes a mod index as an integer set by [[GetModIndex]] and the decimal converted formID of an object, which may be either a reference or base form, and returns a reference to it. | |summary = Takes a mod index as an integer set by [[GetModIndex]] and the decimal converted formID of an object, which may be either a reference or base form, and returns a reference to it. | ||
This can be used to reference forms contained in non-dependent external modules | This can be used to reference forms contained in non-dependent external modules, but great care must be taken as invalid usage may crash the game. | ||
|name = BuildRef | |name = BuildRef | ||
|returnType = form | |returnType = form | ||
Line 14: | Line 13: | ||
|Name = DecimalFormID | |Name = DecimalFormID | ||
|Type = int | |Type = int | ||
}} | }}}} | ||
==Example== | |||
<pre> | |||
int iModIndex | |||
ref rRainySmiles | |||
if IsModLoaded "SomePopularCompanionMod.esp" | |||
set iModIndex to GetModIndex "SomePopularCompanionMod.esp" | |||
set rRainySmiles to BuildRef iModIndex 1068677 | |||
endif | |||
</pre> | |||
==Notes== | ==Notes== | ||
* Remember that if one uses an invalid decimal form ID then it will likely crash the game. This may be an issue if the form is non existent or different in past or future versions of the referenced module, or if two distinct modules are given the same file name. | * Remember that if one uses an invalid decimal form ID then it will likely crash the game. This may be an issue if the form is non existent or different in past or future versions of the referenced module, or if two distinct modules are given the same file name. | ||
==See Also== | ==See Also== |
Revision as of 19:29, 28 June 2014
< [[::Category:Functions|Category:Functions]]
A function added by the New Vegas Script Extender.
Description
Takes a mod index as an integer set by GetModIndex and the decimal converted formID of an object, which may be either a reference or base form, and returns a reference to it.
This can be used to reference forms contained in non-dependent external modules, but great care must be taken as invalid usage may crash the game.
Syntax
(form) BuildRef ModIndex:int DecimalFormID:int
Example
int iModIndex ref rRainySmiles if IsModLoaded "SomePopularCompanionMod.esp" set iModIndex to GetModIndex "SomePopularCompanionMod.esp" set rRainySmiles to BuildRef iModIndex 1068677 endif
Notes
- Remember that if one uses an invalid decimal form ID then it will likely crash the game. This may be an issue if the form is non existent or different in past or future versions of the referenced module, or if two distinct modules are given the same file name.