Jump to content

Scripting help for Phenderix? Please?


phenderix

Recommended Posts

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 Auto

GlobalVariable Property ZZMarkLocationY Auto

GlobalVariable 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())

endIf

EndEvent

 

GlobalVariable Property ZZMarkLocationX Auto

GlobalVariable Property ZZMarkLocationY Auto

GlobalVariable Property ZZMarkLocationZ Auto

 

 

 

 

 

 

 

In the recall spell when those notifications come up it always says that ZZMarkLocationX is 0...any suggestions?

Edited by phenderix
Link to comment
Share on other sites

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 by fg109
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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