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 14th Nov 2019 at 7:13 AM
Trying to make the mailman deliver items ordered from a custom "order online" interaction
I am trying to make a mod that adds a custom "order ambrosia" interaction to allow you to order ambrosia online from a computer - for a hefty price of course.
Anyway, I'm having trouble getting it to actually get delivered.

In my attached file called "new computer xml.xml", on line 4 I have:
Code:
<V t="mailman_delivery" n="delivery_method" />


I do not get any errors from MCCC. If I order my item, it will take money from my household funds, correctly display the notification saying "it will be delivered" and then never gets delivered. I waited about 6 in game days but got nothing. I always order random stuff from other mods that add new ordering interactions and it works. I also tried waiting almost a week without ordering other stuff just to see and it still doesn't work.

If I change line 4 to:
Code:
<V t="purchase_to_inventory" n="delivery_method">
    <U n="purchase_to_inventory">
      <E n="participant_type">Actor</E>
    </U>
  </V>


then it puts the item in my inventory as soon as I do it without throwing any errors. This shows that everything else is working but I believe I'm lacking something somewhere.
My mod itself consists of a package file containing a single English localization STBL node, a single _XML node which is that PurchasePickerInteraction one that adds the interaction under the order menu as well as a simple ts4script that injects it into the affordance manager to allow the new order interaction to show up in the order menu.

So my question is: What else do I need in order to get the mailman delivery to actually work? Is there another xml node I should have somewhere? Is there something special I have to do with scripting? What do I have to do?

Are there any mods that do this that I can look at their contents and figure it out? I haven't been able to find any other mods that do this. The only two mods I know of that use this are WickedWhims and Basemental. WickedWhims is far too complicated to find where the custom computer order interaction script or xml nodes are but I did find the xml node for adding the custom purchasepickertinteraction in basemental. I have thoroughly studied the ts4script of basemental and spent hours browsing basemental's xml files but have not managed to find anything related to custom item delivery. It would be really nice if there was another mod that does this that I could look at.

I have attached the relevant files. If anyone has any advice, knows how to do this or even knows of some third mod that does this I could take apart to figure out how this works, I would be really grateful.

Edit: it turns out you can't just upload xml files so i'm just going to copy and paste my stuff here:
my xml file with the purchasePickerInteraction class


injector.py (part of my ts4script file)


obj_interaction_injector.py (also part of my ts4script file)

and then I put all this stuff in an attached zip file in case anyone finds it easier to download it.
Attached files:
File Type: zip  the stuff.zip (4.5 KB, 4 downloads) - View custom content
Advertisement
Test Subject
Original Poster
#2 Old 14th Nov 2019 at 7:46 AM
ok update I think I know what the problem could be. I took one of the mods that demonstrate this working correctly and then pasted the ambrosia id into the store list. It showed up, I ordered it and some other stuff but only the other stuff showed up.
After some additional digging, I discovered for that the items that get delivered in other mods that do this, all of the items have this key in their object definition:
Code:
<V n="inventory_item" t="enabled">
      <U n="enabled">
        <T n="inventory_only">False</T>
        <T n="can_place_in_world">False</T>
        <T n="skip_carry_pose">True</T>
        <T n="remove_from_npc_inventory">False</T>
        <L n="valid_inventory_types">
          <E>SIM</E>
          <E>MAILBOX</E>
          <E>STORAGE_CHEST</E>
        </L>
      </U>
    </V>


I doubt that ambrosia has is "allowed" to be stored in a mailbox. Unfortunately, since ambrosia is a base game item, you can't just simply edit the object definition at location to have the <E>MAILBOX</E> part in it because it's formatted in an entirely different way.

I am going to attempt changing the U# booleans and maybe one of them will be a mailbox allowed flag. If not, I will then compare the ambrosia object definition to that of another base game definition that has mailbox permissions and hope there is something in there I can paste into the ambrosia one.
Test Subject
Original Poster
#3 Old 14th Nov 2019 at 8:54 AM
I'd hate to be that guy that accidentally solves his own problem like right after posting but I, uh, seem to have figured it out.

Everything I had in the first place WAS correct. The problem turned out that the base game ambrosia isn't "allowed" to be placed in a mailbox which is why when I was ordering it, it wasn't being delivered.

While you can't edit base game object tuning definitions the same way you can with modded ones, there is an excellent tool called Sims 4 Tuning Tool that can convert base game definitions to functional xmls that can be used to override base game definitions. I used that to generate an ambrosia xml and I was then able to load it into my package to override the base ambrosia stuff.

It worked after that. I plan to upload this on the workshop after I do some more small things to it.
Back to top