Forum Discussion

TriplisTrip's avatar
8 years ago

Autosolve for needs (trying to figure out how to reference it elsewhere)

What I essentially want is at the end of a (successful) interaction, the TargetSim queues up an interaction and goes and does it (in this particular case, I'm looking for queuing up Sleep, but there are others I'd like to get working as well).

I looked at the code for "Dare to Streak" and "Woohoo" and copied the general scheme of "continuation," but my problem seems to be that the interactions I'm choosing simply aren't the right ones (I did get one SI to work, Push Ups). I tried "generic_Bed_Sleep" as well as "energy-route-fail", but neither is actually doing anything. I also tried giving the continuation a target (Object), giving it no target code at all, and giving it "Invalid", like in Dare to Streak.

Ideally, what I want it to do is use whatever scheme the autosolve button does... which in the case of Energy, I assume looks around for places to sleep and picks something from what's available/nearest (or fails if there is nothing nearby). I can't seem to find any reference to it in the XML though. There's the autosolve failure ("energy-route-fail") but that doesn't seem to work, for one, and it looks like it's for when you fail to the point that autonomy does an auto-override and forces your sim to do something (not the same as clicking autosolve in the interface, which can be canceled). So maybe it's all scripting?
  • I think I figured out what my problem was. First, I can use the distress interaction. Second, the distress has a threshold for need level and I was testing on someone with Energy at nearly full. Thus, it wasn't triggering. So I need to make my interaction not even appear unless the threshold of the TargetSim is past the same point as the distress check. That way, it'll only show up as an option when it can actually do something.
  • @Triplis Could you elaborate on your solution? I think i am running against the same issue. Have created a supersocialinteraction which should continue in another affordance if the outcome is true. Have the supersocialinteraction working, but the continuation that should follow is not starting. Get the following error in the log which i cant make anything of.


    263d951f9dd4175395a74f630desyncea.maxis.sims4_64.15.pc2018-02-03 00:39:35Local.Unknown.Unknown.1.38.49.1020-1.200.000.320.Releaseprivacy.py:24463d951f9dd4175395a74f630Exception in Sim Timeline: Exception running Element (AttributeError: 'object_sitDiningSC_01' object has no attribute 'part_owner') Traceback (most recent call last): File "T:\InGame\Gameplay\Scripts\Server\scheduling.py", line 212, in simulate File "T:\InGame\Gameplay\Scripts\Server\elements.py", line 376, in _run File "T:\InGame\Gameplay\Scripts\Server\postures\transition_sequence.py", line 4854, in _execute_next_transition File "T:\InGame\Gameplay\Scripts\Server\postures\transition_sequence.py", line 4619, in _get_next_transition_info File "T:\InGame\Gameplay\Scripts\Server\interactions\base\interaction.py", line 284, in __init__ File "T:\InGame\Gameplay\Scripts\Server\interactions\privacy.py", line 244, in build_privacy AttributeError: 'object_sitDiningSC_01' object has no attribute 'part_owner'