Home | Download | Discussion | Help | Site Map | New Posts | Sign in

Latest Site News

Nysha's New Creators for February - posted on 1st Mar 2017 at 9:00 AM
Replies: 13 (Who?), Viewed: 871 times.
Test Subject
Original Poster
#1 Old 8th Mar 2017 at 8:10 PM
Default Adding a new motive / changing an existing one
I'm trying to wrap my head around how to research this. The idea itself is pretty clear: I want to figure out if it's possible to add a new motive/need and then only have that motive/need appear for certain life stage(s).

Sort of like how Vampires have special Thirst need that takes the place of Hunger.

Mind you, I'm not wanting to expand the number of Needs beyond 6. I want to add a motive/need that would replace one of the 6 under special circumstances.

I'm assuming it would involve some heavy-duty scripting, but I'm not sure where to begin in terms of figuring it out. Like what kind of injections might be required? Would it help me a lot to go through the process of creating a new interaction, or might that be something entirely different? (I'm probably going to anyway at some point, but I'm curious as to how informative it might be in relation to this) Or is it even possible, with what modders have so far figured out?
Advertisement
Test Subject
#2 Old 8th Mar 2017 at 9:36 PM
Quote:
Originally Posted by CardTaken
I'm trying to wrap my head around how to research this. The idea itself is pretty clear: I want to figure out if it's possible to add a new motive/need and then only have that motive/need appear for certain life stage(s).

Sort of like how Vampires have special Thirst need that takes the place of Hunger.

Mind you, I'm not wanting to expand the number of Needs beyond 6. I want to add a motive/need that would replace one of the 6 under special circumstances.

I'm assuming it would involve some heavy-duty scripting, but I'm not sure where to begin in terms of figuring it out. Like what kind of injections might be required? Would it help me a lot to go through the process of creating a new interaction, or might that be something entirely different? (I'm probably going to anyway at some point, but I'm curious as to how informative it might be in relation to this) Or is it even possible, with what modders have so far figured out?

This is kind of the area I've been looking at this week. I was trying to make the existing hidden Thirst statistic visible as a starting point. Haven't gotten very far. If you find anything useful, let us know.
Test Subject
Original Poster
#3 Old 8th Mar 2017 at 9:56 PM
Quote:
Originally Posted by roBurky
This is kind of the area I've been looking at this week. I was trying to make the existing hidden Thirst statistic visible as a starting point. Haven't gotten very far. If you find anything useful, let us know.

Thanks for chiming in. I'll share if I find out anything.
Test Subject
Original Poster
#4 Old 13th Mar 2017 at 3:03 AM
Quote:
Originally Posted by roBurky
This is kind of the area I've been looking at this week. I was trying to make the existing hidden Thirst statistic visible as a starting point. Haven't gotten very far. If you find anything useful, let us know.

I think you could probably make the existing Thirst statistic visible, provided you just want to replace the visibility of another (say, have it replace Hunger). I don't know if the UI can support more than 6. I imagine that'd require scripting.

What I can guess is you'd want to edit the Thirst XML and essentially copy/paste elements from a visible motive, like Hunger. Then you'd need to make a DATA file for Thirst, as it probably doesn't have one (I'm not sure if the game would recognize it or not... as long as you name it with the ID of the Thirst motive, it might).

To see if it will appear, you could then try it on a particular life stage, using the kind of code that the Toddler trait uses to block out Social and replace it with Attention:
Code:

  <L n="initial_commodities">
    <T>142037<!--Commodity: motive_Toddler_Attention--></T>
  </L>
  <L n="initial_commodities_blacklist">
    <T>16658<!--Commodity: motive_Social--></T>
  </L>


I'm guessing that would work, based on the things I've tried. Not 100% sure.

I tried to create a new statistic using Hunger as a template and have it appear where Hunger is for a particular life stage, but I can't get it to appear. So maybe I need scripting. I can't seem to find much on adding new statistics to the game; maybe I need scripts for the game to recognize them. Since the Thirst statistic already exists though, I don't think you'd run into the particular problem I'm running into.
Test Subject
#5 Old 13th Mar 2017 at 8:51 AM
I think motives for toddlers or vampires are defined in the file 'object_sim'
Test Subject
#6 Old 13th Mar 2017 at 5:02 PM
Quote:
Originally Posted by CardTaken
I think you could probably make the existing Thirst statistic visible, provided you just want to replace the visibility of another (say, have it replace Hunger). I don't know if the UI can support more than 6. I imagine that'd require scripting.

What I can guess is you'd want to edit the Thirst XML and essentially copy/paste elements from a visible motive, like Hunger. Then you'd need to make a DATA file for Thirst, as it probably doesn't have one (I'm not sure if the game would recognize it or not... as long as you name it with the ID of the Thirst motive, it might).

To see if it will appear, you could then try it on a particular life stage, using the kind of code that the Toddler trait uses to block out Social and replace it with Attention:

Thanks for adding some thoughts to what I was trying to do!
What I'd done so far was edit the hunger xml to make it non-visible, then try to make thirst visible in its slot, as a starting point. Thirst does have a data, and tagging thirst as visible in xml and data did nothing on its own. I copied over some of the states from hunger to thirst's xml, as the states appear to be responsible for determining the visuals of the needs bar, but I couldn't add them to the data file, because the data tool can't add new entries for things as far as I can tell, and thirst currently has no states. Running the game with the states in the xml but not the data caused the needs display to totally break, and I think the game chucked out a lastUIException report file as well.
Test Subject
Original Poster
#7 Old 13th Mar 2017 at 5:59 PM
Quote:
Originally Posted by konansock
I think motives for toddlers or vampires are defined in the file 'object_sim'

Thanks for the thought. I checked there, but couldn't find any reference to Attention.

Quote:
Originally Posted by roBurky
Thanks for adding some thoughts to what I was trying to do!
What I'd done so far was edit the hunger xml to make it non-visible, then try to make thirst visible in its slot, as a starting point. Thirst does have a data, and tagging thirst as visible in xml and data did nothing on its own. I copied over some of the states from hunger to thirst's xml, as the states appear to be responsible for determining the visuals of the needs bar, but I couldn't add them to the data file, because the data tool can't add new entries for things as far as I can tell, and thirst currently has no states. Running the game with the states in the xml but not the data caused the needs display to totally break, and I think the game chucked out a lastUIException report file as well.

No problem!

Hmm. My suggestion then would be to use the Hunger DATA file as a starting point for Thirst's DATA - save a copy of it under the same name as the Thirst DATA file and use that as an override. Then you'll want to change the STBL ID that determines what the name of the motive is in the UI. If the Thirst DATA file has an STBL file reference already, you could use that reference (or heck, use the STBL ID from the vampire Thirst need if necessary, since it's just an STBL line that says "Thirst." For the time being, just to get it visible, that's probably all you'd need to change in the Hunger DATA file to make it work for Thirst; later, you'd want to change the references to its description to match whatever you might change in the XML file - the parts that determine what it says when you hover over it. That sort of thing.
Test Subject
Original Poster
#8 Old 13th Mar 2017 at 8:20 PM
Just typing out some thoughts:

This problem I'm having with getting a new statistic to appear is really mystifying me. I looked into it further and realized files from the traits I made use a kind of commodities as part of the buffs (I missed this before because most of the code was generated by Mod Constructor for me). And that doesn't even touch scripting, so I don't think there should be anything in the way of the game recognizing a new commodity/statistic.

Which means my issue must be something else. But what, I can't fathom. With pretty much nothing but changes to the name and ID, I'm using a copy of both the Hunger XML and DATA file. It's set to be visible. It's got a UI sort order position. It's got a unique ID. And it's referenced in a Child trait override, which is set to blacklist the need in its UI sort order slot and put itself there. In-game, the blacklist works... the Child's existing need I want blacklisted doesn't appear. But the other, the one that is supposed to take its place, doesn't show up at all.

Maybe my problem is not to do with commodities. Maybe it's something to do with the Needs UI itself. That or I'm making some mundane detail error somewhere.
Test Subject
#9 Old 13th Mar 2017 at 9:46 PM Last edited by roBurky : 13th Mar 2017 at 9:57 PM.
Quote:
Originally Posted by CardTaken
Hmm. My suggestion then would be to use the Hunger DATA file as a starting point for Thirst's DATA - save a copy of it under the same name as the Thirst DATA file and use that as an override.

Yup, this worked! I didn't realise using another data file would be as simple as changing the file name - it even still has the 'motive_hunger' bit left in it. Thanks!

I don't know what's going wrong with your attempt either. You've covered everything I can think of.
Maybe confirm the statistic is actually present by giving each state an associated buff? That should work even if there's something going wrong displaying the need bar, right?
Test Subject
Original Poster
#10 Old 13th Mar 2017 at 11:08 PM
Quote:
Originally Posted by roBurky
Yup, this worked! I didn't realise using another data file would be as simple as changing the file name - it even still has the 'motive_hunger' bit left in it. Thanks!

I don't know what's going wrong with your attempt either. You've covered everything I can think of.
Maybe confirm the statistic is actually present by giving each state an associated buff? That should work even if there's something going wrong displaying the need bar, right?

Glad it worked! Yeah, I noticed that first when I was working out some special stuff for traits that Mod Constructor doesn't support and realized you could copy like that. Very handy thing to be able to do.

That sounds like a good idea, setting up a buff. I might try that. Thanks. And yeah, it does seem like in theory, it would confirm whether the statistic is being recognized by the game or not, thereby narrowing the problem down a little more.
Test Subject
Original Poster
#11 Old 15th Mar 2017 at 10:09 PM
So it turns out what I was doing was fine. It was just: https://www.youtube.com/watch?v=qLk81XnkGUM

I was doing this originally with less experience in creating unique IDs and I had mismatched or messed them up somehow. I got a new matched set in there, file name and 's' value, and it's showing up now.
Test Subject
#12 Old 15th Mar 2017 at 10:35 PM
Quote:
Originally Posted by CardTaken
So it turns out what I was doing was fine. It was just: https://www.youtube.com/watch?v=qLk81XnkGUM

I was doing this originally with less experience in creating unique IDs and I had mismatched or messed them up somehow. I got a new matched set in there, file name and 's' value, and it's showing up now.

Huzzah!

What's the process you went through to make IDs?
Test Subject
Original Poster
#13 Old 15th Mar 2017 at 11:51 PM
Quote:
Originally Posted by roBurky
Huzzah!

What's the process you went through to make IDs?

Basically, I use Mod Constructor to pretend like I'm making a trait and then after I export the package file, I open it up and steal the 's' ID from the trait and the unique part of its file name. Not the most straightforward or efficient method ever, but it's the method I'm familiar with at the moment.

It does, however, mean that if I steal only the 's' ID but not the unique part of the file name, or vice-versa, I can run into problems, which I'm pretty sure is what happened with this motive thing. Neia explained over on the sims forums that:
Quote:
the "s" value is the decimal conversion of the instance key (which is hexadecimal)

https://forums.thesims.com/en_US/di...omment_15616702

Which helped clue me in. I don't have all the terminology memorized, but I'm pretty sure he means that the 's' value is essentially a translated version of the unique part of the file ID. So even though they look like two completely different things, they are actually the same thing in two different forms. And I think in this particular case - for whatever reason I can't recall - I was using two different things in two different forms, instead of the same thing in two different forms.

A mundane detail, if ever there was one.
Test Subject
#14 Old 16th Mar 2017 at 12:16 AM
And now I'm very glad I asked!
Back to top