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

Latest Site News

Nysha's New Creators for July - posted on 1st Aug 2018 at 9:00 AM
Replies: 2 (Who?), Viewed: 265 times.
Test Subject
Original Poster
#1 Old 7th Aug 2018 at 2:32 AM
Default Scripting: finding data
Newbie to modding here, working on a script to output some information about sims to a file. I've kinda sorta got the scripting figured out, what I'm having trouble with is figuring out how to get at the data. I've been able to find a few things, like first and last name and age, and get them written to the output file. But I'm stuck there.

I've looked at a few scripts by other modders, I've looked through the Maxis documentation. I've got the EA files downloaded and have tried searching across them with Notepad++, looking for strings like "household" or "career." (Yay, 12000+ search results!) My previous coding experience was with relational databases, so I was approaching it like "find the table that cross-references sims and careers." And...that's not how it works.

Can anyone give me any tips on how you all find data for your scripts? Is there some technique or resource that I'm missing?


TIA,
Lynne
Advertisement
Theorist
#2 Old 7th Aug 2018 at 4:43 AM
Quote:
Originally Posted by LynneM
Newbie to modding here, working on a script to output some information about sims to a file. I've kinda sorta got the scripting figured out, what I'm having trouble with is figuring out how to get at the data. I've been able to find a few things, like first and last name and age, and get them written to the output file. But I'm stuck there.

Can anyone give me any tips on how you all find data for your scripts? Is there some technique or resource that I'm missing?


Depending on what you are looking for, both The Inspector and D3OI have always been extremely helpful for me. Sometimes it's useful to just override one of the functions in one of the game's classes and add lines to log to the logger (see Sims Log Enabler to dump some of the data you want to see, particularly using inspect.getmembers on variables that store a class instance, something like this:

Code:
import inspect
for k,v in inspect.getmembers(whatever):
    logger.debug('{}={}', k, v)


You can learn a lot from dumping all the variables in some of those classes.

I've actually written a tool I call SLOB (Sims Live Object Browser) that I use a LOT lately, but it's fairly buggy still - it's a Windows application that connects to a game script via a named pipe and allows you to search for objects in the game, decompile functions and modules, all sorts of crud. I've often thought of releasing it as a work-in-progress as I still find it very useful with all it's bugs, but I kind of got tired hacking at it to make it "perfect". It really needs some copy/paste functions, maybe print to PDF, etc. (on the Windows app side of it) and quite a number of bug fixes (primarily to the script portion). Anyway, there's a screenshot attached to this message that kind of shows the things you can view with it.

If folks are interested in seeing a "you downloaded it, you bought it / use at your own risk / unsupported" release of SLOB with no promises for further features, just yell I guess. The Windows app portion is written in VB .Net so it is of course Windows only.
Screenshots
Test Subject
Original Poster
#3 Old 8th Aug 2018 at 1:55 AM
This is hugely helpful....thanks so much! I'll give the Inspector and D30I and Sims Log Enabler a try, and yes, I would love to try SLOB as well. Now I'm going to have to check out the Modding Tools board and see what other goodies can be found over there!
Back to top