phenderix Posted May 3, 2012 Share Posted May 3, 2012 (edited) Hey! I am having trouble with global variables on some Mark and Recall spells I am working on - I have never used them before - and I can't seem to get there values to save any help? Code for Mark Spell Scriptname PhenderixTeleportMarkScript extends ActiveMagicEffect ObjectReference caster Event OnEffectStart(Actor akTarget, Actor akCaster) caster = Game.getPlayer() ZZMarkLocationX.setValue(caster.getPositionX()) ZZMarkLocationY.setValue(caster.getPositionY()) ZZMarkLocationZ.setValue(caster.getPositionZ()) Debug.notification("Mark position updated. ") Debug.notification("Mark X Value: " + ZZMarkLocationX.getValue() + " Player X Value " + caster.getPositionX() )EndEvent GlobalVariable Property ZZMarkLocationX AutoGlobalVariable Property ZZMarkLocationY AutoGlobalVariable Property ZZMarkLocationZ Auto Code for Recall Spell Scriptname PhenderixTeleportRecallScript extends ActiveMagicEffect ObjectReference caster Event OnEffectStart(Actor akTarget, Actor akCaster) if(ZZMarkLocationX.getValue() == 0) Debug.notification("You have not marked a location yet.") endIf if(ZZMarkLocationX.getValue() != 0) caster = Game.getPlayer() caster.setPosition(ZZMarkLocationX.GetValue(), ZZMarkLocationY.GetValue(), ZZMarkLocationZ.getValue()) endIfEndEvent GlobalVariable Property ZZMarkLocationX AutoGlobalVariable Property ZZMarkLocationY AutoGlobalVariable Property ZZMarkLocationZ Auto In the recall spell when those notifications come up it always says that ZZMarkLocationX is 0...any suggestions? Edited May 3, 2012 by phenderix Link to comment Share on other sites More sharing options...
fg109 Posted May 3, 2012 Share Posted May 3, 2012 (edited) Did you remember to set your properties? If you named your properties the same as the global variables, then you can just push the "auto-fill all" button. Something you might want to consider is that each city and each interior is its own world space, with its own set of coordinates. Edited May 3, 2012 by fg109 Link to comment Share on other sites More sharing options...
phenderix Posted May 3, 2012 Author Share Posted May 3, 2012 Wow!!! Thanks you so much!!! I just hit auto-fill on the properties and the spells work perfectly now! Thanks!Have already given you kudos so nothing more I can do :( Link to comment Share on other sites More sharing options...
Recommended Posts