Creating an NRaas project Question about replacing interactions

Talk nerdy to us here.
Post Reply
icarus_allsorts
Reactions:
Posts: 213
Joined: March 8th, 2012, 6:00 pm

Question about replacing interactions

Post by icarus_allsorts » February 14th, 2014, 7:45 am

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?

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7597
Joined: December 30th, 2011, 6:00 pm
Answers: 81
Contact:

Post by Chain_Reaction » February 15th, 2014, 3:28 am

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

Post by icarus_allsorts » February 15th, 2014, 3:59 am

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?

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7597
Joined: December 30th, 2011, 6:00 pm
Answers: 81
Contact:

Post by Chain_Reaction » February 17th, 2014, 12:08 am

That is correct :)

Post Reply