Saerileth Posted June 5, 2013 Posted June 5, 2013 Just a quick question for curiosity's sake, and because I can't seem to find any information about this on the Wiki or anywhere else, really. I noticed that you can add multiple scripts to references (or base objects) in the creation kit, not just one. What exactly does this do? Are all of them used? Do they supercede each other? If both scripts have an onActivate() method, which one is called, and in which order? It'd be really helpful if someone could clear this up.
Sjogga Posted June 6, 2013 Posted June 6, 2013 Every script in the list are called. There are no priorities that I know of.
BotOwned Posted June 6, 2013 Posted June 6, 2013 (edited) Just a quick question for curiosity's sake, and because I can't seem to find any information about this on the Wiki or anywhere else, really. I noticed that you can add multiple scripts to references (or base objects) in the creation kit, not just one. What exactly does this do? Are all of them used? Do they supercede each other? If both scripts have an onActivate() method, which one is called, and in which order? It'd be really helpful if someone could clear this up. Just adding to what Sjogga has already said, all events will fire in all the attached scripts so if you have two scripts that both have a onActivate() event both will fire and both will run independently. so think of it this way / Script1.OnActivate() /Form \ \Script2.OnActivate() While both Scripts can see and work with the Form they don't see each other, generally speaking. Edited June 6, 2013 by BotOwned
Saerileth Posted June 6, 2013 Author Posted June 6, 2013 That makes sense, thanks for clearing that up! :)
Recommended Posts