PDA

View Full Version : Add Interest and Skills and Different Fun Levels


Phaenoh
16th Dec 2008, 10:13 PM
I've created some custom schools for children and I'd like to make going to them add interest, both the regular interest and the FreeTime Hobby interests. Anyone know how to go about this?

Some of them I'd also like to build skills, again how?

Secondly I'd like to make these different schools give a different amount of fun to the children based on their personality. How would this be accomplished?

Thanks!

leefish
16th Dec 2008, 10:22 PM
You could try taking a look at Inges custom school mods over at simlogical.

Inge Jones
17th Dec 2008, 9:04 AM
No, Phaenoh is asking about something that schools do not have at this time, so mine won't help. The currect effect BCONs only affect motives.

Probably the easiest way without having to hack the school semiglobals and therefore begin to clash with all sorts of other work is to add it to one of the CTs in the school package - so they get an instant hit to the interests and enthusiasm for the day rather than an amount per hour.

Phaenoh
17th Dec 2008, 5:29 PM
Sounds good, how do I go about that? BHAVs are NOT my strong suit.

Inge Jones
18th Dec 2008, 8:49 AM
Each school has "CT - dress for school" which runs each time they get ready to go to school. That is the one you can count on running every time, so that seems a good place to add it.

Interests and enthusiasms are stored in Persondata, and you can use the BHAV wizard to help you find those - it will be an Opcode 0x02 you need, if as I suggest you are going to do a direct incrementation.

Echo has a tutorial for beginners for editing BHAVs, so that might help you if you are not confident with those. Here: http://nene.modthesims2.com/showthread.php?t=142907

tunaisafish
20th Dec 2008, 4:22 AM
I would advise against editing the enthusiasm bars directly.
Instead use global 0x0621 Enthusiasm - Boost (Absolute).

The reason for this is that there are triggers as sims pass certain levels that enable the rewards (hobby mag, club card, plaque, LTA).
There are also 10+ tokens that you would have to deal with correctly.

I've documented the enthusiasm system here (http://www.moreawesomethanyou.com/smf/index.php/topic,13458.0.html), including the params you need to pass to the global.

You can edit the interest values directly without causing any problems so long as you also check the limits. They may not stick for long though in an unmodded FT game.
My Enthusiasm Overhaul mod (see sig) will help with the random interest loss.

Phaenoh
4th Sep 2011, 4:39 AM
I'm looking at making different schools for kids. I want the different schools to be more or less fun for the kids based on their personality. How do I do that? A test for personality and adjusting the Fun BCON? I don't really know what/how. I do know that serious sims prefer reading a book than they do watching tv, but I don't know what to do with that info.

The other thing I'd like to do is if the user has FreeTime installed I'd like these schools to add Hobby Enthusiasm. Is it possible to stick this all in a BG compatible package; ignore it all if no FT and run the hobby stuff if it is installed? How do you make stuff effect Hobby Enthusiasm?

Cyjon
14th Sep 2011, 6:12 AM
For adjustments to Fun, look in JobDataSchoolGlobals at "Sub - Start Motive Deltas". Rather than just directly assigning the value from the constant to My Decay Fun per Day, read it and multiply it by whatever factor you come up with and assign the result to Decay Fun Per Day. For example a really easy way would be to multiply by Playful/500 which gives 0% fun decay for super serious sims and 200% fun decay for super playful sims. Note that personality ranges 0-1000, not 0-10 like we see in the game. Make sure when you are multiplying and dividing no value ever goes over 65535 because that's the largest value these variables can hold.

For enthusiasm, use global BHAVs "Enthusiasm - Start" and "Enthusiasm - End", just be sure to set the rate very low since school lasts so long. A better option might be to use "Enthusiasm - Boost (Absolute)" to just give a one-time boost, say when the kid leaves or comes home, rather than an ongoing boost all day.

Then all you have to do is add a check of global variable x14 (Game Flags) to see if flag xE is set (that's FreeTime). You can look in global "Expansion Pack - EP(param) Installed?" to see how that works. However don't use that BHAV if you want to be BG-compatible because EA was apparently surprised by the fact Sims 2 had expansion packs and didn't include an EP check in base game (insert eye-rolling here). Just check the flag directly. If it's set, do the hobby stuff. If not, skip over it.

Phaenoh
15th Sep 2011, 2:26 AM
How would I multiply it by Playful? Is there a BHAV that does that? That sounds exactly like what I need. Do you know of any examples I can look at?

I was reading up on something about Enthusiasm by Tunaisfish over on MATY and it sounds like the Boost Absolute doesn't do things like add Hobby Lot cards appropriately, and that the Start and Stop ones are the better option. Do you know anything about that?

As for the EP check, is there anything that asks not if a certain EP is installed, but asks instead if its the original version? If I ran a check for that first and found out there was an EP installed, I could then check for FT, and wouldn't that technically work in Base because it wouldn't get to the EP check code if its just Base.

Cyjon
15th Sep 2011, 4:08 AM
You just multiply it. Since "me" is the sim in this context, then playful is my person data Personality Playful (x05). So instead of what's there now (My Decay Fun per Day := Const 0x1014:[Temp 0x0000]") you'd do something like:

Local 0 := My Personality Playful (which is "my person data x05" and will be in the range 0-1000)
Local 0 /= x0A (divide by 10 to reduce the range 0-100 which will prevent overflow in the next step)
Local 0 *= Const 0x1014:[Temp 0x0000] (the normal fun decay, which is 300 for public school and 200 for private)
Local 0 /= x32 (divide by 50 to give a final range of 0-600 for public school or 0-400 for private)
My Decay Fun Per Day := Local 0

Note that rather than dividing by 500 I divided by 10 and then 50. If I'd divided by 500 right away, you'd multiply fun by 0, 1 or 2 which isn't much variation. If I hadn't divided at all, Local 0 would have overflowed during multiplication and given nonsensical information.

I was going to refer you to Tunaisafish's hobby enthusiasm thread but I didn't have the address right offhand. I hadn't realized that about boost. As I said, the only concern with continuous enthusiasm is if you set the hobby rate too high, the kids max out hobbies on the first day of school, so you'll need to set it very low.

As for the EP check, yes and no. Technically the correct way to check for EPs is to first see if global variable x14 is equal to x7D0. If it is, that's base game. If not, you check flags or use the crappy built-in EP check which just checks flags so isn't really any better than checking them yourself.

The reason you check for x7D0 first is that falsely indicates the presence of FFS, Pets, Seasons, Celebrations, H&M and Bon Voyage. However since it doesn't falsely indicate FT, and you care whether the user specifically has FT and not "FT or later", you can just bypass the 7D0 check and look at the flag itself. The point is you can bypass the built-in EP check.

If you want to see a convoluted EP check you can go to my site and look at Smarter EP Check. That shows all the annoying manipulation to check for SPs, plus the unique problems introduced by IKEA and Apartment Life. But that's overkill for what you are trying to do here.

Phaenoh
15th Sep 2011, 4:29 AM
Thank you! This all looks pretty much doable to me now! Still confusing, but I imagine all that will sort itself out once I'm actually look in the packages. Thanks! :)

Phaenoh
16th Sep 2011, 5:50 AM
Lol, I basically asked the exact same question 3 years ago. At least now I can make more sense of it. http://www.modthesims.info/showthread.php?t=311326&highlight=hobby+enthusiasm And this is useful as well. http://www.snootysims.com/infoindex.php?id=hobbies

Cyjon
17th Sep 2011, 4:33 AM
Well, at least you admit when you do something silly :)

Incidentally, I like your "make a difference" link. I have something similar on the donate page on my site.

Phaenoh
18th Sep 2011, 9:14 PM
Well, 'admitting it' was the easiest way to link the two help threads together, each gives slightly different perspectives on it.

Glad you like my link ;) So far no one has done anything with it, but being able to track that as well is nice.

Phaenoh
21st Sep 2011, 6:33 PM
Woohoo! That worked perfectly, except now I've run into a problem. There are only opcode options for the positive versions of the personalities. How do I make something fun for them the meaner or sloppier they are?

Mootilda
21st Sep 2011, 6:38 PM
Can't you pass a negative parameter?

Phaenoh
21st Sep 2011, 6:47 PM
I'm not seeing a way of doing that... ?

Mootilda
21st Sep 2011, 7:11 PM
I'd have to know the exact BHAV, but if you pass a parameter with the first bit set to 1 (ie 0x8xxx to 0xFxxx), then the game may interpret it as a negative number, depending upon whether the game believes that it is a signed or unsigned value.

Possibly the easiest way to see this is in SimPE. You can choose to have numbers displayed as signed or unsigned decimal, or hex. Take a look at the signed decimal for a hex value with the top bit set.

If you want to change a WORD from positive to negative, you could multiply by -1 (0xFFFF). For example:
Local 0 *= 0xFFFF

Phaenoh
21st Sep 2011, 10:36 PM
Its not that I want a negative number, rather, Grouchy <--> Nice is on a 1 <-->10 type scale. So, having something that is better for grouchy has a number like 1 or 2, not a negative number. Maybe instead, for the bad end I can just subtract the number from 10 and multiply by that... Like 10 (full) - 2 (grouchy) = 8 and multiply by that... Cyjon showed me that I can multiply by a constant number, so I suppose I can subtract as well.

x3e8 -= Local 0 is what I tried to do, and it didn't work...

Mootilda
22nd Sep 2011, 12:58 AM
The thing on the left side of an assignment must be a variable. The right side can be either a variable or a value. Yes, you can subtract a constant value:
Local 0 -= whatever...

Subtracting personality from 10 sounds very reasonable. That will give you an inverse value that you can use to increase fun with decreased niceness. However, isn't the personality actually 0 - 1000? In which case, you want to subtract from 1000 to invert the value.

Perhaps we could see that bit of your code and comments about what you're trying to accomplish? Or, is that code from Cyjon your finished code?

Phaenoh
22nd Sep 2011, 1:44 AM
I think I'm actually going to multiply and divide instead of subtracting. According to the Snooty Sim graph, Hobby traits are based on two personality traits, one good and one 'bad'. I'll multiply by the positive one and then divide that by the less desirable one, then multiply by a constant to get back into the right range.

I'm pretty much just using Cyjon's code straight up.

Local 0 := My Personality Playful (which is "my person data x05" and will be in the range 0-1000)
Local 0 /= My Personality Nice (for a grouchy sim, gets us into the range between .1 and 10)
Local 0 *= x0A (multiply by 10 to get us back to the range 1-100)
Local 0 *= Const 0x1014:[Temp 0x0000] (the normal fun decay, which is 300 for public school and 200 for private)
Local 0 /= x32 (divide by 50 to give a final range of 0-600 for public school or 0-400 for private)
My Decay Fun Per Day := Local 0

I'll also need to put in a check to make sure that the down personality is not zero, and if it is, to use 100 instead.
Two of them don't use negative personalities, so for those I'll multiply the two personalities and then divide by 1000

Local 0 := My Personality Playful (which is "my person data x05" and will be in the range 0-1000)
Local 0 *= My Personality Nice (for a grouchy sim, gets us into the range between 0-1000000)
Local 0 /= x3e8 (divide by 1000 to get us back to the range 0-100)
Local 0 *= Const 0x1014:[Temp 0x0000] (the normal fun decay, which is 300 for public school and 200 for private)
Local 0 /= x32 (divide by 50 to give a final range of 0-600 for public school or 0-400 for private)
My Decay Fun Per Day := Local 0

/= 3e8 does translate into /1000, right?

Cyjon
22nd Sep 2011, 4:11 AM
The thing is, Grouchy is not (1/Nice). It's (1000 - Nice). So rather than dividing by Nice and worrying about dividing by 0, roundoff errors and such, you should use (1000 - Nice) just like you'd use Playful.

Local 0 := literal x3e8
Local 0 -= My Personality Nice (so now you have my Grouchiness 0-1000)
Local 0 += My Personality Playful (Grouchy + Playful which is in the range 0-2000)
Local 0 /= x0A (bring it to the range 0-200)
Local 0 *= Const 0x1014:[Temp 0x0000] (the normal 200 or 300 point fun decay, so our ranges are 0-40,000 or 0-60,000)
Local 0 /= x64 (divide by 100 to give a final range of 0-600 for public school or 0-400 for private)
My Decay Fun Per Day := Local 0

Phaenoh
22nd Sep 2011, 4:59 AM
Wow. I think I need to be sent back to basic Algebra... cuz I totally got schooled... on my afterschool activities... :facepalm:

Ok, that works well, but the values all move too quickly. How do I tone it all down some? I keep trying to /= 0x0002 at the end and it doesn't seem to change the rate at all.

And just to clarify, on the ones where I'm multiplying or dividing, I'm supposed to use the drop down item 'Unused' right before it right?

Mootilda
22nd Sep 2011, 5:21 PM
Exactly where are you trying to divide Local 0 by 2? Before or after you've added in the normal decay rate? I would suggest that you reduce Local 0 before you add in the normal decay rate, which should change the decay rate by less.

Something that I noticed about your code in post #15. More general programming information than anything specific to your problem. I hope that I can explain this adequately. Please ask questions if I'm not making sense.

You need to be much more careful about ranges. Local 0 is a WORD (two bytes) and can only store whole values between 0 and 0xFFFF (= 65535 unsigned decimal). Specifically, it can't store the value .1 (fractional) and it can't store the value 1000000 (too large). What happens in those cases is that the data is truncated and you basically lose your data.

You need to rearrange your calculations so that the beginning and ending values are always in the valid range, and are always whole numbers.

But there's more. If you arrange your calculations so that you take a range of 0-1000, reduce it to 0-10, and then multiply by 10 to get it back into the 0-100 range (as shown in your first example), you've lost a lot of variety in your values. You started with 1001 values and reduced that to only 11 distinct values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10. When you multiply by 10, you still have only 11 distinct values: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, and 100. This is rarely what you want.

Therefore, you probably want to arrange your calculations to maintain value diversity. This is usually accomplished by trying to keep the maximum possible range of values while still ensuring that all beginning and ending values are still in the valid range.

I really hope that makes sense. Computer math isn't like real math, because you always have to consider how the value is being stored.

Cyjon
23rd Sep 2011, 1:06 AM
I thought that range might be a bit high, but often that's how programming works. You do it quick and dirty just to get it working and then tweak on the numbers.

By coincidence, when Local 0 is in the range 0-200 that turns out to be 0-200%. So if you wanted a range of, say, 50-150% you can convert 0-200 to that range by dividing by 2 and then adding 50 (which is x32 in hex). Just remember that you need to look at the ends of the range, but also the center because that's going to be the average fun rate. If you just divide by 2, you get 0-100% which means you'll always get the same or lower fun drain, never higher, and the average student will have half the fun drain.

Then again, that might not be a bad thing. The problem with raising fun drain at school is the kids still have to do homework once they get home so you need to be careful about raising it too much. You might want to say the default drain is the high end and most kids will have lower fun drains.

I'm slightly confused by your last question, but I think I understand. You're using the wizard and telling it you want a local variable, and then it has you choose which local variable you want. Since you haven't named the variables you just get "unused" labels. So yes, that's what you do. Since you have only 1 variable there should be only 1 on the list.

Phaenoh
4th Oct 2011, 5:29 AM
This --> http://www.drealm.info/simlogical/sl/Sims2Downloads/Sims2_Institutions/School/UniformTutorial/UniformNewSchoolTutorial.htm is amazingly helpful. Its actually pretty easy to use existing EAxis outfits to make the templates too. Another interesting point of note is that uniforms must be in Everyday. It won't accept things in other categories. That explains why job outfits are always in Everyday, even if they are hidden. I might consider fixing some of my recat mods to hide the job clothes instead of moving them.

I'm having a touch of difficulty making the public schools have uniforms, but thats prolly just because its late and I haven't poked at it enough yet. No worries, making good progress. Well, mostly anyways. This project was picked (picken? pooked?) back up for the September School theme, but irl school hit me at the same time so I missed it. I'm so close to being done with it (so she says, even though she hasn't included the Enthusiasm stuff yet) I should just push through and get it done before going back to my other projects.

Phaenoh
23rd Oct 2011, 6:44 AM
Ok, school uniforms are working for all of the ones that need it, both private and public. A+

I never was able to get the Fun bar to not max out for kids in the middle, either they liked it or they hated it. That's a bit annoying but I can live with it.

As for the EP check, that's failing hardcore. I can't seem to find a place in my code to stick it to get called... lame sauce. I'm using Numenor's EP check (http://www.modthesims.info/showthread.php?t=248207) and I'm looking for E. I included some dialog boxes to let me know what was happening, but none of them ever showed up.

Enthusiasm, big problem here. Either my line is not being called, or I'm not doing something correct here, but there doesn't seem to be any boost for them. The amount variable seems to not be recognized, which is weird because I'm copying it straight from 'Nighttime Activity - Abduction'. I suck at this.

Packages included for people who know more about this to poke at for me and tell me where I have screwed up. Halp?

Cyjon
23rd Oct 2011, 11:29 PM
The pie menu on your school object is still pointing to the semiglobal "Interaction - At School" (x201A) rather than your local version (x1302). Try changing that and see if it fixes the problem.

Phaenoh
24th Oct 2011, 5:20 PM
So, when I changed that to point to the one in my package instead, something else broke. Going to school drops out of the queue. Then instead I tried leaving that interaction alone and instead put a pointer in the Motive bhav that I know gets called, but it still doesn't work. What is the difference between 'Interaction', 'CT', 'Function', and 'Sub'? Can I put a sub in a sub? I'm going to try sticking that code directly in the Motive one instead of calling it, just to see if my code even works.

Cyjon
25th Oct 2011, 5:55 AM
To the game, a BHAV is just a BHAV like any other. The naming conventions are for humans. Interaction is used for BHAVs called from pie menus, Function when called from Object Functions, Sub when called by other BHAVs including other subs, and CT when called by other objects using Run Tree By Name. But you can call a BHAV anything you want. I seem to remember some modder who labeled all his BHAVs with the same name for some obscure reason, which made the code really hard to follow.

As for dropping out of the queue, that sounds like it's just exiting early. The problem is figuring out where. Are you playing in debug mode to see if you are getting errors? In the code you posted I see an unknown BHAV in Interaction At School, and an unknown constant in TEST. Are the kids changing into uniforms before it drops out? Because that would indicate you are getting to that line. I've had times I've had to put a debug message on every fricking line of code to find out where it's having problems.

Phaenoh
25th Oct 2011, 4:21 PM
I don't think they changed clothes. I'm not confident my debug message code was working properly either. I know this is a lot of hand holding, but can you show me the code you use for them, just so I know I'm doing them right? Debugging debug code seems really irksome. I'll do more tests and see what that unknown code was. I was pretty sure Inge gave me a clean base game clone of the schools to work from, but maybe not.

Cyjon
25th Oct 2011, 10:16 PM
The one thing I noticed on the debug messages is on the second line of operands, the x14 and x02 aren't necessary for a "message" dialog type. SimPE has the bad habit of not clearing out excess data when you use the wizards, so I suggest clicking the X button to the right of the operands to zero them all out before using the wizard. Sometimes the excess data can create mysterious errors.

Phaenoh
27th Oct 2011, 5:15 AM
Well, I think I made some progress tonight, but I pretty much just gave up on the idea of it checking EPs and I'll just do two versions. I was having no luck using any of the EP checkers, it just kept throwing errors. Prolly cuz I wasn't putting it in the right place, or I wasn't feeding it the right variables. Dunno.

The enthusiasm bit is still driving me bonkers as well. I can't get the darn thing to work. It throws an error too, but I don't know how to fix it.
An error occurred in object 'Freya Sim'
Error: Invalid Constant

I've flat out stolen the code for an Enthusiasm Boost from the Alien Abduction code, but for some reason its different and doesn't work. My second constant is either [unknown] or [not set] and I don't know why it would be different. It just doesn't seem to recognize the number. I thought that maybe it was missing a BCON so I imported the one that seemed to be linked to it, but that didn't seem to help it find its missing constant. Arg! What am I doing wrong now?
[global 0x0621] Enthusiasm - Boost (Absolute) (4 args: Const 0x016F:0x09 ("Science" Value: 0x00D4), Const 0x2005:0x0F ([not set]), Stack Object ID 0x0000, My 0x000B (object id))

Cyjon
30th Oct 2011, 5:50 AM
I haven't looked at the file you attached, but I can see one problem just from the line you posted.

Resources such as BHAVs and BCONs exist in one of three domains: private, semiglobal and global. Private resources are available only to a specific object type. So the public school object and the private school object would each have private constants which can be recognized because the BCONs and BHAVS all are numbered x1###. The private school object can't use public school private resources and vice versa. (Well, not directly, but let's not confuse the issue.)

Semi-global resources are available to all objects of a certain category. So public and private school belong to the semi-global group "JobSchoolData", the collection of school objects. These resources are all numbers x2###. Telescopes, not surprisingly, belong to Telescope semi-globals. All the semiglobal groups are actually called global (as in Telescope Globals) which might be confusing, but they are really semi-globals.

Global resources are available to everything, and they are numbered x0###.

In the example, you are using constant 0x016F which is a global constant, so that's fine. But you are also using constant 2005:0F which is a semiglobal constant. Since you took that routine from telescopes, that must be a telescope semiglobal constant and can't be seen by school objects. Presumably that's the amount of the boost. You can look it up in Telescope Globals to see what the value is and then either use a literal value in your routine, or create your own private constant in the school object by either creating a BCON or adding it to an existing BCON.

Phaenoh
30th Oct 2011, 11:47 PM
Ok, after an entire day of poking around in my code I've discovered that my code was never even being called, and after I fixed that it started throwing errors left and right. First its bad constants, then bad arrays. Short of a miracle, there is no way I'm getting this done for the September Children's theme. I hate to admit defeat, but nothing is working right and I'm out of time.

I tried the BCON approach, and then tired a couple different literal values, and none of them seemed to make a difference in the enthusiasm, even after I got that part to stop throwing errors. If you see something simple that I'm missing and can show me how to fix it, I'll keep going, otherwise, I need to stick this back in my unfinished folder for a while.

:(

Echo
2nd Nov 2011, 3:56 AM
Error log? :)

Phaenoh
2nd Nov 2011, 4:03 AM
Do you just swoop in right when I need a miracle? I was having a darn hard time letting go of this theme. I'd never missed one before and it was just eating at me.

Echo
2nd Nov 2011, 5:09 AM
Lol! Sorry, I've had a grand total of two hours of internet access over the past two weeks, so I only just got here. :) Cyjon's been helping plenty though!

Try changing the dialog type on line 0xD (13) of "Sub - Start Motive Deltas" to something other than "Phone Book - Services"? Perhaps "Message" or "Text Notification"?

Phaenoh
2nd Nov 2011, 6:11 AM
It's always the simple stuff that trips me up isn't it? I fixed that, and did the same with the others like it, but the same bug is still happening, the kid gets teleported back into the middle of my house and I can't direct her to walk to school or get on the bus. New version of code and error log included.

Echo
2nd Nov 2011, 7:46 AM
I can see why it's failing, but I'm not sure what you are intending that line to do.

This line:
0x0E (14): [prim 0x0002] Expression (Local 0x0000 /= Unused 0x000A)
is saying "set Local 0x00 to (Local 0x00 divided by Unused variable 0x0A)".

Did you perhaps mean:
0x0E (14): [prim 0x0002] Expression (Local 0x0000 /= Literal 0x000A)
which says "set Local 0x00 to (Local 0x00 divided by ten)

Phaenoh
2nd Nov 2011, 5:43 PM
Yay! That fixed it. Now I'm back to one of my previous problems though. The fun stat doesn't really seem to be based on the personality of the kid. I've got two kids I'm testing with, one is super active and the other not so much. As expected the super active kid loves going to Track Team and the other hates it, (fun meters maxed out on either ends by the time they get home) but when I put them both in regular school, the super active kid is still really happy when the come home and the other is still really bummed (though not as much as before).

Ok, I did a tad more testing, and I've found that somewhere I've got some CC somewhere messing with the school fun values. Under an actual clean testing environment, both kids' fun score tanks to about 75%. This leads me to believe that the negative values I'm achieving by placing kids in an activity that isn't supposed to be fun for them works, but I'm a little concerned about the super happy maxed out fun version now. I'll need to tweak at my values.

Edit: found it! (http://www.modthesims.info/download.php?t=32302) now I can work with real values instead.

Cyjon
3rd Nov 2011, 3:51 AM
Sorry, I've been tied up with my own hideous debugging nonsense so I haven't had a chance to look at this. Glad Echo stepped in to help out :)

Phaenoh
4th Nov 2011, 1:53 AM
While I've got a few very smart people in the room, and things are starting to look up again, does anyone know how to change the school's carpool from the bus to anything else? I'm finding like 6 different references to Bus and Carpool within all the BHAVs and BCONs and either I suck at this (likely) or none of them seem to control it.

Also, from what I can tell, schools are built like jobs, and children are at level 1 and teens are at level 2 with no chance of promotion. The grade level seems to be job performance. Anyone see a way of re-enabling promotions? I'd love to be able to promote someone to Captain of the Football Team.

Thirdly, chance cards. Which areas do I need to edit to make them pop up more often, be unique to each school activity, and have choices instead of the just being notifications on the sidebar? I'd love to be able to give options on what Book Club will read next.

Cyjon
4th Nov 2011, 2:39 AM
Regarding the carpool, yes but not easily. You'd have to do something similar to what you've done so far, make a private version of a semiglobal routine. Each school object's "Function - Main" calls the semiglobal "Sub - Process" which eventually calls "Sub Preload Bus" when it gives the one-hour warning, and then later calls "Function Create Car" when it's time for the bus to appear. You'd need to create your own versions of all three routines. So "Function Main" would call your "Sub Process" which would be the same as the semiglobal one, but would call your own versions of "Sub Preload Bus" and "Function Create Car". The latter two would use the GUID of the car you want instead of the GUID of the bus.

Note that those were only the two references to the bus I found. There might be more, for example at the end of the school day.

Job promotions are handled in "Sub Get Paid" in Job Globals, which is called by "Interaction At Work". Start with that as a basis and convert it to something similar for schools.

School chance cards are handled by the semi-global "Sub - Chance Card" and the dialogs by "Sub - Chance Card - Dialog". The actual card text is kept in each school object's dialog strings, and the reward in a bunch of BCONs. You could create private versions of the semiglobal routines to change the way dialogs are handled. Look at the way jobs handle chance cards (start with "Sub - Chance Card - Jobs" in Job Globals) to see how you handle choices and have multiple BCONs depending on choice A or B, and whether the result is good or bad.

Echo
4th Nov 2011, 3:44 AM
Regarding the carpool, yes but not easily. You'd have to do something similar to what you've done so far, make a private version of a semiglobal routine.

Just a side thought on that... Phae, how would you feel about including a smallish global mod as part of your project? If you're not completely against it, then here's one option:

- Create an empty package. This will be a required global mod package for custom schools to work.
- Import the 0x2005 BCON from the schools semi-globals. Change its instance to a value in the 0x1000 range which isn't currently used by the school object, and change its group id to "0x7F647BAD".
- At the end of this BCON, add the two GUID numbers for the bus' tile 0. (That is, 0xAC03 and 0x4E2F).
- Import the "Sub - Preload Bus" BHAV from the school semi-globals (keeping the same TGI). Change the two "Temp :=" lines to point it to lines 0x00 annd 0x01 in the BCON above.
- Import "Function - Create Car" (keeping the same TGI).
- Change the Set to Next line to this: Set to Next (Stack Object ID 0x0000, Object of type GUID in temp 0/1)
- Just before the Set to Next is called, add two "Expression" commands, to copy the last two GUID numbers from the BCON into temp 0 and temp 1 (the ones for the bus' tile 0).
- Change this line Create New Object Instance (GUID 0x8C032A00 ... to Create New Object Instance (GUID: Temp 0x0000,1 ...
- Before this line, add two Expression commands which copy the GUID numbers for the master tile in the car into temp 0 and temp 1 (The ones stored in lines 0x00 and 0x01 of the BCON).

If you run this in-game with the existing school, it should work exactly as it always has. The normal bus should arrive with no issues.

To customize your special schools, copy that BCON into your object, and replace the GUIDs with the ones for the alternative vehicle you want them to take.

It sounds kind of complicated, so you will probably decide it's not worth the effort, but it would keep your custom school objects tidy and uncluttered, and make new ones essentially "drop-in-able". (It's how EA should probably have written their code in the first place, really!)

If someone doesn't install the global mod package, then all schools will just fall back to using the bus.

Phaenoh
4th Nov 2011, 6:04 AM
Echo, I think I like where you are going with this. I've already got my School Changer Object that is required for all my activities to work, and they aren't 'drop-in-able'. I need them all, and it only recognizes the 20 I've made. I could easily add it into there, right? Additionally, I could run BHAV checks asking if it should send the regular bus because this is a normal start or end time, or send the special car earlier or later than usual. Can I also have different cars for the different schools? I want my sports teams taking the white athletic bus and the academic kids taking minivans or town cars. I imagine with some interesting twists, I can handle bringing friends home who aren't in the same activity but still have the same end time as well. I'm pretty sure I understood most of your code and can impliment it with one exception, what do I do to copy the guid's over?

The promotions bit seems like it will take some more exploring, so I'll work on the carpools and the chance cards first. This project's projected end time just soared off into mid December, but I'd much rather do this thing right and be done with it than the half-assery hurry-up-get-done I was doing before trying to fit to the theme's deadline. YAY!

Echo
4th Nov 2011, 6:45 AM
To copy the GUIDs into Temp 0 and Temp 1, you just need lines like these:
[prim 0x0002] Expression (Temp 0x0000 := Const [end half of GUID])
[prim 0x0002] Expression (Temp 0x0001 := Const [front half of GUID])

Also, one thing at a time! Let's see if the carpool theory even works before you add too much complexity! There may be other issues I haven't accounted for, like sharing vehicles and arrival times and the like.

I didn't actually look at your school changer object, but it should be fine to put the global overrides in there as long as they have the correct groups set.

Phaenoh
4th Nov 2011, 4:25 PM
I think I followed what you said, but I got tripped up on a couple of things. For starters, do I have all the instance and group numbers right? Everytime I did it through the Import Semi-Globals box, it made it part of the 0xFFF group instead of leaving it alone so I found the original files in the Objects file and copied them.

Secondly, you said to add the bus guid to the end of the list (2 and 3), but then say to have them reference lines 0 and 1. :?

Did I do the "[prim 0x0002] Expression (Temp 0x0000 := Const [end half of GUID])" stuff right?

And lastly, how do I get the "Change this line Create New Object Instance (GUID 0x8C032A00 ... to Create New Object Instance (GUID: Temp 0x0000,1 ..." to work? My wizard was greyed out and I don't know the op codes for it.

Echo
6th Nov 2011, 2:16 AM
Secondly, you said to add the bus guid to the end of the list (2 and 3), but then say to have them reference lines 0 and 1. :?
Two different GUIDs. One's the master tile (the out-of-world one), and one's the lead tile (tile 0). :)

The Expressions were pretty close. The first one should have loaded into Temp 0 while the second should have loaded into Temp 1, but other than that no issues.

Group IDs look fine.

To change calls without a wizard, just change the numbers in the operands boxes and watch what happens to the text below. Each operand normally only affects one part of the text, so when you find the one which touches the part you want to change, then just manipuate that operand until it says what you want.

Try the attached, see if it lets you change vehicles on a school-by-school basis

Phaenoh
6th Nov 2011, 3:59 PM
Well, an interesting thing happened during testing. I started by placing all the kids in the one activity I'm testing everything in, and when 8am rolled around, no bus ever showed up. I clicked on them to 'Walk to School' and they were unable to do so, it just dropped out of their queue. I tried it again with one kid in the testing activity and another in one I hadn't touched in a while, neither kid could go to school. As soon as I had them quit the activity and drop back into regular school, they happily walked off to class.

When I import the BCON, I'm supposed to leave it's Group number alone right? I wasn't sure which order the vehicle GUIDs were supposed to go in, so I tried both ways. Same problem for both.

Echo
7th Nov 2011, 1:00 AM
When I import the BCON, I'm supposed to leave it's Group number alone right? I wasn't sure which order the vehicle GUIDs were supposed to go in, so I tried both ways. Same problem for both.

When you import it into your custom schools, then that copy should be if in 0xFFFFFFFF group. Only the one in the global package should have the special group number. :)

Phaenoh
7th Nov 2011, 4:10 AM
Fixed the group number, and tested it out with all four ways of putting in the GUIDs, same thing happened as before. It might be the GUID I'm using, so I don't know. I'm trying for the white sports bus with Master of 0x0CA42373 and 0,0 of0x0CA42374.

Echo
7th Nov 2011, 4:15 AM
Are you getting any errors?

ETA: One thought - does the school bus have any specific logic in it? If so, it might be worth cloning the bus (just give it dummy GUIDs, it doesn't matter for now), changing its colour, and trying that instead of the white minivan. If that works, then it'll be a matter of making a bus clone with the white minivan mesh.

Phaenoh
7th Nov 2011, 5:34 AM
Oddly enough, no errors. What do you mean about logic? I was trying the white bus, same mesh as the school one, just a different color.

I'll try just using the normal bus GUIDs in the morning. That should help us track down whether its a GUID issue or a BHAV one.

Echo
7th Nov 2011, 5:40 AM
Oddly enough, no errors. What do you mean about logic? I was trying the white bus, same mesh as the school one, just a different color.

I was wondering if the school bus has its own BHAVs which are specific to the school bus. That is, BHAVs that don't exist in other vehicles. If so, then having a clone of the school bus (with all the associated BHAVs, etc) would work whereas a regular vehicle (like the car pool vehicles, or the other bus) wouldn't work.