31st Jul 2020 at 3:03 AM
Last edited by bees123 : 31st Jul 2020 at 3:37 AM.
Finding a Sim's Relationship Bit's Target in Python?
I'm trying to add a buff to the TargetSim of the Actor's custom RelationshipBit, but I can't get my head round the decompiled Python code. Anyone know a way to do this?
My only progress so far is a command to print an output if the Actor sim has the relbit in the first place:
rel_tracker = sim_info.relationship_tracker
manager = services.get_instance_manager(Types.RELATIONSHIP_BIT)
relbit = manager.get(1234)
for bit in rel_tracker.get_all_bits():
if bit == relbit:
Nevermind, I think I found a way! This loops through every sim the Actor knows and checks if they have a relationship bit with them, then prints both names if it does exist. Also if I add the bit to another Sim with another Target, that isn't returned which is exactly what I was hoping for!
for target in rel_tracker.get_target_sim_infos():
if target.relationship_tracker.has_bit(sim_info.sim_id, relbit):
output(str(target.first_name + " " + target.last_name))
output(str(sim_info.first_name + " " + sim_info.last_name))