Am working on a non-NRaas mod atm which overrides a few default EA interactions. To replace the interactions, I used the "(Old interaction).Singleton = (New Interaction).Singleton" method and I have them all in my Instantitator's OnWorldLoadFinished, which works for replacing all the interactions I want replaced with mine, EXCEPT just one (the default Fridge_EatLeftovers interaction) where the original interaction is the one that shows up on the object (Fridges) when I check using DebugEnabler's Test Menu Interactions.
I really can't figure out the reason why, but explicitly removing the default interaction and then injecting my new one does work, and so does tacking Fridge_EatLeftovers.Singleton = (My new interaction).Singleton into OnPreLoad (where I copied Twallan's method of injecting EA's interaction tunings into my interactions) instead of OnWorldLoadFinished. But now seeing that the last method works, I wonder if it's safe to just chuck ALL the "(Old interaction).Singleton = (New Interaction).Singleton"s into OnPreLoad and do away with OnWorldLoadFinished altogether?
Creating an NRaas project Question about replacing interactions
- icarus_allsorts
- Reactions:
- Posts: 213
- Joined: March 8th, 2012, 6:00 pm
- Chain_Reaction
- Site Admin
- Reactions:
- Posts: 7597
- Joined: December 30th, 2011, 6:00 pm
- Contact:
Twallan's mods all use OnPreLoad so I would do the same. Some objects have their scripting class saved in the town file. That's why you have to buy new objects for their scripting class to update. OnPreLoad ensures it gets overwritten regardless of what is saved because the interaction is wiped before the object is read from the town file.
- icarus_allsorts
- Reactions:
- Posts: 213
- Joined: March 8th, 2012, 6:00 pm
Thanks for the explanation, that does explain the mystery. Turns out I didn't need to override that particular interaction after all, but just in case I'll shift all the other overriding methods into OnPreLoad. I'm assuming to add interactions to existing objects would still need to be done in OnWorldLoadFinished though?
- Chain_Reaction
- Site Admin
- Reactions:
- Posts: 7597
- Joined: December 30th, 2011, 6:00 pm
- Contact: