Replies: 2 (Who?), Viewed: 1907 times.
Lab Assistant
Original Poster
#1 Old 25th Jun 2015 at 12:29 AM
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, or Visit my Simblr for questions, comments, requests, or just a quick "hi" - I don't bite. If you need to contact me for anything, do so.
Requests
Valid Requests: CAS recolors, Build/Buy Mode recolors, houses or rooms, and simple script mods.
Advertisement
Deceased
#2 Old 25th Jun 2015 at 6: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 3:29 PM Last edited by simalary44 : 25th Jun 2015 at 4: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, or Visit my Simblr for questions, comments, requests, or just a quick "hi" - I don't bite. If you need to contact me for anything, do so.
Requests
Valid Requests: CAS recolors, Build/Buy Mode recolors, houses or rooms, and simple script mods.
Back to top