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 31st Jul 2020 at 2:03 AM Last edited by bees123 : 31st Jul 2020 at 2:37 AM.
Default Finding a Sim's Relationship Bit's Target in Python?
Howdy,

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:
Code:
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:
            output("test") 
Advertisement
Test Subject
Original Poster
#2 Old 31st Jul 2020 at 3:04 AM
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!

Code:
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))
Back to top