Referencing objects, quests and functions from others ESMESP

Post » Tue May 08, 2012 4:06 am

Hi,

I finally got around to releasing the betta of my http://tesnexus.com/downloads/file.php?id=39705. So now I'm looking at making versions of it that work along side the main weather mods. I need to do this by building in function to make it work with them because my mod uses the same weather override functions as the other weather mods do. The first one I've looked at is Enhanced Weather (which is the one I use) and fortunately it looks quite easy to make a version of my mod that plays along with it. I believe I've got the code done but I've not been able to test it as I don't know how to work the Construction Set in to make my mod's ESP able to reference the Quests, Variables and OBSE functions I need to make my script work with EW.

Enhanced Weather is split into a ESM and a ESP. To make my script work with it I need to reference the new weather types (from the ESM), set a variable in the main weather quest (also in the ESM) and call an OBSE style user function from my Mod (also found in the ESM). The problem is I don't know how to add these things in such a way that the Construction Set will save my scripts and that I have a viable mod at the end. I thought since I only reference the ESM, and ESM's are safe as masters, I could just use that as a master, save my script and it would work. But the construction set came up with a host of missing things when loading and refused to save my scripts calling quests, etc from EW.

PS. To keep things simple I'm just making another version of my own ESP to work with EW as it's only small.
User avatar
elliot mudd
 
Posts: 3426
Joined: Wed May 09, 2007 8:56 am

Post » Tue May 08, 2012 3:01 am

Ah, OK. My mistake I think. I think the missing references I was getting were the SI weather types from EW, and the problem with saving it was my own stupid mistake. I can save it using only the EnhancedWeather.esm as a master. Hopefully this will be OK.
User avatar
helen buchan
 
Posts: 3464
Joined: Wed Sep 13, 2006 7:17 am

Post » Mon May 07, 2012 11:47 pm

alternatively if you use OBSE and you do not want to have EW as a master, you could use something like this:

short EWvar
short MyEWvar

ref EWname
ref MyEWname


if IsModLoaded "EnhancedWeather.esm" - - >(quotation marks necessary)

RunScriptLine "set EWQuest.EWvar to MyEWvar" - - >(quotation marks necessary)
RunScriptLine "set EWQuest.EWName to MyEWName"

endif


Now your script vars == the EW script vars.
However, if the EW mod is not loaded, you're on your own.
User avatar
Amelia Pritchard
 
Posts: 3445
Joined: Mon Jul 24, 2006 2:40 am


Return to IV - Oblivion