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

Post » Fri Feb 18, 2011 11:07 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.

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
Kellymarie Heppell
 
Posts: 3456
Joined: Mon Jul 24, 2006 4:37 am

Post » Fri Feb 18, 2011 8:18 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
Emily Rose
 
Posts: 3482
Joined: Sat Feb 17, 2007 5:56 pm

Post » Sat Feb 19, 2011 5:02 am

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
Tasha Clifford
 
Posts: 3295
Joined: Fri Jul 21, 2006 7:08 am

Post » Sat Feb 19, 2011 1:53 am

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
louise fortin
 
Posts: 3327
Joined: Wed Apr 04, 2007 4:51 am


Return to IV - Oblivion