Talk:BuildRef

From GECK
Jump to: navigation, search

Hello there, I started to write a plugin that doesn't have any masters except FalloutNV.esm, but still supports all DLCs and various mods. To achieve that, you may use a quest script as patch:

______________________________________

scn PatchQuestScript

Begin MenuMode 4

==> This will only run in the main menu. Depending on how big your patches are, it may take some time to reach the title screen

if GetGameRestarted

==> We either just want to do that once per game start.

Call PatchListScript1

==> As one script might not enough and you want to use this script also for other things, I recommend functions, that will only be called when necessary.

endif

End

______________________________________



______________________________________

Scn PatchListScript1

short sModIndex

ref rRefBuilt

Begin Function{}

if IsModLoaded "LonesomeRoad.esm"

==> Now we have two options. If you want it difficult, you may use "BuildRef" from NVSE.

Let sModIndex := GetModIndex "LonesomeRoad.esm" Let rRefBuilt := BuildRef sModIndex, 37246

==> This will build a reference for the "MRE" consumable from Lonesome Road DLC.
==> The actual hex ID is "917e". So you need to look up for an online converter, put this ID in and convert it into decimal value.
==> Or you can install JIP LN NVSE plugin and use "GetFormFromMod" instead. It's a feature from Lutana plugin.

Let refBuilt := GetFormFromMod "LonesomeRoad.esm" "917e"

==> This will build a reference like above, but you don't have to use decimal values or a variable for mod index.
==> You can now use these variables to add them into FormLists with "ListAddForm" for example.
==> Forms added by "ListAddForm" aren't saved into the savegame, which may save a lot of mess, but either requires that these patches are run everytime the game is started.

endif

End

___________________________________


You can also use this functions of building references, if you don't want to add a "persistent reference" into the game (with an unique Ref ID name). You simply have to go into World View in Geck, check the reference in question and note the unique RefID shown there, if you click onto the object. The RefID is shown where you can enter the Ref ID name. Use the same method to build a reference for that world object (not the base object), with which you can work.

--JustChill (talk) 07:19, 3 April 2019 (UTC)