Skyrim

File information

Last updated

Original upload

Created by

Xander9009

Uploaded by

Xander9009

Virus scan

Safe to use

About this mod

A small script to allow other mods to pass information to yours without any interaction between the two.

Requirements
Permissions and credits
Requires SKSE

When you make a mod accept information from other mods, it often comes with one of two drawbacks. Either your mod must be updated constantly to accept the new information, or their mod must insert its information into yours, which requires a script, and a quest if they don't already have one.

With this, script, you can set up the script in your mod, then other mods can pass information to you simply by creating a global variable and changing its FormID. This means you don't need to update your mod, and they don't need scripts and quests.

Why would you need this? The idea behind this plugin is to use it in mods which are intended for other mods to be able to interact with it. For instance, if you charge the player taxes based on the houses they own, but the houses cost different amounts of gold based on how extensive they are, where they're located, or something else, then there's no good way for you to determine how much to charge for the owning the house or even necessarily whether or not the player owns the house. With this system, you could be compatible with any house mod (and any number of house mods) as long as they have a global variable for what the current rent should be for that house. The mod would set the rent to a relevant price when the player owns the house and 0 before that point. That house mod would only have this inherent compatibility with that rent mod, but other rent mods could also pull in that same global variable, allowing compatibility without any extra work. And the mod that charges rent doesn't need to look for mods that add houses. It just finds these specific global variables and that's it. The rent mod, in this case, should check if the form is a global variable or a formlist of global variables in case some mod adds multiple houses.

Another usage example would be a mod that affects all ingredients or all of a certain type. Rather than constantly scanning the player for unknown ingredients to add to the mod's lists or making a compatibility patch for each mod which adds ingredients, the plugin would allow the mod to simply look for a formlist of ingredients which should be affected. The makers of the mods which add these ingredients would then just need to make a formlist of all of the ingredients which the mod should affect. If the other mod isn't installed, the formlist is useless but does nothing harmful.

As you can see, this plugin does add a new way for mods to interact with one another. It may not open up a whole new era of modding, but for certain cases, it could make an otherwise difficult task very easy.

The process is simple.
  • Create a FormList. This will contain the actual forms from the other mod, whether they're global variables that contain numbers or formlists that contain whatever it is your mod uses (or any other form).
  • Create a quest, then attach the included script to that quest.
  • Set the two properties. The FormList property should be the FormList from step 1. The FormIDBase should be "{F}{NexusModID}". Your NexusModID is the number in your mod's URL on the Nexus. If you number is more than 5 digits, truncate it or convert it to hexadecimal. If it is less than 5 digits, preceed it with 0's. It MUST be 5 digits. This doesn't have any affect on the actual script. It ONLY serves to allow other modders to link to know which number to use, and using your NexusID allows you to avoid conflicts with other mods.
You're done. When you run the game, your formlist will be populated with any relevant forms from other mods.

To make a mod use this system from the other end, it's just as easy, but it requires Tes5Edit.
  • Make a form that you want to pass and the other mod is expecting. If it's expecting a global variable, make a global variable. If it's expecting a formlist, make a formlist.
  • Save and exit.
  • Open your mod in Tes5Edit. Find the form you made.
  • Right click and choose "Change FormID".
  • DO NOT TOUCH THE FIRST TWO DIGITS
  • Set the last 6 digits to {F}{NexusModID}.
  • Exit and allow it to save.
That's it. The other mod will get the info, and from there, magic.

I've included some examples. There are two files. One file, PCF_Test, is just a global variable with the correct FormID. The other, PCF_Parentless Connection Framework contains a quest with two scripts. The manager script is the one that you'll be using. The other just shows it in action. This esp also contains a global, although it has a different value. This global is in no way directly connected to the quest or the script, but the script will pick it up just as if it came from another mod. If you start the game with these two enabled, after about 10 seconds, you'll get two notifications telling you the name of the mod it found the form in, and the value of the form (they're both global variables, although the example is set up to also accept a formlist which is populated with globals for passing multiple arguments).

This script ONLY runs when the it updates, and unless you update it, that only happens once. To use it in your mod, discard everything except PCF_ManagerScript. Attach that to your quest, the rest is just for showing you what it does.

If you have any questions, let me know.