PDA

View Full Version : Dynamic Pie Menu Interactions - Can I do it like this?


Consort
19th May 2012, 10:18 PM
I have been curious how this could be done, so I read the EA code for the fridge and Buzzler's Order Food mod. But guys, seriously? This shit is way over my head!

I hacked together my own simplicistic proof of concept, but honestly... still over my head.

This script adds "Test $int" interactions to all sims. On click it displays a notification with the $int.

http://paste.ubuntu.com/996444/
(excuse the messiness, this is my testbed-mod)

Most of the code is just boilerplate stuff to get the mod running. The interesting bits are basically AddInteractions (with the for-loop) and the actual interaction "ConsortTest".


I have a few questions:
-Is it safe to do it like this?
-How would I remove those interactions?
-Definition is nested inside ConsortTest. When I make a "new Definition()", does that also create a new instance of ConsortTest?
- I'm a bit puzzled about the role of Singleton. I understand this as some sort of handle to access the instance. Now, when I trigger the sim.RemoveInteractionByType(ConsortTest.Singleton) function, it removes my interactions one by one, beginning with 0. I don't understand why it would do that.