Jump to content

Unsure about interscript communication with Aliases


Recommended Posts

Thanks again for your advices and patience with my sometimes flickering English... :ermm:

 

Considering what you've said, I rethought entirely the way I trigger my "cleaning process" and went back to using GlobalVariables instead. Everytime my radiant quest starts (or restarts) whether through MCM menu or maintenance script from the controlling quest, I mod a "Watch" variable by one .Mod(1.0). Then I attached a "cleaning script" to a "witness" form which spawns a ref when the radiant quest starts (or restarts) but is not an Alias and thus stays in game whether the quest is running or not. OnInit(), that script gets my "Watch" variable value and stores it (when it is first loaded), then later in game compares it with the current value of that "Watch" variable. If the quest has been restarted between that checking function and the time its witness ref was first loaded, then InitValue and CurrentValue are different, and that serves me as a "warning" event to start my cleaning process. Once that is done, I delete the witness ref. (I also reset my Watch Variable when it gets above 20 so that it never gets too large). I tested that in game, loading, reloading, stopping quests several times, it seems to work.

 

Sometimes I think one of the hardest things about modding is trying to figure out what users may do with your mod and how many ways they may find to put it at fault... So maybe I was being over-zealous with my cleaning up intent, but being too careful can't hurt, right? Provided I have not overlooked something else... ;)

 

I'm still learning in the process, I'm glad you helped me better understand bools and how I can make interscripts communication work with aliases (and discovering that you can reference it the other way around when needed!..), I'll sure use that! Possibly, English not being my native language doesn't help much, or maybe it's just that I have absolutely no scripting background - still, I'd be at a complete loss to describe any of that in French!..

 

Many thanks again for your kind help, IsharaMeradin :) Have a nice weekend.

 

 

PS. Ooops, second thought: has nothing to do with the current topic but I always have to think twice when scripting spells. Say I add a cloak spell to an actor, later when I need to reference that actor in my MagicEffect script, would that actor be akCaster or akTarget? (ahem, sorry, last question, I promise).

Link to comment
Share on other sites

Oh yeah, at the moment my scripts are littered with traces and notifcations!.. In this Spell case, I have only a 50% chance to be right (or wrong) anyway :wink:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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