Jump to content

Photo

Unsure about interscript communication with Aliases

script properties quest alias

  • Please log in to reply
12 replies to this topic

#11
Hoamaii

Hoamaii

    Resident poster

  • Premium Member
  • 3,225 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).



#12
IsharaMeradin

IsharaMeradin

    The Pale Redguard

  • Members
  • PipPipPipPipPip
  • 10,548 posts

Regarding your PS question...  no idea.  Try putting in a notification display string that will tell you who is which.  Obviously you'll remove it once you've figured out who fills which spot.



#13
Hoamaii

Hoamaii

    Resident poster

  • Premium Member
  • 3,225 posts

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:







Also tagged with one or more of these keywords: script, properties, quest, alias

IPB skins by Skinbox
Page loaded in: 1.041 seconds