Forum Discussion

tastytourist's avatar
11 years ago

How/where would I find a particular console command in the game files?

I was attempting to try some very basic scripting, namely making shortcuts for some of those RSI-inducing in-game commands. I was thinking this should work along the lines of defining a new command named "mo" and having that execute the actual bb.moveobjects command, for example.

But now I'm already stuck because all the examples I looked at are using commands that I can find in the game scripts (like set_clock_speed in clock.pyo.py), however that moveobjects one I can not find. =/ Same problem with the unlocking stuff ones.

Am I making this too complicated? Is there some other way of defining aliases? The way I understood it, one would have to do that when defining the command in Python, but maybe I'm misunderstanding ..

Also, does the "plunking loose files in /unpackedmod" thing still work?

27 Replies

Replies have been turned off for this discussion
  • @sims4.commands.Command('name1', 'name2', ...)


    That was exactly what I tried =D but that did not work, the result was "invalid command" or "unable to" or something along those lines (in the console output) .. I didn't take a screenshot of the exact wording, but I can try again and post one.

    My code was

    @sims4.commands.Command('t', 'd', 'debug', command_type=sims4.commands.CommandType.Live)
    def testing(enable:bool=None, _connection=None):
    output = sims4.commands.CheatOutput(_connection)
    if enable is not None:
    if enable:
    command = 'testingcheats on'
    sims4.commands.client_cheat(command, _connection)
    else:
    command = 'testingcheats off'
    sims4.commands.client_cheat(command, _connection)
    else:
    output("You need to turn this on or off with 't', 'true', 'on', '1', 'yes', 'y', 'enable' or 'f', 'false', 'off', '0', 'no', 'n', 'disable'")


    I was wondering whether the aliases perhaps need to be in an array or something?
  • So these are the replies I get:

    http://www.modyourpanties.com/hosting/63140_141221135535output.jpg

    What I entered was, in order:

    testingcheats on // to verify this is actually the correct command
    testingcheats off // to verify this is actually the correct command
    t // works as expected: outputs the else option, telling me about explicit en/disabling
    t 1 // tries to pass the correct command apparently, but .. fails?
    t on // tries to pass the correct command apparently, but .. fails?

    same with t true, t 0 etc .. d and debug yield no resonse at all.

    Weird becuase this is the exact same code as with headlineeffects, and it is working when I only say

    @sims4.commands.Command('t', command_type=sims4.commands.CommandType.Live)


    in the first line .. so the problem is the aliases, I take it.
  • SimGuruEugi's avatar
    SimGuruEugi
    Icon for EA Staff (Retired) rankEA Staff (Retired)
    11 years ago
    I don't have the code nor the game itself with me right now, and I won't until January, so I can't try this out myself. There are a few shipped commands that use aliases... I would try finding some of those and see if/how they work.

    Also, try to prepend a | to the command when entering it in the cheat window and see if that works.
  • Okay. Thank you anyway! (Particularly as this sounds like you're not even actually working right now .. your help is much appreciated! =)
  • Hah, I got the aliases to work!

    I dunno what made the difference -- that I changed the type to Automation or that I prepended the vertical bar thing to the string I'm passing on, but it's now doing what I wanted.


    @sims4.commands.Command('t', 'd', 'debug', command_type=sims4.commands.CommandType.Automation)
    def pb_testing(enable:bool=None, _connection=None):
    output = sims4.commands.CheatOutput(_connection)
    if enable is not None:
    if enable:
    command = '|testingcheats on'
    sims4.commands.client_cheat(command, _connection)
    else:
    command = '|testingcheats off'
    sims4.commands.client_cheat(command, _connection)
    else:
    output("You need to turn this on or off with 't', 'true', 'on', '1', 'yes', 'y', 'enable' or 'f', 'false', 'off', '0', 'no', 'n', 'disable'")



    I guess it might have something to do with testingcheats being defined in Python while headlineeffects is not .. ?
  • SimGuruEugi's avatar
    SimGuruEugi
    Icon for EA Staff (Retired) rankEA Staff (Retired)
    11 years ago
    "pbox;13086335" wrote:

    I guess it might have something to do with testingcheats being defined in Python while headlineeffects is not .. ?


    That's correct.

About The Sims 4 Mods & Custom Content

Find expert tips, troubleshooting help, tutorials for mods and custom content, and The Sims 4 patch files in our forum.15,596 PostsLatest Activity: 7 days ago