a way for one of my mods to set a short in another one of my

Post » Wed Dec 07, 2011 7:46 am

I looked in the OBSE docs for an hour and I know it is there but I do not "recognize " it from reading the descriptions of the commands.

I need a way for one of my mods to set a short in another one of my mods.

There are 3 possible outcomes in mod one (a quest mod).

Mod two (game mechanics mod) needs to know which of those three the player picked when they finished their quest.

I do not want either mod to be a master of the other, no dependency.
User avatar
Sara Lee
 
Posts: 3448
Joined: Mon Sep 25, 2006 1:40 pm

Post » Tue Dec 06, 2011 7:52 pm

I looked in the OBSE docs for an hour and I know it is there but I do not "recognize " it from reading the descriptions of the commands.

RunScriptLine "set questName.VarName to value"

If you instead of a hardcoded value wants to set it to the value of a variable in your other mod, change it to:
RunScriptLine "set questName.VarName to questName2.VarName2"



Similarly, you can read the short var into your mod with the same command, only switching the two variable that are read and set.
User avatar
Sarah MacLeod
 
Posts: 3422
Joined: Tue Nov 07, 2006 1:39 am

Post » Tue Dec 06, 2011 10:32 pm

The only way I know of would be to perhaps, find an unused vanilla container and place a vanilla object in it. One for each 'value' you want. The second mod could check that chest for how many of that object are in the chest and it would know the number you need to pass.

If you use an unplayable object, the player will never know that object is in the chest anyway. And you could remove the objects once the second mod has the value it needs. If you do it this way, you could make the player the 'container' that holds the hidden objects. Making them quest objects would also make sure they never get removed except by script.
User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Post » Tue Dec 06, 2011 6:22 pm

The only way I know of would be to perhaps, find an unused vanilla container and place a vanilla object in it. One for each 'value' you want. The second mod could check that chest for how many of that object are in the chest and it would know the number you need to pass.
But aside from the complication, will also require both mods to be written especially to pass the value. Given that Duke Patrick is using OBSE already, there's no reason not to use the very simple OBSE commands to do it - and the other mod neither needs to be using OBSE or even know about the parameter passing.

I already read and change values of variables in other non-OBSE mods from my mods this simple way, even for other mods that has been long since abandonded (like how I check if Frans has Living Economy running within it, and if so gives the player an option to stop Living Economy - all from Enhanced Economy).

But what you describe is a neat trick for two non-OBSE mods that need to be written to co-operate.
User avatar
Cartoon
 
Posts: 3350
Joined: Mon Jun 25, 2007 4:31 pm


Return to IV - Oblivion