Forum Discussion

DrRabidMonkey's avatar
11 years ago

Custom Interactions to Python

So I've been starting with modifying the maslow Python script to create my own mod using various commands, and it's going pretty darn well!

But I'd like to connect this to an interaction, and ideally pass the Sim in doing so. At the moment the script just iterates through every Sim and makes changes or displays information - I'd like it to only be the Sim I clicked on and preferably do so without needing to iterate all Sims looking for is_selected etc.

So what links the interaction XML to the Python function?
What arguments does the Python function get sent? Any particular parameters I need to set?

(Sorry if these seem like stupid questions, I'm new to it, and could really use a push in the right direction, even if it's just "read this").
  • So I think I've worked out 90% of this and how it should be done by re-reading the custom content guide, game XML, TDESC files, and reading decompiled Python.

    I'm fairly confident I can make a new interaction (XML + PYO + STBL) and the applicable test conditions to see whether or not to make it available. But the one question I still have is: how does the game know I want it to appear as a pie menu option for each sim?

    Once again just looking for a pointer in the right direction, I don't expect any hand holding - I'm hoping someone is just like 'oh duh, use group id xxxx' etc etc because it'll save me a lot of time.
  • I haven't actually done this myself, but I believe one way it works is adding it to the _super_affordances in object_sim tuning. (As per this: http://www.modthesims.info/showthread.php?t=536464) Since there could only ever be one mod like that, there's been discussion about how to better do this. I suspect adding it to the super affordances of sims via python script will be the way to go.
  • I had noticed the super affordances XML, but as I couldn't extend it without overwriting I didn't consider it an option.

    I'll target my time in to looking at how to append the super affordances in Python - at least until someone beats me to it. Thanks for the link and feedback - both were quite helpful.