Jump to content

OBSE : SetEventHandler with OnPackageDone


Alaitur59

Recommended Posts

hi,

I'm trying to script when a AI Package is done. I have a script, rally on me. This one call all companions to run straight on me. To do this I add an AI package rallyOnMe to each companion wich order them to run to my current position. When they rally me I would like to make those who where following me (before I order to rally) to back following me and those who where waiting back waiting.

 

In the way to do this, I try to use setEventHandler (http://cs.elderscrolls.com/index.php?title=SetEventHandler)

information about OnPackage : http://cs.elderscrolls.com/index.php?title=Event_Handler_Functions

my problem comes with the second parameter of OnPackageDone who is : "package:form", I don't know how to set this paramater. I tried :

SetEventHandler "OnPackageDone" fnPackage "ref"::refTarget "form"::rallyOnMe

and

SetEventHandler "OnPackageDone" fnPackage "ref"::refTarget "ref"::rallyOnMe

fnPackage is a simple function where I get the name and the reference of the target screen in the console output. In the first case (form) I got the name and the reference of the target whatever the package ended. In the second case (ref) it's a big mess, I see, in continous, NPCs names and their refs, NPCs that I don't even meet in the game.

Edited by Alaitur59
Link to comment
Share on other sites

The third argument must be "first" or "ref" and the fourth must be "second" or "object"

Not sure if the quotes are OK or not. The OBSE doc has examples without quotes and the WIKI has them with quotes.

 

So your line would be

SetEventHandler "OnPackageDone" fnPackage first::refTarget second::rallyOnMe

or

SetEventHandler "OnPackageDone" fnPackage ref::refTarget object::rallyOnMe
Link to comment
Share on other sites

ok, it works. Thx QQuix, I would never thought about using "object" neither "first" or "second". For your question about the quotes, both work, but if you don't add them you get a warning for each argument ( that it will be treated like a string ) when you save the script.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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