Jump to content

Script: Accesing items without setting properties


Recommended Posts

Is there a way to use items in scripts without the need to set them up via properties, but directly.

 

 

E.g. "c_oil_scrap" "LanternOil" in a script that removes items from the player

Link to comment
Share on other sites

FO4 has GetFormFromFile which allows you to grab a form from a plugin and store it in a variable for manipulation or whatever. This is useful when wanting to use an item from a mod without making that mod a hard requirement.

 

Unfortunately, I do not see GetModByName on the FO4 CK Wiki. That function provided by SKSE allows one to ensure that the target mod is present before running functions that require the presence of the mod. Helps to eliminate log spam. Thankfully the error produced by GetFormFromFile when the target plugin is not present is harmless just bloats the papyrus log.

Link to comment
Share on other sites

The way to avoid error log spam for GetFormFromFile is simple with IsPluginInstalled

If (Game.IsPluginInstalled("DLCNukaWorld.esm") == TRUE)
   Weapon ThisWeapon = Game.GetFormFromFile(0x00033b60, "DLCNukaWorld.esm") as Weapon ;Handmade
   pSKK_WULootWeapons.AddForm(ThisWeapon)
EndIf

Example: how to make mods aware of DLC assets without any dependency on DLCs.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...