Jump to content

Add item from Mod A to Mod B, only if Mod A is loaded


aurreth

Recommended Posts

Yes, I know this takes scripting. Please don't just say "you'll have to make a script", it's not helpful in any way.

 

Scenario:

 

ModA contains a terminal. What I want is to inject that terminal into ModB, but only if ModB is loaded.

 

I know this needs a quest that runs on startup. I know how to check if ModB is loaded.

 

What I don't know is how to place the terminal. I know where I want it, cell, coordinates and rotation, but not how to get it there, because of course the cell doesn't exist if ModB isn't being used.

 

What I do not want is ModA to require ModB, nor ModB to require ModA. Both mods should work independently of each other, useable whether or not the other exists. This is because there are also Mods C, D, E, etc. and I want them all to be usable separate or together as the player chooses.

 

 

 

Link to comment
Share on other sites

What you want is remote masterless calls to external assets. I use 'em in nearly every solution (over 50) between SKK mods and DLC content so my solutons are never actually dependent on other mods or DLCs. I hate master dependencies (except fallout4.esm natch).

 

Here is a primer to get you started on validating if a mod is installed and getting a remote form. Your gunna have to look up the commands for backround as I dont do 100 level:

Terminal rSKK_SASAttackTerminal
ObjectReference rSKK_SASAttackTerminalREF
If (Game.IsPluginInstalled("SKKSettlementAttackSystem.esp") == TRUE)
   rSKK_SASAttackTerminal = Game.GetFormFromFile(0x000277f5, "SKKSettlementAttackSystem.esp") as Terminal
   rSKK_SASAttackTerminalREF = Game.GetFormFromFile(0x000277f6, "SKKSettlementAttackSystem.esp") as ObjectReference
EndIf

Accessing scripts attached to remote assets is more complex (and the way it is described in CK.com is appalling):

If (rSKK_SASAttackTerminalREF != None) && (Game.IsPluginInstalled("SKKSettlementAttackSystem.esp" == TRUE)
	ScriptObject rSKK_SASAttackTerminalScript = rSKK_SASAttackTerminalREF.CastAs("SKK_SASAttackTerminalScript") 
	Var vReturn = rSKK_SASAttackTerminalScript.CallFunction("GetAttackWorkshopValue", new Var[0]) 
	ObjectReference AttackWorkshop = vReturn as ObjectReference
EndIf
Link to comment
Share on other sites

 

What you want is remote masterless calls to external assets. I use 'em in nearly every solution (over 50) between SKK mods and DLC content so my solutons are never actually dependent on other mods or DLCs. I hate master dependencies (except fallout4.esm natch).

 

Here is a primer to get you started on validating if a mod is installed and getting a remote form. Your gunna have to look up the commands for backround as I dont do 100 level:

Terminal rSKK_SASAttackTerminal
ObjectReference rSKK_SASAttackTerminalREF
If (Game.IsPluginInstalled("SKKSettlementAttackSystem.esp") == TRUE)
   rSKK_SASAttackTerminal = Game.GetFormFromFile(0x000277f5, "SKKSettlementAttackSystem.esp") as Terminal
   rSKK_SASAttackTerminalREF = Game.GetFormFromFile(0x000277f6, "SKKSettlementAttackSystem.esp") as ObjectReference
EndIf

Accessing scripts attached to remote assets is more complex (and the way it is described in CK.com is appalling):

If (rSKK_SASAttackTerminalREF != None) && (Game.IsPluginInstalled("SKKSettlementAttackSystem.esp" == TRUE)
	ScriptObject rSKK_SASAttackTerminalScript = rSKK_SASAttackTerminalREF.CastAs("SKK_SASAttackTerminalScript") 
	Var vReturn = rSKK_SASAttackTerminalScript.CallFunction("GetAttackWorkshopValue", new Var[0]) 
	ObjectReference AttackWorkshop = vReturn as ObjectReference
EndIf

 

Ok, but that is backwards from what I want to do.

 

ModB is a settlement mod, it has a cell, call it SettlementCell

 

I don't want ModB to check for ModA, the terminal, I want ModA to inject the terminal into ModB

 

The quest and script go in ModA. Bit of pseudo code:

if (ModB is loaded) then
  place MyTerminal in SettlementCell
  move SettlementCell.MyTerminal to X Y Z
  rotate SettlementCell.MyTerminal to x y z
endif

I can probably figure out how to place the terminal, what I need is a way to insert it into the cell of the other mod.

 

I want to do it this way because I'm working on a series of settlement mods, B,C,D etc. I don't want to have to add in code to 5 or 6 different mods. I want to edit the terminal mod to inject into 5 different mods. Easier to edit one than edit five.

Edited by aurreth
Link to comment
Share on other sites

Never mind. I can't even get the simplest, do nothin script to compile. I forgot what a total pain it is to get the CK properly set up for scripting since Bethesda packs away the necessary files instead of installing them properly. I did it once for Skyrim, I just don't have the energy to do it all over again for Fallout.

 

Thanks for trying to help.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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