Re: [NEEDS SAVES] [SE] Sim with Workaholic Lifestyle causing LEs when clicked on

by crinrict
Reply

Original Post

Accepted Solution

[FIXED] [SE] Sim with Workaholic Lifestyle causing LEs when clicked on

[ Edited ]
★ Guide

Product: The Sims 4
Platform:PC
Which language are you playing the game in? English
How often does the bug occur? Often (50% - 99%)
What is your current game version number? 1.82.99
What expansions, game packs, and stuff packs do you have installed? All of them
Steps: How can we find the bug ourselves? This seems to happen when a Sim has the workaholic lifestyle and any career where a Sim must schedule gigs. I know, for example, that if I give someone the lifestyle and have their job be a freelancer of some kind (such as a freelance writer) I get the error if I click on my Sim and they do not have a gig scheduled. It may happen with other career-like things, such as university, but I have not personally tested if it does.
What happens when the bug occurs? If you have some error catching mod, you get an error pop up. If not, the interaction for going to work off-hours won't show up. Funnily enough, the "proper" behaviour for this would be it not showing up, so someone mod-free or on console may not even notice this, apart from potential lag. It doesn't seem to reset the Sim when playing completely vanilla, but it does happen every time the Sim is clicked on, and error logging can cause a lot of lag. It may also cause lag in displaying the menu buttons themselves.
What do you expect to see? In general, it's nice not to have exceptions thrown in the game. This is from an oversight in the code, so even if this particular exception is more annoying than detrimental, fixing the error could have beneficial elsewhere, and is possibly even related to other errors that take a similar form.
Have you installed any customization with the game, e.g. Custom Content or Mods? Not now. I've removed them.
Did this issue appear after a specific patch or change you made to your system? Yes
Please describe the patch or change you made. I believe that this bug has been around since the release of the Snowy Escape patch. Going back through the search on our support server, I see that earliest game version this happening on was 1.74.

 

Attached is the LE I get when having a Sim with the workaholic lifestyle be in a career with gigs but not have anything upcoming scheduled. Note that I did click on the Sim about 4 or 5 times just too see if anything happened, it's not quite this spammy itself, but also note this will happen any time the Sim is clicked on and the conditions of no current scheduled gigs hold, so people could conceivably have 30+ instances of this error in a few minutes.

 

On a technical level, this error occurs because of a design flaw in the CareerTimeUntilWorkTestFactory test, specifically the do_test method. The way that it is designed currently, it checks for the time before the next scheduled shift of all careers a Sim has are, in hours. The problem is that for careers that use gigs, when there is no scheduled gig, this cannot be done.

 

def do_test(self, subjects, career_id, tooltip):
        for subject in subjects:
            if self.check_all_careers:
                careers_to_check = subject.careers.values()
                if not careers_to_check:
                    return TestResult(False, '{} does not have any career to check if there is time to work.', subject)
            else:
                this_career = subject.careers.get(career_id)
                if this_career is None:
                    return TestResult(False, '{0} does not have the career needed for this interaction: {1}:{2}', subject, self.career, self.hours_till_work)
                careers_to_check = (
                 this_career,)
            for career in careers_to_check:
                hours = None
                if career.is_work_time:
                    elapsed = career.start_time - services.time_service().sim_now
                    hours = elapsed.in_hours()
                    if hours < self.hours_till_work.lower_bound:
                        hours = None
                if hours is None:
      # THIS IS THE LINE WITH THE ERROR
      # THE PROBLEM IS THAT FOR SOME CAREERS SUCH AS THE FREELANCE CAREERS
             # THIS METHOD WILL RETURN (None, None, None) WHEN THERE'S NO CURRENT WORK SCHEDULE
             # AND THUS IT YOU CANNOT GET A TIME SPAN SINCE IT'S NONE
                    time_span, _, _ = career.get_next_work_time()
                    hours = time_span.in_hours()
                if self.hours_till_work.lower_bound <= hours <= self.hours_till_work.upper_bound:
                    continue
                return TestResultNumeric(False, '{0} does not currently have the correct hours till work in career ({1},{2}) required to pass this test', subject,
                  career, (self.hours_till_work), current_value=hours,
                  goal_value=(self.hours_till_work.lower_bound),
                  is_money=False,
                  tooltip=tooltip)

        return TestResult.TRUE
def get_next_work_time(self, offset_time=None, check_if_can_go_now=False, consider_skipped_shifts=True):
        work_scheduler = self._get_work_scheduler()
        if work_scheduler is None:
            return (None, None, None)
        now = services.time_service().sim_now
        if offset_time:
            now += offset_time
        (best_time, work_data_list) = work_scheduler.time_until_next_scheduled_event(now, schedule_immediate=check_if_can_go_now)
        work_data = work_data_list[0]
        start_time = now + best_time
        if consider_skipped_shifts:
            if self.requested_day_off:
                valid_start_time = start_time + TimeSpan.ONE
            else:
                valid_start_time = self.get_valid_first_work_day_time()
            if start_time < valid_start_time:
                (best_time, work_data_list) = work_scheduler.time_until_next_scheduled_event(valid_start_time, schedule_immediate=False)
                best_time += valid_start_time - now
                work_data = work_data_list[0]
                start_time = now + best_time
        end_time = now.time_of_next_week_time(work_data.end_time)
        return (best_time, start_time, end_time)

Based off the TDESCs on how this test should return (false, if any career a Sim has does not meet the criteria specified in the test & testing for multiple careers), simply testing if time_span is None and returning something to the effect of TestResult(False, '{0} does not currently have any upcoming gigs scheduled') should suffice.

 

The consequences of fixing this may be far reaching, as the workaholic "go to work off-hours" interaction is undoubtedly not the only place this test is present in the game, and ANY place this test is, if it is not career-specific, is subject to this same issue.

 

Good news is that fixing this with a Python wrapper in the interim shouldn't be too hard, and I do believe that I have done so.

 

Edit By Crinrict: Added Tag to Title

Attachment
Download this attachment
Message 1 of 8 (2,499 Views)

Accepted Solution

Re: [NEEDS SAVES] [SE] Sim with Workaholic Lifestyle causing LEs when clicked on

★ Guide

As of game patch 1.90 I can confirm both in testing and in code that this bug should be fixed.

View in thread

Message 7 of 8 (1,193 Views)

All Replies

Re: Sim with Workaholic Lifestyle causing LEs when clicked on

[ Edited ]
★★★★★ Guide

I had this error occur AND I had a gig scheduled (interior designer career, uses gigs not work hours), so it also occurs outside the lack of scheduled gigs when in a gig type job.

 

The error/issue (workaholic lifestyle on interior designer/gig type job career with sim continually getting "go to work"/"go to work outside of work hours") started happening after it got past midnight (12am) on the day the gig was scheduled.

 

I deleted the lifestyle from that sim to get rid of the issue, but I shouldn't have to do that.

Message 2 of 8 (2,467 Views)

Re: [SE] Sim with Workaholic Lifestyle causing LEs when clicked on

Community Manager (retired)

Can anyone experiencing this issue possibly share a save file where you've seen it occur? You can DM me the link to your save, thanks so much!

 

Instructions for sharing your save: http://answers.ea.com/t5/The-Sims-4-Bug-Reports/INFORMATION-How-to-Send-User-Files-to-The-Sims-4-Tea...


This account is no longer accepting Direct Messages. If you need to send a Direct Message, please send it to TheSimsDirect. Thank you.

Message 3 of 8 (2,246 Views)

Re: [SE] Sim with Workaholic Lifestyle causing LEs when clicked on

★★ Novice

I tried to DM you but I got a weird error about not being logged in or not having permission, I'm trying to send my save file because I am also having this issue. Be warned I do have lots of mods on my save. 

Message 4 of 8 (2,107 Views)
0

Re: [NEEDS SAVES] [SE] Sim with Workaholic Lifestyle causing LEs when clicked on

★★★★★ Apprentice

This pops up whenever I click on my workaholic Sim.

Message 5 of 8 (1,692 Views)
0

Re: [NEEDS SAVES] [SE] Sim with Workaholic Lifestyle causing LEs when clicked on

★★ Apprentice

I have been getting this exception regardless of career. Been playing one save for a few months now and creating new sims for scenarios. My current household is one sim with the secret agent career. She is a workaholic and this exception pops at least two or more times every sim day. 

Message 6 of 8 (1,434 Views)
0

Re: [NEEDS SAVES] [SE] Sim with Workaholic Lifestyle causing LEs when clicked on

★ Guide

As of game patch 1.90 I can confirm both in testing and in code that this bug should be fixed.

Message 7 of 8 (1,194 Views)

Re: [NEEDS SAVES] [SE] Sim with Workaholic Lifestyle causing LEs when clicked on

Hero
@leroidetout Thank you. I'm going to lock this thread then.

Feel free to make a new one if it resurfaces.

Good Luck
Crin

Trennlinie

I don't work or have any association with EA. I give advice to the best of my knowledge and cannot be held responsible for any damage done to your computer/game.
Please only contact me via PM when asked to do so.



Important Threads


Message 8 of 8 (1,173 Views)
0