I've managed to make some progress with my script. Everything is working, but I'm getting some less than desirable results. First off here's the new script...
import services
import sims4.commands
import sims.sim_info
from server_commands.argument_helpers import OptionalTargetParam, get_optional_target, RequiredTargetParam, TunableInstanceParam, OptionalSimInfoParam
from sims.sim_info import SimInfo
@sims4.commands.Command('getphys', command_type=sims4.commands.CommandType.Live)
def getphysiques(first_name='', last_name='', sim_a_id:OptionalTargetParam=None, _connection=None):
physique_range = 1000
output = sims4.commands.CheatOutput(_connection)
output('Starting command for {} {}'.format(first_name, last_name))
sim_a_id = services.sim_info_manager().get_sim_info_by_name(first_name, last_name)
if sim_a_id is None:
output('Sim ID not found')
return False
#output('{} {} has sim id: {}'.format(first_name, last_name, sim_a_id.id))
if sim_a_id is not None:
physique =
if physique is None:
output = sims4.commands.CheatOutput(_connection)
output('Physique variable is still None')
return False
output('Current List: {}'.format(physique))
heavy = float(physique)*physique_range
lean = float(physique)*physique_range
fit = float(physique)*physique_range
bony = float(physique)*physique_range
pregnant = float(physique)*physique_range
hipswide = float(physique)*physique_range
hipsnarrow = float(physique)*physique_range
waistwide = float(physique)*physique_range
waistnarrow = float(physique)*physique_range
output('Physiques are: Heavy0: {} Fit1: {} Lean2: {} Bony3: {} Pregnant4: {} HipsWide5: {} HipsNarrow6: {} WaistWide7: {} WaistNarrow8: {}'.format(heavy, fit, lean, bony, pregnant, hipswide, hipsnarrow, waistwide, waistnarrow))
return True
output('Sim not targeted')
return False
@sims4.commands.Command('setphys', command_type=sims4.commands.CommandType.Live)
def setphysiques(first_name='', last_name='', bbt:int=0, newval:float=0, sim_a_id:OptionalTargetParam=None, _connection=None):
physique_range = 1000
output = sims4.commands.CheatOutput(_connection)
output('Starting command for {} {}'.format(first_name, last_name))
sim_a_id = services.sim_info_manager().get_sim_info_by_name(first_name, last_name)
if sim_a_id is None:
output('Sim ID not found')
return False
#output('{} {} has sim id: {}'.format(first_name, last_name, sim_a_id.id))
output('BBT Provided: {} New Value Provided: {}'.format(bbt, newval))
if sim_a_id is not None:
physique =
if physique is None:
output = sims4.commands.CheatOutput(_connection)
output('Physique variable is still None')
return False
output('Current List: {}'.format(physique))
physique = str(newval)
output('New Physique Value: {}'.format(physique))
physique = ','.join()
sim_a_id.physique = physique
output('New List: {}'.format(sim_a_id.physique))
return True
output('Sim not targeted')
return False
Now, what IS working...
It will successfully enumerate the Physique list from the referenced Sim and it will allow you to set almost all of the values.
And what's not working....
When you set any of the values they do not actually apply to the avatar. Is there another function I need to call to initiate the change to the avatar's shape?
For whatever reason the Pregnant physique appears to be read-only and will not allow you to set the value, or if it does something is change it back to zero immediately. Is there another value or script that controls the pregnant physique?
And lastly, the Hip and Waist physiques are never-ever populated, even if the figure has the hip or thigh dials moved from zero position. Are this physiques simply not used and there is yet another group of variable that hold the remaining CAS data?
I'm hoping to develop bodyshape editor mod at some point and this was the first test-case to see what is and isn't possible. Any insight into these questions would be most helpful!