porroone Posted March 17, 2012 Share Posted March 17, 2012 So I have 2 scripts running with 2 magic effect, the first one is meant to get the variable and the second one to set it, so basically I have this script that attemps to get the variable from the "Slave" script. Scriptname Master extend activeMagicEffect float run Slave property SlaveRef auto Event onEffectStart(Actor akCaster, Actor akTarget) Run = 1 while Run > 0 Debug.Notification(SalveRef.Var) endWhile endEvent And here is how the slave scripts looks like: Scriptname Slave extend activeMagicEffect float property Var auto Event onEffectStart(Actor akCaster, Actor akTarget) Var = 1 endEvent Its not the full scripts, its just an example of what im trying to do but doesnt work. Link to comment Share on other sites More sharing options...
tunaisafish Posted March 17, 2012 Share Posted March 17, 2012 I think you'll have to pass the value via some permanent storage. Quest variable or a Global. Each time a magic effect is used, there's a brand new script instance (with new ref), complete with its' own set of clean variables. Link to comment Share on other sites More sharing options...
porroone Posted March 17, 2012 Author Share Posted March 17, 2012 Well I was afraid of that, thanks for the quick reply, somebody should update the wiki tho, this is taken from the there:"If you want to access any of the Functions or Variables within a quest script (or any script for that matter)"Note like they say any script. Link to comment Share on other sites More sharing options...
porroone Posted March 17, 2012 Author Share Posted March 17, 2012 One thing tho, using a quest is less expensive than using a global ? regarding resource consumption. Link to comment Share on other sites More sharing options...
tunaisafish Posted March 17, 2012 Share Posted March 17, 2012 A quest is a much more complex object than a global (whose only content is the value and some flags).So I'd say don't add a quest if all you're going to use it for is to hold a script with a property. BTW, I fixed the wiki. That page still could do with better info but it should be less confusing now anyway. Link to comment Share on other sites More sharing options...
porroone Posted March 18, 2012 Author Share Posted March 18, 2012 Thanks you've been very helpful ^^ Link to comment Share on other sites More sharing options...
eltucu Posted March 18, 2012 Share Posted March 18, 2012 And you could use just an integer (int) or true/fasle (boolean) if you're going to use 1 or 0 as values :) Link to comment Share on other sites More sharing options...
porroone Posted March 18, 2012 Author Share Posted March 18, 2012 Im using a boolean on the main script, thats a copy paste from something that did work, where I was using an angle, both scripts were on the same actor tho. Link to comment Share on other sites More sharing options...
Recommended Posts