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!
Lab Assistant
Original Poster
#1 Old 24th Jun 2015 at 11:29 PM
Default -- Command To Show Sim Details --
Hi guys, I'm trying to make a command that shows Sim details. Either by the current active Sim, or if a name is specified.

Code:
@sims4.commands.Command('sim.aboutsim', 'sim.about', command_type=sims4.commands.CommandType.Live)
def simalary_AboutSim(first_name='', last_name='', _connection=None):
    output = sims4.commands.CheatOutput(_connection)
    if first_name == '' and last_name == '':
        tgt_client = services.client_manager().get(_connection)
        info = tgt_client.active_sim.sim_info
        if info is None:
            output('No Sim is selected.')
            return False
    else:
        info = services.sim_info_manager().get_sim_info_by_name(first_name, last_name)
        if info is None:
            output('No Sim with the provided name has been found.')
            return False
    output('SIM INFO: First name: {}. Last name: {}. Age: {}.'.format(sim_info.first_name, sim_info.last_name, sim_info.age))
    return True


But for some reason, the cheat doesn't show anything/do anything. I copied my sim.SetAge cheat, just modified what is shows, but it doesn't work. Is there something I'm missing or doing wrong? Thanks, Sim

Simalary Studios

Contact Me
Send me a PM, if you need to contact me for anything.
Advertisement
Deceased
#2 Old 25th Jun 2015 at 5:20 AM
Hey, simple oversight - you got the sim_info object into a variable called "info", but you're trying to output the results of sim_info.xxxxxx. Either change info -> sim_info or vice versa in the script.
Lab Assistant
Original Poster
#3 Old 25th Jun 2015 at 2:29 PM Last edited by simalary44 : 25th Jun 2015 at 3:34 PM.
Quote: Originally posted by scumbumbo
Hey, simple oversight - you got the sim_info object into a variable called "info", but you're trying to output the results of sim_info.xxxxxx. Either change info -> sim_info or vice versa in the script.


Ok, thanks scumbumbo, I knew it was something simple I was too dumb to figure out haha. I'll test it out to see what happens.

EDIT: Thanks @scumbumbo, it works. I am now just changing the code a little because of how the game formats ages when it displays.

Simalary Studios

Contact Me
Send me a PM, if you need to contact me for anything.
Back to top