7 years ago
Pulling Statistics from Game to Text File
Good evening,
I'm working on a mod that would pull the stats found in the Simology panel and dump them to a text file outside the game. I've got everything (I think) besides actually pulling the stats for a given sim. Here's my code so far (thank you to Scumbumbo for the code I worked from, it was a huge help):
My question is, where can I find the command on how to actually pull the stats? I've looked through the EA python code, but haven't been able to find anything, even in the statistics folder. It probably has something to do with info.get_statistics, but I don't know how to get all the statistics or where to find a list of all the names of the stats.
Hope that makes sense - I would love any feedback you have.
I'm working on a mod that would pull the stats found in the Simology panel and dump them to a text file outside the game. I've got everything (I think) besides actually pulling the stats for a given sim. Here's my code so far (thank you to Scumbumbo for the code I worked from, it was a huge help):
import sims4.commands
import services
def get_siminfo_by_name(fname, lname, output, _connection):
if fname is not None:
info = services.sim_info_manager().get_sim_info_by_name(fname, lname)
if info is None:
output("Error: Sim {} {} not found".format(fname, lname))
return None
else:
tgt_client = services.client_manager().get(_connection)
if tgt_client is not None:
info = tgt_client.active_sim.sim_info
else:
output("Error: no active sim targeted")
return None
return info
@sims4.commands.Command('challenge.view', command_type=sims4.commands.CommandType.Live)
def challenge_view(fname=None, lname=None, _connection=None):
output = sims4.commands.CheatOutput(_connection)
if fname is not None and lname is None:
output("usage: challenge.view ")
return False
info = get_siminfo_by_name(fname, lname, output, _connection)
if info is None:
return False
My question is, where can I find the command on how to actually pull the stats? I've looked through the EA python code, but haven't been able to find anything, even in the statistics folder. It probably has something to do with info.get_statistics, but I don't know how to get all the statistics or where to find a list of all the names of the stats.
Hope that makes sense - I would love any feedback you have.