Difference between revisions of "GetFormFromFile - Game"

Jump to navigation Jump to search
35 bytes removed ,  02:07, 22 August 2012
m
imported>JustinOther
m (→‎Examples: Pulled unused asDLCName arg)
imported>JustinOther
m (→‎Examples: Wording)
Line 31: Line 31:
*To merely detect if a plugin is loaded.
*To merely detect if a plugin is loaded.
<source lang="papyrus">Bool bIsBagOfHoldingLoaded = Game.GetFormFromFile(0x000012EE, "Bag of Holding.esp") ; Is Bag of Holding.esp loaded?</source>
<source lang="papyrus">Bool bIsBagOfHoldingLoaded = Game.GetFormFromFile(0x000012EE, "Bag of Holding.esp") ; Is Bag of Holding.esp loaded?</source>
*Say you want to detect if DLCs are loaded and need to do/undo something in the event a DLC is added or removed from the user's load list: Create a Boolean, Int, and String array, each with one element per DLC to check such that the indices of all three correspond. Leave the boolean elements with their default 'False' values and set each string element with the exact name of the plugin to check for such that their indices correspond. For this to work, the Int[] elements must match known existing FormIDs in the corresponding plugins converted from Hex to Dec (easily done with Windows' calculator in programmer mode).
*Say you want to detect if DLCs are loaded and need to do/undo something in the event a DLC is added or removed from the user's load list: Create a Boolean, Int, and String array, each with one element per DLC to check such that the indices of all three correspond. Leave the boolean elements with their default 'False' values and set each string element with the exact name of the plugin to check for. For this to work, the Int[] elements must match known existing FormIDs in the corresponding plugins converted from Hex to Dec (easily done with Windows' calculator in programmer mode).
<source lang="papyrus">Bool[] Property bDLCArray Auto ; Element 0 is bDawnguard, etc.
<source lang="papyrus">Bool[] Property bDLCArray Auto ; Element 0 is bDawnguard, etc.
Int[] Property iFormIDArray Auto ; Element 0 is 2048 for Dawnguard's DLC1AurielsBow "Auriel's Bow" [WEAP:02000800], etc.
Int[] Property iFormIDArray Auto ; Element 0 is 2048 for Dawnguard's DLC1AurielsBow "Auriel's Bow" [WEAP:02000800], etc.
Anonymous user

Navigation menu