Custom Active Careers

Talk nerdy to us here.
User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7617
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Custom Active Careers

Post by Chain_Reaction » May 22nd, 2021, 10:21 pm

zoeoe wrote:
May 22nd, 2021, 10:54 am
I thought it would be the GetInteractionToTakeSimToJobLocation() function but it seems that it's for taking sims to and from jobs and doesn't include the regular carpool
It looks like it's GetInteractionToTakeSimToWork. It's overrided under ActiveCareer which I assume your career derives from.

It appears setting the <Required_In_Office>x</Required_In_Office> tuning under your LevelStaticData and then it will push the VisitCommunityLot interaction automatically assuming you have ActiveCareerLotID set properly. And I assume you have CarpoolLotEndLocation set properly since the car does teleport there but just making sure.

zoeoe
Reactions:
Posts: 15
Joined: September 27th, 2020, 6:46 am

Custom Active Careers

Post by zoeoe » May 23rd, 2021, 10:52 am

Hey thanks for your reply!
So I do have <Required_In_Office>x</Required_In_Office> set for the levels, and it seems that ActiveCareerLotID isn't overrided with the firefighter career, so I guess that means it should already be setting automatically?
I'm going to override the interaction and see if the VisitLot interaction thingy is being set properly.

Thanks for your help!

edit: Okay so I did that, and I had a debug message just before the interaction instance is set to VisitCommunity lot, and the message showed up if I clicked on the GoToWork button, not when the sim was in the car. So that must mean that ActiveCareerLotID is set correctly but it doesn't seem to help with this carpool thing but I'll put some more debug messages in to see if something is going wrong earlier in the function
...which I did and I'm not getting any notifications when the sim is in the car, they only show up when I use the GoToWork button. So my overrided method isn't being called at all by the carpool

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7617
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Custom Active Careers

Post by Chain_Reaction » May 24th, 2021, 12:46 am

Are you deriving your class from ActiveCareer or ActiveFirefighter? Try just ActiveCareer if you're not using that. Are you overriding GetInteractionToTakeSimToWork? Try that as well if EA is being a pain though ideally that shouldn't be needed.

zoeoe
Reactions:
Posts: 15
Joined: September 27th, 2020, 6:46 am

Custom Active Careers

Post by zoeoe » May 24th, 2021, 7:59 am

Yep I was deriving from ActiveCareer, just using the firefighter as a guide as it's the only one with a carpool.

Oops I said interaction instead of method earlier, but that's indeed what I did - I didn't change anything codewise, just added debug messages at different points throughout to see when it was being called, but I only got those messages when I used the GoToWork Button.
When the carpool came and the sim was called to sit inside it, there wasn't a debug notification at all which means the method isn't being triggered at all by this carpool arriving, as I had a debug message right at the beginning :/

zoeoe
Reactions:
Posts: 15
Joined: September 27th, 2020, 6:46 am

Custom Active Careers

Post by zoeoe » May 25th, 2021, 8:45 am

Just want to add that before I was wrong when I said that the visit community lot interaction only works in the carpool when I'm sending my sim to work.
If I send my sim to another location, the carpool will still take my sim to the work lot, and then the sim will make her own way to the lot she's visiting after.

I'm not sure what this means but thought it was worth mentioning in case it helps figure out where it's going wrong.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7617
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Custom Active Careers

Post by Chain_Reaction » May 25th, 2021, 10:36 pm

How are you scheduling the carpool? Via Careers.Occupation.ScheduleCarpool?

What world is this? Is it safe to assume other cars can drive to this lot just fine from your home lot? Cause from the code it looks like it will teleport if it's unable to calculate street parking in front of the lot.

zoeoe
Reactions:
Posts: 15
Joined: September 27th, 2020, 6:46 am

Custom Active Careers

Post by zoeoe » May 26th, 2021, 6:35 am

Originally I overrided the ScheduleCarpool when it wasn't showing up at all to figure out what was going wrong, but I have since removed that, to just use the base one and the same thing happens.

I have been testing in a custom world, but this also happened in Sunset Valley. It's definitely not a problem with routing/parking spots because when the sim is in the car, and I direct it to the work lot (or any lot for that matter) the car will drive with my sim to the work lot and drop her off there. It only seems to teleport when I don't push the interaction, and my sim is kicked out the car when there is no further interaction for her to go to a lot.

I think the issue is more that for whatever reason GetInteractionToTakeSimToWork() isn't being triggered when the sim is in the carpool, at least if that's what's supposed to happen. The sim is automatically pushed to get in the carpool, but after that there is no automatic VisitLot interaction being pushed, and the function isn't even being called there because I don't get a debug message at all :(

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7617
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Custom Active Careers

Post by Chain_Reaction » May 27th, 2021, 4:22 am

This is getting puzzling. I did find something interesting that may be it though. We'll hope.

...Do you have OnArrivedDelegate StartWorking overwritten? If you notice, it calls StartWorking which has a VisitCommunityLot push in it for the firefighter. Not sure if you're missing that. You'd think that's called after the car arrives at the lot by "arrived" but from a glance I'm not 100% sure about that.

zoeoe
Reactions:
Posts: 15
Joined: September 27th, 2020, 6:46 am

Custom Active Careers

Post by zoeoe » May 27th, 2021, 11:45 am

Beautiful! Yes it works now thanks! I wouldn't have thought that was the missing piece because of the way it's named, super weird, but yep that did the trick - the car comes on schedule and takes my sim to work :D

I really appreciate your help and hope I won't bother you too much with questions I will no doubt have in the future :P

Post Reply