Jump to content

How do I get a targets reference in script?


Gamerbird

Recommended Posts

What I need is the way in which I can obtain the targets reference when the spell hits them, then use that reference in the same script. Can someone post this please....

 

Thanks

 

----EDIT------

Sorry I got it wrong, I actually need a way to get their ID then use it.

Link to comment
Share on other sites

Just so I have this straight... You need a script attached to a spell. When the spell hits the target you want the script on the spell to do something to that target, right?

 

In that case, a simple script like;

ref target

begin scripteffectstart
set target to getself
target.<insert function here>
end

 

should work. If however I have this wrong, and you want the target to be known before the spell hits, then you may be a bit out of luck as that can't really be done.

 

You could also set the reference in another script (like a quest script (set <questname>.<refname> to getself)) if you wanted other scripts to access that reference. However this can cause significant problems if the target isn't a persistant reference, or the reference isn't cleared out before that reference becomes invalid.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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