Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Lab Assistant
Original Poster
#1 Old 9th Jul 2015 at 4:43 AM
Default Adding Interactions to Objects
I've found a bunch of information on adding interactions to objects but it doesn't tend to really explain the process and it leaves enough holes that I am lost and confused.

Is there a tutorial of some sort that takes you through the XML, the python and the string of some simple object interaction anywhere?

"Whatcha doin'?"
"Probing your mind."
"Kinda roomy, innit?"
Advertisement
Pettifogging Legalist!
retired moderator
#2 Old 9th Jul 2015 at 10:54 PM
Do you mean

- add an existing interaction to an existing object?
- add a custom interaction to an existing object?
- add an existing interaction to a custom object?
- add a custom interaction to a custom object?

In all cases the interactions are listed in the Super Affordances list, at the end of the object tuning. For basic XML tuning see the walkthrough in Tutorials (Coding category). For custom objects you can simply plunk the ID in there and it will be available (unless there are other restrictions, like posture requirements or filters). For existing objects, you can either override the object tuning with a version that contains the additional interaction (this is the simplest way, and should be OK particularly when it’s just for your own use), or append to the Super Affordances list/s by way of scripting. See the “Adding Interactions” sticky in this forum.

What do you mean by “the string of some simple object interaction”? What exactly are you trying to acheive, can you be a bit more specific?

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Lab Assistant
Original Poster
#3 Old 9th Jul 2015 at 11:26 PM
Umm, I currently have two things I want to do, both are adding interactions to a computer

First one is I want to add a banking mod:
  1. Click on Computer
  2. Banking
  3. Open Account
  4. Account Name
  5. Click on Computer
  6. Banking
  7. Desposit Funds
  8. Which account?
  9. How much?
  10. Click Computer
  11. Banking
  12. Withdraw Funds
  13. Which account?
  14. This account has $#, withdraw funds?

That one is a big goal though, so I'm working up to it with this:
  1. Click on Computer
  2. Writing...
  3. Write Fanfiction
  4. Check for Fanfiction Reviews (if you've published some before)
  5. Read fanfiction

I'm hoping to then add strings of... if you've published fanfiction before ("write fanfiction") then checking for reviews will give you a moodlet depending on your writing skill? So low skill will say something like, "Embarrassed! A sim left a review saying Sim's fanfiction was terrible!" and good skill might be, "Confident! Someone really liked Sim's fanfiction; it got posted on a rec site!" or "Happy! Sim's latest posting has over eighty reviews! Whoa!"

And reading fanfiction can give you a random moodlet like, "Oh no, that was so sad!"

That's what I want to do.

"Whatcha doin'?"
"Probing your mind."
"Kinda roomy, innit?"
Pettifogging Legalist!
retired moderator
#4 Old 10th Jul 2015 at 12:08 AM
Well for a start, you could look at the Write Fanfiction part, I think that should be relatively straightforward particularly when you don't want a craftable (i.e. an actual book). Have you looked at how the existing interactions work? Like writing letters and trolling the forums and so on? I'd copy one that is similar to what you want and start from there. Have you read the Maxian documentation?

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Deceased
#5 Old 11th Jul 2015 at 8:50 AM
The banking mod could pose some difficulties if you want the money to be available to all households. Since the households don't share information, you'd need the script (and this mod would require scripting) to store the account balances in a separate file or database. If you only want the account available to the current household, then you could likely use a commodity statistic on the computer to store the fund information.

Another idea would be instead of using the computer, make a credit card type object that a sim could keep in their inventory and put the interactions on that instead (or even make it work with the ATMs, although it wouldn't have any neat animations - some modders are working on custom animations but I don't think that nut's been cracked quite yet). The card could then be given to other sims for them to use to withdraw funds and the amount stored as a statistic on that card object.
Lab Assistant
Original Poster
#6 Old 12th Jul 2015 at 7:16 AM
@plasticbox I've gone through it, but I'm not very good with technical documentation, never have been. Most of it just goes in one eye and out the other. I want to learn but I just can't get my head around it.

@scumbumbo Oh I love both those ideas! A card and the ATM would both be lovely.

"Whatcha doin'?"
"Probing your mind."
"Kinda roomy, innit?"
Pettifogging Legalist!
retired moderator
#7 Old 12th Jul 2015 at 11:36 AM
Well if you can't learn from reading things, what do you expect from this forum?

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Lab Assistant
Original Poster
#8 Old 13th Jul 2015 at 10:44 PM
Quote: Originally posted by plasticbox
Well if you can't learn from reading things, what do you expect from this forum?


Technical documentation and a conversation is a lot different in my experience, but it's all good. I'll figure it out. Thanks for the help putting me on the right track.

"Whatcha doin'?"
"Probing your mind."
"Kinda roomy, innit?"
Pettifogging Legalist!
retired moderator
#9 Old 13th Jul 2015 at 11:06 PM
I can see what you mean but nobody will re-read the docs to you from A to Z.

I would suggest you try to get started with something small, like renaming an existing interaction, or copy one and make it into a custom (additional) "Write Fanfiction" interaction, and when you get stuck post your code here + ask specifically what you need to know in order to proceed.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Lab Assistant
Original Poster
#10 Old 14th Jul 2015 at 7:52 AM
All right, thank you. I already renamed the string, I figured that out through tutorials etc. The thing that has me stumped right now - which I honestly believe I can figure out given time - is how to write the XML up for the Python to link into

I'm not looking for the docs to be read to me from A-Z, I promise.

I learn best by doing, I just sometimes need to be told how to get started.

I'm gonna do what you suggested, thank you awfully.

"Whatcha doin'?"
"Probing your mind."
"Kinda roomy, innit?"
Pettifogging Legalist!
retired moderator
#11 Old 14th Jul 2015 at 7:59 AM
Well if you look at the existing writing interactions, you'll see there are mainly two sorts: crafting interactions that produce a book, and simpler ones that do not produce anything -- like writing letters which improves a relationship, or Practice Writing which improves your skill. Since writing fan fiction would presumably also improve that skill, I'd probably start by copying that. See if you understand all of it .. if you already know how custom strings work it shouldn't be hard for you to rename it, so that it shows in the pie menu with your title.

(If you want your fanfiction to be an actual thing, like a book, then you'd need one of the crafting interactions though. Those are a little bit more complex because they all have staging and picker dialogues and so on. So I probably wouldn't start with that -- I'd just make a simple one first, so that there is something you can use for the script you are making)

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Lab Assistant
Original Poster
#12 Old 14th Jul 2015 at 9:15 AM
Excellent, I'll definitely start there. Thank you so much for your help.

(Nah! No need for books, I don't really want an E.L. James sim...)

"Whatcha doin'?"
"Probing your mind."
"Kinda roomy, innit?"
Back to top