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!
Née whiterider
retired moderator
Original Poster
#1 Old 4th Sep 2017 at 10:35 PM
Default Mid-interaction controller swapping
I've been working on a branching career a la TS3, and I have everything working except for a promotion notification. I've run out of ideas and would be grateful for any suggestions.

The basic structure of the mod is this:
- A hook into the main function of career A runs a branch check
- If a sim is in the career, at work, eligible for promotion and in a branching level of the career, the user is presented with a chance card-style dialogue
- Picking option A triggers a promotion. Picking option B changes the sim's job GUID to that of career B and then triggers a promotion.
Career B has the same behaviour in reverse.

This all works as expected, except that if a user has selected to switch the sim from career A to career B, although the career is immediately switched over and the sim is left in the correct job, the promotion notification appears as if the sim's career had not been changed - it contains the text and hours from the appropriate level in career A.

The key to this issue appears to be the $JobTitle string substitutor. I don't fully understand how this one works - Inge has said that it "indexes into string table 800" but I can't find such a string table, and I'm not sure what's meant by "indexes into". Regardless, it always takes text from the STR#s of the current object. Because the at work interaction was initiated by career A, the current object is career A, so $JobTitle takes its text from career A's STR#s.

So far I've tried:
- Changing the object id of the sim's current interaction to an instance of career B - this succeeds but has no effect, so I suspect that ci: object id is descriptive only.
- Pushing an 'at work' interaction from career B onto the sim at maximum priority. This succeeds but does not stomp the current interaction. I may be able to force a stomp, but I'm not convinced this approach is a good one anyway, because I want to avoid either having the sim appear on the lot mid-transition, or losing useful data stored within the interaction tree.
- Overriding the semiglobal Sub - Level Change to pull the strings from the correct location - I can't work out how to call an object's private strings from another object, not convinced it's doable. Also would like to avoid global changes if possible.

If anyone has any suggestions of how I could get these approaches working, or of other approaches I could look into, I'd be grateful!

What I lack in decorum, I make up for with an absence of tact.
Advertisement
Scholar
#2 Old 5th Sep 2017 at 4:54 PM
I doubt it, while a sim is at work the sim is interacting with the career. You'd have to stop the current interaction and restart 'Interaction - At Work' with the new career. It may be plausible to add an exit in the 'Interaction - At Work' right after the chance cards if certain conditions are met leaving the sim off world but finding a way to interpret the conditions to 'short cut' to the same point (skipping leaving for work and not re-running the chance cards) in the new career would be tricky. It would be easier and safer to just write it as start the new career tomorrow.
Née whiterider
retired moderator
Original Poster
#3 Old 5th Sep 2017 at 10:11 PM Last edited by Nysha : 5th Sep 2017 at 10:29 PM.
I thought you might say that! I'm a bit dubious about modifying Interaction - At Work - for starters it's not detected by SimPE as a JobData semiglobal (though it is in the right group), so I don't know if overriding it privately would work properly; and the potential for conflicts with other mods would be high.

I'm considering moving my branch hook to before the hourly career processing and having it nuke the sim's job performance, and pass their sim ID back via temps, to then be used in a second hook after the hourly processing to create a "fake" promotion. I think my ideas on how to do that are realistic, I'm just considering how many locals I should declare for such an iterative mess.

I think all I'd need to do for a fake promotion would be
- Create a text
- Increase the sim's job level
- Pay a bonus
- Create memories
- Fulfill wants
But I hope anyone who spots anything I've missed points it out...

What I lack in decorum, I make up for with an absence of tact.
Scholar
#4 Old 6th Sep 2017 at 3:13 PM
Definitely overriding the 'Interaction - At Work' semiglobal will lose compatibility with a lot of mods and becomes very EP specific, it may be do-able to add a semi-global that could be 'run tree by name' in the other career to finish the current day with. That could be called at the end of the chance cards instead of 'At Work' and pass home time from the old career as a parameter. The sim just needs to idle until home time then control can come back to the original career for coming home. That would allow the sim to run another career without 'breaking out' of the current one.
Instructor
#5 Old 7th Sep 2017 at 3:14 AM
It really seems it would work and I'll be the first one to download it if/when you'll share it !

I believe in the "Thanks" button and its amazing powers !!!
Back to top