Jump to content

[LE] What is the event I need to trigger something when an object is picked as a quest alias?


corrado33

Recommended Posts

I have a quest that I trigger with a spell. This quest runs another quest that has a dozen or so aliases that are picked based on being nearby and matching a formlist. This all works great!

 

What I want to do is make those specific objects glow when they are picked as the quest alias.

 

I figured I could use the "Play" function, but I can't seem to find a matching event?

 

Would it be "OnInit"?

 

Since the quest is being triggered by the spell, would it run "onInit" every time? Or just the first time it's run? My testing shows that it runs when the game is loaded, and everytime the spell is cast, however I don't think it'll run on every alias. For testing I added the following event to the script that runs on the quest aliases.

event OnInit()
	debug.notification("In Init")
endevent

When I cast the spell (near the items I care about) it only displays "In Init" once, meaning it only ran once, even if I'm surrounded by multiple of the items I care about. If I'm trying to make ALL of the objects glow, I doubt this'll work.

 

So which... event do I need?

 

EDIT: Also, how do I reference the object that's... being referenced by the alias? If I use "self" it just returns the reference alias, not the object that's currently filling that alias.

Edited by corrado33
Link to comment
Share on other sites

Try applying a script to each of the aliases. Test first to see if your test text appears the correct number of times. Each properly filled alias with a script should run its own OnInit event each time the quest is started. If the test works correctly, apply the correct effects.

Link to comment
Share on other sites

Try applying a script to each of the aliases. Test first to see if your test text appears the correct number of times. Each properly filled alias with a script should run its own OnInit event each time the quest is started. If the test works correctly, apply the correct effects.

Each alias DOES have a script. I literally just duplicated the first alias after I had already set it up.

 

Does it have to be a DIFFERENT script for each alias?

Link to comment
Share on other sites

Try applying a script to each of the aliases. Test first to see if your test text appears the correct number of times. Each properly filled alias with a script should run its own OnInit event each time the quest is started. If the test works correctly, apply the correct effects.

So... OnInit works fine.

 

I just didn't know how to test it... and now I did, and now it works. :) Thanks

Link to comment
Share on other sites

 

Try applying a script to each of the aliases. Test first to see if your test text appears the correct number of times. Each properly filled alias with a script should run its own OnInit event each time the quest is started. If the test works correctly, apply the correct effects.

Each alias DOES have a script. I literally just duplicated the first alias after I had already set it up.

 

Does it have to be a DIFFERENT script for each alias?

 

It can be the same script file. It is totally allowable to have multiple instances of the same script attached to different objects. Each one will run independently of the others.

 

It sounds as if you figured it out, but I wanted to reply directly to that question in case someone else comes along with the same query.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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