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!
Test Subject
Original Poster
#1 Old 16th Aug 2016 at 3:46 PM
Default Adding a cost to interactions
I'm pretty much a total noob when it comes to modding anything beyond xml tuning or changing strings. I've been trying to learn the basics of script modding to help me puzzle it out on my own, but I'm getting nowhere.

Basically, my main goal is to make my sims' lives harder (always my goal) by making babies/toddlers more financially draining. I'd like to find some way to add an automatic deduction from the family funds whenever a baby or toddler is fed with a bottle, and whenever a diaper is changed (similar to 'pay bills'). I assume that doing this would involve changing the interactions themselves, which is why I thought of scripting.

Like I said, my modding experience is limited to loading up game files in S3PE and either tuning values, string tables, or copy and pasting code that someone else has come up with. I did make an attempt I was sure would work, involving adding a line of code that added a 'value' to the 'give bottle' interaction. Needless to say, it didn't work. It did nothing, actually. My game ignored it completely

If anyone could point me in the right direction, that would be awesome! I'd really like to expand my modding skills because every time I play I think of some other way I'd like to torture my sims :D
Advertisement
Instructor
#2 Old 16th Aug 2016 at 10:29 PM
This is would be a pretty cool thing to have in the game.

It's probably going to be a scripting mod. Start by looking at the "Getting Started" portion of this tutorial to load up the game's libraries and use Reflector (or ILSpy or dnSpy) to inspect the interactions you want to modify. Prior knowledge of C# is useful.

Good luck!
Mad Poster
#3 Old 17th Aug 2016 at 6:02 AM
You could look into how this mod is structured:

http://modthesims.info/d/529758
Instructor
#4 Old 17th Aug 2016 at 11:12 AM
First, you need to look at how an interaction is done in script, go to the tutorials section.
You will want to do this, in its very simple form: (but I'm not so sure about Sim actions though, never worked with them)
- Have an interaction inheriting the baby bottle feed interaction
- Just override the
Code:
public override bool Run()

And in it just add a line of code, adding deduction of money (for this line of code, one line presumably, see the one jje1000 suggested. Don't follow that mod for anything else. It is not related to interactions at all)
- Then put
Code:
bool flag = base.Run()
return flag; 

(Something like that, becuase I'm giving you this by memory. Not sure if you have to put any params into base.Run() part)

That's all
Instructor
#5 Old 17th Aug 2016 at 11:15 AM
And btw just one thing: would you mind me implementing this mod? Credit given to your idea? For sure you might want to try it yourself too haha )
Test Subject
Original Poster
#6 Old 17th Aug 2016 at 3:26 PM
Quote: Originally posted by SimsMatthew
And btw just one thing: would you mind me implementing this mod? Credit given to your idea? For sure you might want to try it yourself too haha )


Go for it! I don't know any programming languages, so I'm starting from the ground up here and it will probably take a while even with all the very helpful tips I've gotten so far. Besides, I'm better at learning and understanding by taking things apart to see how they're made :P
Instructor
#7 Old 18th Aug 2016 at 10:33 AM
Hahaha I don't guarantee I will finish it although I'll try to finish it while my interest is still there (because apparently my time and enthusiasm for The Sims 3 is not growing at all...) But thanks! It's like I want to start with something *relatively* simpler as I haven't been coding for a long time! And... want to feel more "successful" by trying on a small project! ) Thanks, I just hope that I don't appear to be stealing ideas...
Instructor
#8 Old 24th Aug 2016 at 4:16 AM
Sorry took me so long but I'm afraid that I'm coming back with bad news
Wit the fact that those interactions are social interactions in mind, they are harder to implement and probably require Social Data XMLs even if they are inherited from the base interactions

Look for @Arsil for help
Back to top