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

Latest Site News

Nysha's New Creators for March - posted on 1st Apr 2018 at 9:00 AM
Replies: 1 (Who?), Viewed: 811 times.
Theorist
Original Poster
#1 Old 14th Dec 2017 at 3:59 AM
Default Playing With GSI Archives
I started playing around with the GSI archivers in the game, researching an idea I had for the SCAM mod. I ended up using the interaction_archiver and interaction_archiver_mixer archives from the GSI to allow SCAM to allow selecting recent (as opposed to just currently running) autonomous actions and it seems to be working quite well (fingers crossed).

I thought maybe folks might find it useful to have the module I was using to play around with the archivers, there is a lot of information available through them that other mod authors could use I think. Particularly things such as the mood log, interaction logs, perhaps the reset log. There's a host of others, many of which are full of gibberish to me, but YMMV if you're interested in that particular archive

Anyway, this is a souped up (and commented) version of the script I was using to play around with the interaction log. It lets you list, enable, disable, and dump the various archive logs to a text file. Even if you don't understand the Python code you'll want to look at the comments in the script code for information on using the commands and how they function. I'm not sure what features of the archives anyone will find useful, but if nothing else it is fun to play with!

For the advanced script modder, you could take a look at SCAM (my sources are always included in the mod) to see how I extended the schema for the interaction archivers and overrode the archiving method to include the new information that I needed (the guid64 of an interaction). Of course (hopefully it goes without saying), only one mod could possibly override the schema in this method.

*WARNING* - Some of the archivers accessible via this do not appear to function. These may require developer mode or debug mode enabled, or the hooks in the actions to be archived may have been removed or not been kept up to date with game patches. Some of these faulty archivers may cause the game to spew exception errors, lock up or possibly even crash the game. This is not the "proper" way to access the archivers, the proper way is through the modules in the gsi_handlers folder of the game scripts, I only implemented this for an easy way to play around with various archivers through simple cheat commands.

This is a loose uncompiled script, so you will need to have it in a Scripts subfolder inside a subfolder of the mods folder (if you just unRar the rar file to your mods folder it should work fine, the script will end up in Mods\GSI Playground\Scripts\gsi_playground.py and should work fine from there). Obviously script mods have to be turned on!

Enjoy, and please add to this thread if you learn anything interesting and useful from this.
Download - please read all instructions before downloading any files!
File Type: rar GSI Playground.rar (3.3 KB, 24 downloads) - View custom content
Advertisement
Theorist
Original Poster
#2 Old 16th Dec 2017 at 12:36 AM
Default Real World Example for XML Modders
I stated that these archivers should be useful for pure XML modders as well as script modders, and thought I'd see how useful it could be for the process of making a new XML mod.

I'm working on something involving drama nodes and eliminating the creepy phone calls adult Sims can get from children they've never met to have them come play with them. The first step was to eliminate the children calling unless they actually knew the adult Sim. But how could I know after doing so whether it was actually working properly, or if the random numbers just didn't come up and I'd have to wait a few more Sim days/weeks to see if the calls ever did come again? Simple! In the gsi.list results I could see there were two archivers associated with the drama nodes, and by doing a gsi.enable drama_scoring_archive and waiting for the next time the scheduling ran I could see the "before the mod" results, where some random unknown child scheduled a call to the adult Sim who'd never met anyone in a brand new game:
Code:
  ArchiveRecord #6786
    bucket = DramaNodeScoringBucket.DEFAULT
    nodes_to_schedule = 1
    timestamp = 1513298392
    object_id = None
    Chosen Nodes = [{'score': '9.900990099009901', 'score_details': 'Scoring : Enabled\nBase Score : 1000\nSender Sim Score : 0.009900990099009901\nReceiver Sim Score : 1\nFinal Score: 9.900990099009901 = 1000 * 0.009900990099009901 * 1', 'receiver': '', 'drama_node': "<class 'sims4.tuning.instances.dramaNode_NPCInvite_PlayDate'>", 'sender': ''}]
    zone_id = 0xfde06b5827a0aad
    uid = 6786
    Potential Nodes = [{'score': '9.900990099009901', 'score_details': 'Scoring : Enabled\nBase Score : 1000\nSender Sim Score : 0.009900990099009901\nReceiver Sim Score : 1\nFinal Score: 9.900990099009901 = 1000 * 0.009900990099009901 * 1', 'receiver': '', 'drama_node': "<class 'sims4.tuning.instances.dramaNode_NPCInvite_PlayDate'>", 'sender': ''}]
    game_time = 03:00:00.000 day:2 week:0
    Rejected Nodes = [{'sender': 'None', 'receiver': 'None', 'drama_node': "<class 'sims4.tuning.instances.dramaNode_NPCInvite_BirthdayParty'>", 'score': '0', 'score_details': '', 'reason': "Failed to setup drama node because it couldn't find a valid sender sim"}, {'sender': 'None', 'receiver': 'None', 'drama_node': "<class 'sims4.tuning.instances.dialogDramaNode_Phone_InviteNPCOver'>", 'score': '0', 'score_details': '', 'reason': "<class 'sims4.tuning.instances.dialogDramaNode_Phone_InviteNPCOver'> is on cooldown."}, {'sender': 'None', 'receiver': 'None', 'drama_node': "<class 'sims4.tuning.instances.dramaNode_NPCInvite_Date'>", 'score': '0', 'score_details': '', 'reason': "Failed to setup drama node because it couldn't find a valid sender sim"}]
    nodes_scheduled = 1

Note how the play date shows up in both the potential nodes and the chosen node (I cranked the multiplier up to 1000 to ensure it was likely to be chosen).

After inserting my mod to eliminate the call unless the Sim actually knew the child, the dramaNode_NPCInvite_PlayDate was clearly rejected from any consideration, as the log shows:
Code:
Rejected Nodes = [{'drama_node': "<class 'sims4.tuning.instances.dramaNode_NPCInvite_BirthdayParty'>", 'score_details': '', 'sender': 'None', 'score': '0', 'reason': "Failed to setup drama node because it couldn't find a valid sender sim", 'receiver': 'None'}, {'drama_node': "<class 'sims4.tuning.instances.dramaNode_NPCInvite_PlayDate'>", 'score_details': '', 'sender': 'None', 'score': '0', 'reason': 'Failed to setup drama node because receiver sim info ParticipantType.Actor does not pass the receiver sim pretests.', 'receiver': 'None'}, {'drama_node': "<class 'sims4.tuning.instances.dialogDramaNode_Phone_InviteNPCOver'>", 'score_details': '', 'sender': 'None', 'score': '0', 'reason': "Failed to setup drama node because it couldn't find a valid sender sim", 'receiver': 'None'}, {'drama_node': "<class 'sims4.tuning.instances.dramaNode_NPCInvite_Date'>", 'score_details': '', 'sender': 'None', 'score': '0', 'reason': "Failed to setup drama node because it couldn't find a valid sender sim", 'receiver': 'None'}]

The actual goal of the mod was for children to never call an adult Sim, only children or teens, that they had met - so I invented a new drama node that would allow grandparents, parents, uncles, etc. to get calls for play dates from child Sims. Then I created a brand new family, two brothers each with children, and then their mother and split those households up to see if the grandmother would get a call from her grandchild. It didn't work, and looking at the log I could see that although my new XML node was being considered (I was wondering if I'd need to add the new drama node to a list somewhere or something, but obviously not) it was rejected with the same result that no valid sender could be found.

Probably I needed to invert the family relationship bits, so instead of asking it to match family_grandparent, it should instead look for family_grandchild (since the actual filter is being run by the grandmother who is receiving the call). And after doing this, success! I could see my new Scumbumbo_dramaNode_NPCInvite_Relation_PlayDate drama node being selected:
Code:
    Chosen Nodes = [{'drama_node': "<class 'sims4.tuning.instances.Scumbumbo_dramaNode_NPCInvite_Relation_PlayDate'>", 'sender': '', 'score_details': 'Scoring : Enabled\nBase Score : 1000\nSender Sim Score : 0.6039603960396039\nReceiver Sim Score : 1\nFinal Score: 603.9603960396039 = 1000 * 0.6039603960396039 * 1', 'score': '603.9603960396039', 'receiver': ''}]
A similar test worked on both the cousin and uncle, so all that's left now is to clean up the drama nodes to no longer fire every day with a 1000 multiplier and package it up. Instead of having to run Sims through Sim-days or weeks of testing to see if the new drama node was going to work properly, I could see the results in mere minutes of work. I can have confidence that only children and teens who know the child requesting the play date will receive these calls, unless they are a family member in which case young adults, adults and elders can get the call.
Back to top