Forum Announcement, Click Here to Read More From EA_Cade.

Help needed please: adding extra item drops

I've been trying to replicate something a bit like dumpster diving in TS3. I have a big pile of junk that acts like a trash can, and my sims can go rummaging in it (I changed the text to say 'Scavenge'). I'd like to be able to add extra drops as a way for my sims to get extra things they need when they have little money, like a dirty version of a tent or a broken radio they could repair. However, I'm struggling to work out how the game controls drops, and what I need to do to add additional ones.

I've given my junk pile custom tunings, and I know the game is reading these because I can make other changes to these scripts and see the impact in game. One of these is the 'Loot_Rummage_Trash' tuning which contains the following script:

<V n="object_rewards" t="rewardsdata_tuning">
<U n="rewardsdata_tuning">
<T n="quantity">5</T>
<L n="reward_objects">
<U>
<L n="reward">
<T>12071<!--Soc_Solo_NT_Horrified_Succeed_basic--></T>
</L>
</U>
<U>
<L n="reward">
<T>26906<!--AL_Compliment--></T>
</L>
</U>
<U>
<L n="reward">
<T>28778</T>
</L>
</U>
<U>
<L n="reward">
<T>30598<!--object_Collectible_Fossil_Bird--></T>
</L>
</U>
<U>
<L n="reward">
<T>30527<!--musicTrack_Piano_Romantic_Low_02--></T>
</L>
</U>
<U>
<L n="reward">
<T>22678</T>
</L>
</U>
<U>
<L n="reward">
<T>30601<!--object_Collectible_Fossil_Alien--></T>
</L>
</U>

The numbers appear to be the object ids of the named item, but some things are dropping in game that don't appear to be on the list. And some of these objects never seem to drop. I'm confused! And I've tried adding a variety of my own objects, like the tent, but I seem to be missing something?

A little bit of direction would be appreciated @SimGuruModSquad? Thanks.

Comments

  • IngeJonesIngeJones Posts: 3,247 Member
    I think it picks between the sub-lists in a kind of random way, and you get all the items in one sub-list and/or all the items in another sub-list. If you want to always receive all the items in one go, have them all listed under one sublist and get rid of the other sublists. Then I guess change quantity to 1 as there will only be one group of objects? Not sure about that as I haven't tried it myself but it's what the tdesc appears to be saying
  • pboxpbox Posts: 630 Member
    Those numbers are the object definition of the item (i.e. the ID of the COBJ/OBJD). You can ignore what it says there in the comments -- that's just because that ID happens to be the same as some tuning ID (and XML Extractor is set up so that it will put the name of any tuning ID in the comments when it happens to match a reference).

    12071 for example is 0x2F27 = sculptTableFCRabbitCeramic_01_set1. You can find that out by searching Fullbuild0 for that ID (open Fullbuild0 in s4pe, put the ID in the "Instance" box at the bottom, tick the box in front, hit "Set", tick "Filter Active"). When you say "I've tried adding a variety of my own objects, like the tent", how exactly did you do that?

    You don't get all of the items in a list; you get the quantity that's defined in "quantity". You can weight between the items in the list by adding a "weight" tag.
    Stuff for TS2 · TS3 · TS4
  • IngeJonesIngeJones Posts: 3,247 Member
    Yes but there are sublists within the main list. The tdesc says the quantity refers to how many of the sublists you get. If you have 3 sublists and the sublists have 3 objects each, and you choose quantity 1, you will get three objects which are the contents of one sublist. Thats what the tdesc appears to be saying.
  • pboxpbox Posts: 630 Member
    Yeah if they had multiple objects in the same "reward" list. In the code they posted I don't see that though.
    Stuff for TS2 · TS3 · TS4
  • IngeJonesIngeJones Posts: 3,247 Member
    edited March 2016
    I have to say I found the weighting stuff hard to understand in the tdesc, I mean I know what weighting is but the description of exactly how to accomplish it looked a bit obfuscated.
  • CinderellimouseCinderellimouse Posts: 19,380 Member
    edited March 2016
    Thanks for responding @IngeJones and @pbox

    I see where I'm going wrong now, I was being extremely stupid and using the tuning IDs for the code. XD Sorry if I'm being very slow and not seeing the obvious, but where do I find the number for the object definition of the item? I can see that 'sculptTableFCRabbitCeramic_01_set' has '0x2F27' as its instance when I look at its object definition, but I can't figure out how to get from there to '12071'.

    Edit: I got it! I convert the instance id from hexadecimal to decimal?

    I'm only planning on having there be one drop at a time, I just left the existing items in there for now while I'm figuring things out. So I'll be changing the line '<T n="quantity">5</T>' back to 1. I only increased that while I was testing. It seems to be giving me 5 random items from across the list each time, not 5 of a single item.
    Post edited by Cinderellimouse on
  • CinderellimouseCinderellimouse Posts: 19,380 Member
    Whoop! It worked! Thank you both for your help. <3

  • pboxpbox Posts: 630 Member
    Edit: I got it! I convert the instance id from hexadecimal to decimal?

    Yes exactly. In the tuning that is given in decimal; in s4pe you see the instance in hexadecimal. It's the same number.
    I'm only planning on having there be one drop at a time, I just left the existing items in there for now while I'm figuring things out. So I'll be changing the line '<T n="quantity">5</T>' back to 1. I only increased that while I was testing. It seems to be giving me 5 random items from across the list each time, not 5 of a single item.

    Yeah that's how it should work with the code you posted. Seems like everything is fine then =).

    If you need to figure out the object (not tuning) IDs of specific items you want, this post lists various ways to do that.
    Stuff for TS2 · TS3 · TS4
  • CinderellimouseCinderellimouse Posts: 19,380 Member
    Thank you again! I used to use S3pe all the time but I'm not as confident with S4pe for some reason, which is weird because they're quite similar. I think maybe I don't have it set up properly, so I need to sit down one day and have a good look at it. I've bookmarked the link, thanks! I'm excited to continue working on this mod now, it'll be really helpful to my game.

    Do you happen to know if it's possible to specify a broken state of an object? So instead of a sink, they get a broken sink?
  • pboxpbox Posts: 630 Member
    In general, yes you can apply states to reward objects. Look for "states_on_reward_object" both in the tuning description ( = exact description of how that works) and your XML folder ( = examples how it is being used in game). You would need to look at the sink tuning to see what exactly the states on that are named (I guess something with "broken").
    Stuff for TS2 · TS3 · TS4
  • CinderellimouseCinderellimouse Posts: 19,380 Member
    Fab, thank you! I have plenty to get my teeth into now. ^__^
  • pboxpbox Posts: 630 Member
    Ok cool. =) Also, if you run into problems/questions with how to use s4pe it would be helpful if you could post here: http://modthesims.info/showthread.php?t=573292 -- I've put together an inline help for the next version, and ideally that should explain all the basics. But it's easily possible that something isn't as obvious as one thinks when having used it for so long .. so if there's anything that took you some time to figure out, I could include that in the help text.
    Stuff for TS2 · TS3 · TS4
Sign In or Register to comment.
Return to top