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!
Test Subject
Original Poster
#1 Old 15th Feb 2017 at 10:50 PM
Default target non-household sims with console commands
A lot of sims 4 console commands, both vanilla and for mods, target the "active sim." This of course works well for any sim in your current household, but I find a lot of times I would like to target sims outside of the current household (say, to add a moodlet to a random townie, for example).

Does anyone know the best way to target them with console commands without either switching households or adding them to the household in order to select them as the active sim?
Advertisement
Test Subject
#2 Old 16th Feb 2017 at 5:23 PM
Quote: Originally posted by CircaV3
A lot of sims 4 console commands, both vanilla and for mods, target the "active sim." This of course works well for any sim in your current household, but I find a lot of times I would like to target sims outside of the current household (say, to add a moodlet to a random townie, for example).

Does anyone know the best way to target them with console commands without either switching households or adding them to the household in order to select them as the active sim?


Well, you could easily do it by just adding your own console commands and making those requests with a reference to a sim that you acquire by name or ID. It would be a pretty trivial mod to make if nobody has done it yet, assuming all you want is a console command.

I mean, I'm happy to publish something if truly nobody has done this already (I'm working right now--can't really be perusing mods).
Lab Assistant
#3 Old 16th Feb 2017 at 5:37 PM
You should get your desired results, if you know - and I'm sure you do - the sim's name (or should it be "the name of the sim"? whatever... ).

Open the console (shift+ctrl+c) and enter the following command:

sims.get_sim_id_by_name <simfirstname> <simlastname>

Many of the cheat commands commands can be used either with a sim ID or with first and last name and of course by selecting the sim.
See here for further commands and usage: https://www.reddit.com/r/sims4Cheats/wiki/index

Two quick examples ("stolen" from the wiki^^):
relationship.destroy yoursimID targetsimID
modifyrelationship Jim Bob Jill Smith 50 Friendship_Main
Test Subject
#4 Old 16th Feb 2017 at 5:59 PM
Ah, you might be right. You might be able to pass a Sim's name or ID into these as optional parameters. Been a while since I used them (and I've got to stop responding to this threads while working!).
Test Subject
Original Poster
#5 Old 16th Feb 2017 at 9:12 PM Last edited by CircaV3 : 16th Feb 2017 at 9:26 PM.
Quote: Originally posted by cypher27
You should get your desired results, if you know - and I'm sure you do - the sim's name (or should it be "the name of the sim"? whatever... ).

Open the console (shift+ctrl+c) and enter the following command:

sims.get_sim_id_by_name <simfirstname> <simlastname>

Many of the cheat commands commands can be used either with a sim ID or with first and last name and of course by selecting the sim.
See here for further commands and usage: https://www.reddit.com/r/sims4Cheats/wiki/index

Two quick examples ("stolen" from the wiki^^):
relationship.destroy yoursimID targetsimID
modifyrelationship Jim Bob Jill Smith 50 Friendship_Main


Unless I'm mistaken, sim ID and call-by-name are used pretty specifically, rather than interchangeably. So there are specific commands that use it, but for many other commands I haven't found a way to use that format. For example: something like adding a moodlet to a rando townie.... The command is "Sims.add_buff <buffType>" If there's a way to specify that to apply to a sim other than the active one, I haven't found it.
Test Subject
#6 Old 17th Feb 2017 at 12:52 AM Last edited by thewatcheruatu : 17th Feb 2017 at 1:03 AM.
Quote: Originally posted by CircaV3
Unless I'm mistaken, sim ID and call-by-name are used pretty specifically, rather than interchangeably. So there are specific commands that use it, but for many other commands I haven't found a way to use that format. For example: something like adding a moodlet to a rando townie.... The command is "Sims.add_buff <buffType>" If there's a way to specify that to apply to a sim other than the active one, I haven't found it.


No, cypher27 was completely right. I went and checked, even looking at the code files themselves. Almost all of these cheats include a parameter of the OptionalTargetParameter type...well, class actually. If you pass in a sim_id, it creates a class instance that these cheats use to retrieve the referenced Sim--falling back to the active Sim if it you didn't pass anything.

So in other words, you can do this:

sims.add_buff FlirtyHigh 810090617294426649

I don't think TwistedMexi bothered to explain that anywhere, hence the confusion. But almost all the cheats are like that except for the ones that are explicitly different.

It's two steps, of course, to get the ID by name and then send it to your cheat, but that would be easy enough to bundle together into a custom cheat for yourself.
Test Subject
Original Poster
#7 Old 17th Feb 2017 at 4:26 AM
Quote: Originally posted by thewatcheruatu
No, cypher27 was completely right. I went and checked, even looking at the code files themselves. Almost all of these cheats include a parameter of the OptionalTargetParameter type...well, class actually. If you pass in a sim_id, it creates a class instance that these cheats use to retrieve the referenced Sim--falling back to the active Sim if it you didn't pass anything.

So in other words, you can do this:

sims.add_buff FlirtyHigh 810090617294426649

I don't think TwistedMexi bothered to explain that anywhere, hence the confusion. But almost all the cheats are like that except for the ones that are explicitly different.

It's two steps, of course, to get the ID by name and then send it to your cheat, but that would be easy enough to bundle together into a custom cheat for yourself.


Oh, awesome! That's great news. Thanks fr checking that out for me. I don't know if I'm qualified to make a custom cheat yet, but hopefully I can at least find a way to copy and paste those lonnnnng IDs haha
Test Subject
#8 Old 17th Feb 2017 at 7:24 PM
Quote: Originally posted by CircaV3
Oh, awesome! That's great news. Thanks fr checking that out for me. I don't know if I'm qualified to make a custom cheat yet, but hopefully I can at least find a way to copy and paste those lonnnnng IDs haha


Yeah, I don't blame you. I looked into it a bit, and it's somewhat trickier than one would think.

Something I'm not sure everybody realizes is that you can use add_buff to give your Sim any of the available buffs--not just the ones mentioned on that wiki page. I mean, what's on the wiki does the trick for emotions, but just as an example:

sims.add_buff Buff_Trait_FeelingInspired
sims.add_buff Buff_Breathspray
sims.add_buff Buff_Drained

Whatever.

True, as well, for equip_trait (though the wiki already shows you a lot of them). Try this one, for example:

traits.equip_trait trait_isGrimReaper

Back to top