Alaitur59 Posted June 23, 2014 Share Posted June 23, 2014 (edited) 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_Functionsmy 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"::rallyOnMeand SetEventHandler "OnPackageDone" fnPackage "ref"::refTarget "ref"::rallyOnMefnPackage 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 June 23, 2014 by Alaitur59 Link to comment Share on other sites More sharing options...
QQuix Posted June 23, 2014 Share Posted June 23, 2014 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::rallyOnMeor SetEventHandler "OnPackageDone" fnPackage ref::refTarget object::rallyOnMe Link to comment Share on other sites More sharing options...
Alaitur59 Posted June 23, 2014 Author Share Posted June 23, 2014 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 More sharing options...
Recommended Posts