View Full Version : Social and Pop up Menu Help

24th Dec 2010, 4:13 PM
I'm poking around at an object I've had on my to do list for a while and the reason it hasn't been finished off yet is because I've got no idea how to make it do what I want it to do. BHAVs are my constant battle.

I'm trying to figure out how to make the object pop up the UI box that you get from the telephone, a list of all the sims you know, except, I want it to list all the sims instead. I had downloaded a mod that just made your sim know everyone but it took forever to load the phone menu so I took it out. I can't seem to find it anymore to look at, so I'm kinda stuck.

The second thing I have no idea how to do is after that menu pops up with all the sims in it, I want to be able to click one of them and then that sim becomes known to your sim in the relationship panel. 0/0, no friendship change. I've never dealt with Socials before, so I'm at a complete loss.

Any help? Thanks!

30th Dec 2010, 7:55 AM
I was quietly hoping that someone who had more experience in this than me might reply first, but apparently no such luck... :) This isn't part of the game I've ever really worked with, but here's what I've found from a little bit of digging.

The UI box from the telephone is one of the standard game dialogs. You can get it to display using opcode 0x0024, with the Dialog Type of "Phone Book - Invite". The sims which show up in that dialog are read from the SO's object array 0. To fill that with all the sims, you'll need to:

Clear array 0 -> [prim 0x0076] Array Operation (Stack Object's object array 0x0000, Clear contents)
Loop through all the sims in the neighbourhood using a set to next (sim), each time moving the sim's ID into a local.
Add each of those sims to the array -> [prim 0x0076] Array Operation (Stack Object's object array 0x0000, Unshift onto the front of the array: Local 0x0000)
Then call the dialog

You'll have to do some Stack Object shuffling though, to make sure that the right sim's array is being populated at the right time. There are a few examples in the phone call objects, with names like "Call - Load Sim Array" if you want to look at how that stuff works.

To make a sim known to another sim, you need to adjust the short and long term relationships. There are globals for each of these:
[global 0x020D] Soc&Rel: Adjust STR to Other Sim
[global 0x0216] Soc&Rel: Adjust LTR to Other Sim

You might also need to add the necessary memories of meeting, but that's probably optional.

There's an object doing something along those lines here, which you might like to take a look at:
It's listing existing friends and making them best friends, but the process is similar.

Good luck with it!

2nd Jan 2011, 4:29 AM
And I was silently hoping the delay in your response was merely due to the holidays. Thanks for coming to my rescue!

I added what I interpreted to be your instructions and it threw an error. See image attachment.
Error - Bad Stack Object Array (John)

I'm creating a phone directory. The idea is that all sims will be listed in the dialog box and then when you click on a sim, they are now 'known' to you and you can call them. I'm thinking I won't need to do the SO shuffling, because its the same list of sims every time, all of them. I'm not sure how the phone -invite dialog box works yet, so that will change somethings I think. In my head looking up the number and actually going to call them are two separate actions, but whatever works out easier will be what I go for.

Btw, I'm super proud I mostly understood everything you said this time. I think I'm learning!

4th Jan 2011, 5:03 AM
Definitely learning! :)

First thing is that a set-to-next loop needs to look a bit more like this (SO == Stack Object):

1: SO ID := 0
2: Set To Next (whatever) [true => 3, false => 4]
3: whatever happens in the loop [true => 2]
4: whatever happens after the loop

That way, the "whatever happens in the loop" part gets run for every possible value that the set-to-next finds. In the case of your BHAV, that means that 0x2 false should point to 0x4, and 0x3 true should point to 0x2.

You will still need to do the SO shuffling because of lines 2 and 3. Line 2 is controlling a loop, and each time it gets run it looks at the current ID of the SO, then counts up until it either hits another object of the correct type, or until it runs out of objects. When it finds one, it assigns that to the SO ID. So basically, every time you run this line, the SO will get changed.

Line 3 is adding the new object to the Object Array stored inside the current SO. Since the SO has just been changed by the Set To Next, this will cause Bad Things To Happen.

You want to take the ID of the object found by the Set To Next, and copy that into a local. You then want to set the Stack Object back to the original object, so that you can store the newly found Sim's ID into that original object's array (I can't remember if the original object was the sim calling or the phone book object... I'd have to look at one of the objects which uses a dialog to be sure).

You then need to set the SO back to the value stored in the local, so that the next time Set To Next runs, it starts counting from where it left off.

Looking up the sim and making the call are definitely different beasts, so that shouldn't be a problem for you.

6th Jan 2011, 4:30 AM
Okay, so that time I really didn't understand much, I think my brain decided one epiphany was enough and gave up. I looked up that Call - Load Sim Array BHAV and tried to just use that one, but it didn't work either. I extracted it and imported it, Fix Int and everything, no luck. Sim walked up to my object and then jump bugged away. I don't really know how to debug bhavs yet, getting a crash course on that prolly should have been on my list of things to learn a while ago.

Should I use the existing BHAV cuz it does mostly exactly what I need, or try to cobble one together myself?

6th Jan 2011, 8:23 AM
I'd actually suggest you borrow liberally from the BHAVs here:

They'll still need some fairly significant tweaking, but it will get you pretty close. :)

7th Jan 2011, 3:04 AM
Ok, now I have no idea what is going on. I downloaded that and loaded it in my game and it worked fine. Then I did some tweaking to it (copied the BHAVS to my object and removed a few lines of code that never got called) and it Disabled Custom Content in my game, no matter how many times I reloaded it I couldn't get it to Enable CC again. It even seems to have reset things like my neighborhoods and Game Tips, like it thinks MG was just installed. Then I took the things out and now I can't even get my game to load at all. I noticed that a Config folder ended up in my Downloads folder. I took that out and it still doesn't load, I think it might have gotten moved from somewhere, but I can't tell from where. This is really weird to me and very frustrating.

Ok, I tried stuffing this into an AGS and I got roughly the same problem. A fresh copy of the BFF mannequin is the only thing in its download folder, and I can't get it to Enable CC. :( Did I break my game?

Found more out, reading the comments in that thread, it sounds seriously buggy. I'm gonna take that out and see if I can't do damage control on it.

Gah! Can't fix!!

7th Jan 2011, 11:15 PM
Hmm. That's very strange. I'll have a look at it later, see if I can tell what's breaking.

8th Jan 2011, 6:58 PM
Simsample helped me fix my game, but that piece of CC still has a heck of a lot of buggy reports, I'm looking at a couple of different mods instead to see if they can be useful instead. I'm very uneasy about using bad CC as a base. After all the problems I had with my slides, I'm not looking for that headache again.

This one by monique (http://www.modthesims.info/d/155086) seems to already do exactly what I need. Hers has more options and its not really an intuitive mesh, so I'll keep working on mine.

Edit: /me does a happy little spiffy dance. I'm almost done with this project and aside from it nearly eating my entire save game file, its being a breeze. I love it when someone has done all the hard work for me. I do need to figure out how to remove the pets from the menu though, pets aren't usually listed in a phone book. PROGRESS!!!

More Editing: I'm running into two problems now, the sim array loads up everything that the current sim doesn't know; birds, cats, dogs, grim reaper, penguin, robots. Isn't there a 'verify - am i human' thing I can run? Second problem, I can't seem to get it to pay attention to its placement flags. I vaguely remember having this problem with my garden windmill and not being able to solve it either. There is prolly a bunch of extra code in there as well, I didn't know what half of it did so I didn't pull it out.

16th Jan 2011, 4:38 AM
Ok, I've been plugging away at this all week and can't seem to make any progress with it. I have no idea why it won't place, move_objects is the only way to get it to sit. Also, I've poked at every single object that loads a sim array that I can find. All except monique's don't load all the sims from the hoods, but hers also loads pets and NPC robot and penguins. I need a line that tests the SO's ID for being human and not a baby or toddler. I tried the 'Age, is SO teen?' and that didn't go so hot, and there wasn't a line for adult so it wasn't a complete fix. I found a global 'Pet - Is pet?' but when I entered it's op code, my package didn't recognize it and it didn't work in game. What now?

19th Jan 2011, 7:41 AM
Post it and I prod it. :)

19th Jan 2011, 5:24 PM
I'm starting to wonder if half of my creations shouldn't be posted under a joint account between me and you. You come to my rescue every time. <3s

26th Jan 2011, 12:29 AM
Heh heh! I come to the rescue of many BHAV projects, not just yours. But it makes up for the fact that I haven't actually made a real, new mod of my own for almost three years now. It's more fun letting other people do all the real work, then just fixing up the interesting BHAV stuff at the end. ;)

Sorry it took so long to look at this, it was a crazy week.

There were a few reasons why it wasn't placable. You had an "idle" call in your init function - that causes "Check tree primitive blocked completion" errors. Also, your "function main" was calling your "function init". Not sure what was going on there. Finally, you had the original flamingo's "allow intersection" test set up in the objf. (You really should start up with testing cheats turned on ;) ). I cleaned those up, and took out the various gardening and cleaning tasks from the OBJf as well, since they probably would have triggered a bug later in play.

I was having trouble figuring out your actual phone book BHAV, so I left it alone and copied out the really useful bits into in a new one instead. I find it a bit easier to follow now, so hopefully it'll help you too. Start reading from "Interaction - Phone - Look up Sim" and if there's anything there which isn't from your original and needs explaining, let me know and I'll explain it. It should exclude babies, toddlers, animals, and any sim in family 0 (the non-templated NPCs like Death, Hula Zombie, etc etc...) :)

26th Jan 2011, 5:43 PM
I've known for awhile you are the superhero behind many projects, but that doesn't lessen what you do for me from my point of view. Super Echo! Also, no apologize needed for you having a real life. :P

Welp, I plead ignorance on all those bugs you just fixed. This was pretty much just a straight up clone of Monique's thing minus some things I knew I didn't need. Super sloppy job on my part. I can't wait to test out your shiny new and improved version. Five more hours till I get home from work.....

Just as an off the top of your head question, does the game have the ability to tell me which lot a sim is living on? Like for popup menus, $sim returns the name, and in the regular phone book under the sim's name is where they live. Can I call that info into a pop up box? Q tested this out for me and wasn't really sure that the name was looked up till he went and checked; a little sidebar notification that says something like "Dina Caliente lives at 19 Beach Drive, Pleasantview" or "Contessa Simovich lives in Downtown" would be helpful here. Then all I need is a little bit more mesh/texture tweaking and I'll be done and can conquer the world!!! MWHAHAHAHAH

god my job is boring today....

26th Jan 2011, 10:35 PM
The game stores the family ID, which is a number representing which household they're a part of. For putting it in a dialog... Not sure. You should be able to use any of these:
But keep in mind that you actually have the sim's Neighbour ID, not the sim's Object ID, so they're the ones that will be easiest to display.

27th Jan 2011, 12:05 AM
Ok, initial testing stage completed. Problem found. It does a good job of keeping out the penguins and robots, but I no longer have the downtownies, subhood sims or BV locals in my list.

From looking at the 'make me know sim' sub, it looks like it makes the relationship both ways, unless there is some problem with calling up a sim who doesn't know the person calling, i'd rather remove the other side. Doesn't answering a phone call and talking with a person add them to your list? I'll have to test that bit after I break it.

Edit: Huzzah! I did something on my own! I made the knowing stuff one sided, and it doesn't seem to bother the game at all. I looked up a sim after making it one sided, called the sim up, had a lovely conversation then summoned the sucker. He knew her after the conversation but not before.

I also noticed a couple more things. It does make sense that all sims would be listed in the book, but its not particularly useful to list sims the current one already knows. It seemed interesting that John Mole could look himself up in the phone book. I don't know what I want to do with that yet. What do you think?

Later Edit: More testing and stuff. I added in the walk-to bits and the entry and exit and i'm still gonna work on adding an animation and finalizing the texture. Also moved the mesh around a bit so it looks better on surfaces. Played around a bit with the dialog box, nothing working yet.

Problems with current: 1) Doesn't list sims from subhoods (help!), 2) doesn't place on floor ('must be on ground' appears), 3) dialog box doesn't work correctly yet, and the most interesting problem, 4) if you pick a sim you already know and have a relationship with, it resets the relationship to 0/0. :blink: Either I'll have to do some more hack and slashing to your fancy 'make me know sim' sub, or we can just remove sims we already know from the array so they can't be selected. Yay progress, and off to bed.

27th Jan 2011, 10:32 AM
1) Okay, that's kind of funky. Try this. Using "insert via false" between lines 0x4 and 0x5 of "Sub - Do I want this sim in the list?", add two new lines:
[global 0x0488] Sim - Is Townie? (2 args: Sim ID=Stack Object ID 0x0000, Sim ID is NID?=Literal 0x0001)
[global 0x05EE] Sim - Is Vacation Sim (1 arg: Person ID=Stack Object ID 0x0000)
The true target for both of these should return true. The false target should go to the next line. (I can't test this tonight, because none of my test hoods have subhoods and it's too late in the evening to start making one!)

2) Add "Expression (My 0x002A (placement flags) Set Flag flag# Literal 0x0001 (allow on floor))" to the end of your init

3) Which dialog doesn't work?

4) Yes, it'll do that. The easiest thing is to only list sims your sim doesn't know. In line 0x3 of "Sub - Load Sim Array", change it to read "Set to Next (Stack Object ID 0x0000, Neighbor with no relationship to neighbor ID in temp 0, disabled objects included: False)". Then, immediately after line 0x0, add a new command which does this: Expression (Temp 0x0000 := My person data 0x001F (neighbor id)). That should stop anyone already known to your sim from showing up in the list. (In theory, anyway)

27th Jan 2011, 5:43 PM
What's the difference between Allowed Height Flags and Placement Flags? They seem to be super similar and I never know which to use.

Well that was a grand failure. >.< Teach me to do this while on lunch break. The book wouldn't place on the ground, still said it had to be outside, and after walking to the books, she errored out. I'll poke at it some more later.

So, I figured out that I accidentally used Temp [Temp] instead of just Temp. Fixed that and she can use the books now, but I didn't notice much change in the list. I did notice however, she can only use the books once now. Her previous friends may or not still be listed, I forgot to check for that the first time the menu was open and then I couldn't get it to open a second time.

Subhood sims are still not included. I've been testing in Desdirata with Natasha Una and John Mole and its pretty darn hard to miss all the plantsims from my Riverblossom sub hood. I also didn't see any Vampires in that list so I don't think the Downtownies are there either, but that might be due to the fact that I've got Bluewater as my downtown, but none of their residents are there either.

Later Edit: I figured out why she couldn't use them anymore, she didn't perform the 'standard exit'. Switched the interaction False return from error to the exit and it works now!

28th Jan 2011, 4:43 AM
The plantsims and vampires will be getting excluded by the "is human" check (they're not human - they're plantsims and vampires ;) ). Take out this line:
[prim 0x0002] Expression (Neighbor's person data 0x00BA (Species) == Const 0x0171:0x00 ("Human" Value: 0x0000))

28th Jan 2011, 5:50 AM
Ok, I have good news and bad news. Good news first, the subhood sims are being included in the array. The bad news, somehow the entire populations of Riverblossom and Bluewater have completely vanished. I wasn't too scared about that because I don't play that hood and maybe I just screwed up setting up that megahood. Not that hard to eff up a template hood like that. Then I skipped over to West Weasles, it's a subhood of Belladonna and that's when things got a little scary, all my sims from there are completely gone as well. I'm really hoping I have a backup somewhere for them otherwise these little sweethearts (http://i203.photobucket.com/albums/aa210/Phaenoh/Sims/Tots.jpg?t=1296193831) are gone for good. I'm still not entirely worried that this object did anything cuz I don't think I've checked in on that hood since I reformatted this computer and transplanted them back in game. That could be the cause of the other hood's issue too. Then holding my breath, I opened up Pleasantview. Luckily everyone there is still safe. Without letting go of that breath I checked on it's hood, Sand Simolean Point, also safe. Thank goodness. I asked Don Lothario to test it out for me and he got himself a couple numbers of some of his local hotties he hadn't met yet. Win-win. I took that human code out and now I've got dogs and cats back in my phone listing. Isn't there some 'Species == Dog' I can run a false past to get rid of them?

Problems yet:
1) Can't place on the floor, says it must be outside.
2) Critturs should be unlisted
3) It would be cool to include some sort of animation, I was hoping for a pointer finger running across the book like you'd do to read a recipe or what not. If that's not doable, at least looking at the object would be good.
4) I'd like a dialog box to pop up on the side of the screen with a picture of the sim I just looked up, but I can't get it to either display at all or if it does it doesn't use the right sim.
5) This latest brainchild idea is courtesy of John Mole; what about having a thought bubble of the sim I just looked up appear over their head either instead or in addition too.

28th Jan 2011, 6:16 AM
Oh! I wish I could be more helpful. But sadly, I can only possibly help with the first problem listed. :(

Buried inside your "[semi 0x200A] Function - Init (no args)" inside your "Function - Init", there is a line: [prim 0x0002] Expression (My 0x001E (room placement) := Literal 0x0001).

This is probably what is making it want to be outside. (FYI: a value of Literal 0x0002 is indoors.) Add a node to the end of your Init that sets the value to Literal 0x0000. It should no longer care if it's indoors or outdoors.

28th Jan 2011, 9:12 AM
1) See MSD's post above.

2) Yep. There's:
Expression (Neighbor's person data 0x00BA (Species) == Const 0x0171:0x01 ("Large Dog" Value: 0x0001))
Expression (Neighbor's person data 0x00BA (Species) == Const 0x0171:0x02 ("Small Dog" Value: 0x0002))
Expression (Neighbor's person data 0x00BA (Species) == Const 0x0171:0x03 ("Cat" Value: 0x0003))

3) Did you have an animation in mind?

4) That should be possible. Use a standard "Text Notification", set up a bit like this:
[prim 0x0024] Dialog (Text Notification, Strings: Local, Message: "Your message here", TNS Style: Sim, Priority: 0x01, timeout: 0x14, TNS ID: Temp 0x0000, icon: neighbor, wait for user: True, block simulation: True. )

5) Thought bubbles are effects. You should be able to get a thought bubble with the appropriate sim using something like this:
Effect Stop/Start (Soft start effect, Target: My 0x000B (object id), routing slot: 0x04, "uiHeadlineGroup_ThoughtRuntimeThumb_x" [Effect:0x28 (Global)], icon: Stack Object Id 0x00, Priority: True, model: default)

30th Jan 2011, 3:23 AM
Yay! This is coming together nicely finally! Cats and Dogs are out, Witches, Vampires are in. I've still got a couple problems yet though. As for animation, I think I'm canning that plan. I can't seem to find a basegame animation I'd like to use.

1) I don't know where to fix the thing MSD mentioned. Can't I just remove the line within that BHAV? Is that stuff actually in my package? I tried to add a line to the end of my Init, but I guess I didn't have the op codes right because something when way wrong.
2) The dialog box isn't displaying to correct neighbor, so I'm not really sure where I'm supposed to include it. I've tried in the Go and Use interation and also the interaction you wrote, both had the same result of having Townie Chloe Gordon show up in the icon instead of whichever sim I picked.
3) I'm also having a bit of trouble with the though bubble too, the little wrench icon is greyed out for that one and I can't guess all the op codes I need for that. How do you know these things?

30th Jan 2011, 4:16 AM
I apologize. Looking back at my post, I realize I could have explained it a bit clearer.

In your package's "Function - Init" Bhav, the first node (0x0) calls the semi-global's "Function - Init()" bhav. So the room code is not in your package per se. It is there indirectly via your package calling a bhav tree that contains it.

To fix it, all you need to do is go to your package's "Function - Init" Bhav. Select the last node (0x6) and click the "Insert via True" button to create a new node (0x07). The OpCode should be 0x0002. If you're using the wizard, the parameters should be My room placement := Literal 0 (assuming "Decimals" and "use Attribute picker" are checked). You could also set the parameters by clicking the little button with the ", then copy/paste 1E000000000503070000000000000000 into the little window that appears.

The call to the semi is for convenience (i.e. reusing already written code). It's kinda like saying "I'll have what she (*you point to a person sitting next to you who has already ordered*) is having" when you give the waiter at a restaurant your order, rather than repeating everything that was said. You don't want to change the semi-globals; you just want to append it: "I'll have what she is having...but I want ketchup instead of mustard and no onions please."

I hope that is more clear.

30th Jan 2011, 5:26 AM
Yay! That worked!

I found another issue. (gah, they never stop it seems!) I have the ability to select and 'know' sims like the Human Statue, Social Bunnies, and Social Workers, however they don't show up later in the phone call list. Is there an easy way to sort those NPCs out?

I've also decided to drop the dialog box in favor of the thought bubble. I do hate dialog boxes in game, this seems like a better way to keep the illusion while still letting the player know something happened. Where should I stick that in my code?

30th Jan 2011, 11:01 AM
They're templated NPCs. You can filter them out by family (Neighbor's family number == 0x7FFF), but you'll filter them all out. No maids, gardeners, firemen, they'd all get removed until they moved in with a playable family.

You can just change the values for the BHAV directly, but I just copied them out of another object which I knew had the thought bubble in it. In this case, the "Pensieve" from the Harry Potter project. Then you've just got to try adjusting numbers until the relevant values have changed to point at your sim. :)

30th Jan 2011, 8:05 PM
More progress, this is getting so close to being done, I can practically taste it! I noticed the exact animation I was looking for in the Snake DeathEater book thing in the Harry Potter Project you sent me to, a quick read through your tutorial and they settled in nicely. What happens when I direct a child to use by book but there is only the one adult animation? Do all the other ages do the adult animation, or does it skip over it, or what?

1) Is there some way I can filter out Social Bunny and Social Worker by their names, there are only a few NPC who shouldn't be in my list still. Name == Social Bunny --> false ?
2) My thought bubble is now correctly popping up when I want it too, but its got those grey vertical broken lines and a red X through it. How do I tell it to use the neighbor I just looked up instead?

5th Feb 2011, 7:55 AM
To filter out non-templated NPCs, you should be able to block by their GUID. Clone them, get their GUID, and run a check on that. :)
For the thought bubble, try changing the "icon" to "Neighbor in stack object 0x0000" (13th opcode changed to 0x18).

5th Feb 2011, 7:51 PM
No dice for the thought bubble, gonna try the NPCs now.

Edit: After a very long and winding road, I have discovered which sims from the NPC family are callable and which are not. I've adjusted the filter accordingly and now the phone book only lets you look up sims you can actually call. Maids you can call, gardeners you can't. Half of the Police force is callable (not sure whats going on there), firemen are not. Pizza is, Chinese is not. I have *no* idea where the logic for all this came from, but whatevs.

Also did testing with children and got them to do the correct animation as well. The only thing left is that darn thought bubble. I've done searches on MTS, and there really doesn't seem to be any information on them at all. At each different lot I test this at, a random image seems to be chosen and then they always use that instead. Its like its not reading in the correct thing. Is there a better place I can stick it in the code to make it read in the info more clearly?

7th Feb 2011, 11:13 AM
Moving it around in the code won't help much, the problem is almost certainly that we're giving it a wrong value in one of the opcodes. Problem is, it's not one of the frequently used commands, so there's not a lot of info which makes it a bit hard to pinpoint. It'll be either the icon or the model which needs to be changed, and somehow it needs to be pointing to the neighbour currently stored in Stack Object ID, but I'm having trouble pinpointing how without an object to source it from. :(

7th Feb 2011, 2:26 PM
Dangit. I hate it when I come up with a problem you can't immediately solve. My younger sisters are from that immediate gratification generation and sometimes it rubs off. lol

Ok, brainstorming time.... The telescope during the day manages to pop up a thought bubble of the nearest lot neighbor, how does it do that? Or when trying to use something and another sim is using it sometimes that brings up a person thought. Or when a really hott (or not) sim walks into the room others think about them, or when they are stinky. Sims dream about other sims, or they write about them in their diaries. Um...not sure what else. I think that telescope might have what we need though. /me crosses fingers

8th Feb 2011, 11:21 AM
Well it's definitely used in the telescope...

Not really sure about what the actual difference is, but try these operands?

9th Feb 2011, 2:45 AM
Nope, still showing that grey vertical lines picture in the thought bubble. When a sim calls into the lot and my sim answers they pop up a thought bubble with the person they are talking to, would that help?

22nd Feb 2011, 3:06 AM
I'm not making much progress on this anymore, have you Echo? I'm starting to think I need a backup plan for the thought bubble instead. I don't want to leave the object without any user notification, but I don't know how to get the sim we've looked up into a thought bubble or a notification. Maybe just use the icon for a phone call? Shouldn't it be easier to call than a variable icon?

26th Feb 2011, 10:30 AM
Sorry for taking so long! I'm pretty much failing at life this week! ;)

The new, attached version works for me. Hopefully it works for you too!

26th Feb 2011, 4:41 PM
IT WORKS!!!! I love it! Thank you so much Echo!!!! This is brilliant now.

I'm gonna try to turn down the shine on the mesh a bit and then its getting uploaded. YAY!!!! SPAZTASTIC!!!

27th Feb 2011, 2:11 AM
Uh oh, HL is reporting some issues with Basegame testing, which I expected, and with Seasons, which I did not expect.

I'm gonna do some more indepth testing and see what works and what doesn't and see if there's a pattern.

27th Feb 2011, 2:12 AM
After testing this in a base only and base+seasons AGS, both had bad gosub errors. Each one is a bit different. Attaching for someone with more brain cells than me to look at. :P

Edit: A Pets+Seasons also gives errors. :/

27th Feb 2011, 5:02 AM
HL said the problem BHAV is the one deciding which sims should be in the list. It specifically mentions sims from different EPs. Im thinking the basic idea is we need to have it check to see if that EP exists before asking about those types of sims. HL and Lee said that Numenor had lines of code that question the EP in his Postcard rack. I've got no idea how any of that works, but I copied some of it and I'm gonna hope it works...

27th Feb 2011, 7:18 AM
Yeah, I had those problems while I was testing it, but I just commented out the EP-specific lines. I didn't realise you were aiming for base game compatibility.

For the ones which are referencing BCONs, you can just substitute in the equivalent literal value, so something like:
[prim 0x0002] Expression (Neighbor's person data 0x00BA (Species) == Const 0x0171:0x01 ("Large Dog" Value: 0x0001))
[prim 0x0002] Expression (Neighbor's person data 0x00BA (Species) == Literal 0x0001

For things like the "Sim - Is Vacation Sim", you'll need to do an EP check first.

27th Feb 2011, 5:10 PM
Aim for the best! Lee said I had to try.

Thanks for the tip on the Literal value stuff. Does that mean that a Pet Value 0x0002 would become Literal 0x0002? Or am I not translating that correctly? I have a bunch of lines saying Expression (Neighbor's person data 0x009B (NPC Type) == Const 0x0132:0x08 ("Burglar" Value: 0x0004)). Does that change to Expression (Neighbor's person data 0x009B (NPC Type) == Literal 0x0008?

As for the Vacation Sim stuff, a lot of that code got put in when I was testing on a borked hood to begin with, we kept adding code but the vamps and the vacas never showed up because they didn't exist in the first place. I'll try skipping those lines and see what I get then.

I also have a couple lines of code that check for family number (NPCs and Strays), are those going to throw errors in basegame?

Later: Swapped out the code for the pets and skipped over the Townie and Vaca sims lines and there was no change in my sims list. Now it just comes down to a bunch of specific NPCs... Imma try my above guess and see what happens.

More Later: Fail. I must not be translating the constant values of the NPCs to literal values correctly. None of them showed up in my list.

28th Feb 2011, 9:16 AM
Expression (Neighbor's person data 0x009B (NPC Type) == Const 0x0132:0x08 ("Burglar" Value: 0x0004)). Does that change to Expression (Neighbor's person data 0x009B (NPC Type) == Literal 0x0008?

Wrong value. :)

Expression (Neighbor's person data 0x009B (NPC Type) == Const 0x0132:0x08 ("Burglar" Value: 0x0004)).
changes to
Expression (Neighbor's person data 0x009B (NPC Type) == Literal 0x0004

28th Feb 2011, 2:30 PM
Ahg, thwarted by something simple. Well, at least it should be an easy fix.

1st Mar 2011, 3:20 AM
I finished off the BHAVs and I think I'm ready for testing. Can I get some help testing it in basegame?

Later: I fixed all the search code for the EP sims. Upon testing in basegame it bugged out. Error: Bad gosub tree number. Then I went back and checked and changed all the 8009s to 8007s because of something I remember Pescado telling me once. That one also bugged out. Error: Search type is invalid. Types are 0: all motive, 1:mental motives, 2:physical motives. I have error logs for both and I don't know what to do to fix it.

Later: After further testing, I've found out that the current version works perfectly in every game environment except base and uni. This makes sense as uni wasn't a full fledged EP at all. How hard is it to make this basegame compatible, or should I just go ahead and have it require any EP above uni?

2nd Mar 2011, 9:20 AM
The second error (Bad gosub tree number.) is almost certainly caused by using 8009 format BHAVs in a base game (8009 type BHAVs were invented for Pets I think). You can normally fix that by re-creating the 8009 BHAVs line for line in an 8007 format. (You can try just changing the format in the drop down, but that only works some of the time).

The first error is a bit stranger though. It looks like we're using a Set To Next type in Sub - Load Sim Array, which didn't exist before a particular EP. I think you'd probably fix that one by changing it to Set To Next (Neighbor Id) and putting in a separate check on the relationship immediately after, but I can't say for sure.

Not sure why you don't think Uni was a full EP though, that's news to me! ;)

2nd Mar 2011, 2:35 PM
It was coded as the SPs are, it didn't change game version code or something. Likewise, MG is actually an EP and not an SP in the same way. I found a thread about it long time ago, think Numenor was involved. I've seen CC that requires any EP except Uni, cuz it still uses the basegame code, they didn't fix the game to handle EPs till NL. I remember where I got that from, its from a lot compatibility stand point. You can install lots that used Uni without, and you can't install MG lots without it. CC sometimes worked that way to.

I think you have might that backwards. The first error was a bad gosub. It was using 8009s and then I changed them to 8007s and got the second error when I tested the 8007s. So, you are thinking that if I change to 8007s and then fix the Set to Next I should be ok? What type of relationship check are we talking about here?

Later: I put all the 8007s back, and switched the 'Set to Next (SO id, Neighbor with 0 relationship)' to 'Set to Next (SO id, Neighbor) and followed it up with an 'Expression (Neighbor in stack object 0x0004 (relationship score) <= Literal 0x0000)'. That didn't work out so well, I ended up with an error relating to a mailbox... o.O

Object id: 197
name: N001_User00011 - Don
Stack size: 9
Error: Person data field is out of range.
Iterations: 16
Frame 8:
Stack Object id: 1
Stack Object name: MailBox
Node: 2
Tree: id 4115 name 'Sub - Do I want this sim in the list?' version -32745
Prim state: 0
Params: 1 Locals:

Can you teach me how (or link me to a resource) to read these things? I'm assuming that the first couple of frames are the important part, but I don't even know that much.

Getting kinda bummed about this silly thing now. It was so close, I have the post pictures ready already. Halps plz :(

3rd Mar 2011, 8:01 AM
This one:
explains how to read stack traces, under the part "How this relates to your error log"

Your stack trace says that:
in "Don"s stack of commands, there was an error. That error was that the "Person data field is out of range" for the current command, which was from a line the BHAV with the "id 4115" ( = 0x1013 ) which has the name "Sub - Do I want this sim in the list?". It was trying to run Node: 2 ( = line 0x02 ) at the time the error occurred. The Stack Object ID variable contained the value 1. If that were, in fact, an object ID, then it would be pointing to the mailbox. However, you're storing a neighbor ID in there, not an object ID, so the mailbox thing is a red herring this time round. :)

To see what's happened, I'll need the object. The line which is erroring is one of the lines which you changed, so I can't see it. ;)

4th Mar 2011, 1:47 AM
:wimpers: I broked it. :cry: fix?

11th Mar 2011, 9:34 AM
Hokey dokey then! Two issues:

1. Apparently, the "Species" flag didn't exist in the base game. I have put in a check to skip those comparisons if it's a base game environment.

2. You had both the True and False targets of the "Set To Next" in "Sub - Load Sim Array" pointing to the next line. That will freeze your sim permanently. ;)

The attached works in my base game, but you might want to give it a quick run through with one or more EPs, just to ensure that bypassing the species check in the base game hasn't affected any of the others.

11th Mar 2011, 6:17 PM
I just tested it in my full game, works beautifully, however after finishing the thought bubble there is a tiny jump in the sim. I'm going to look into that before posting. MUST BE PERFECT!! I also want to test out some other game configs. Thanks again!

12th Mar 2011, 8:28 PM
Sad news, still not right. I've tested in Full, Base, Uni, NL, and OFB only configs and with the exception of Uni, I got the same issue. It doesn't weed out sims I already know. Everyone is still in the list. With Uni, the sim array just never loads. I'm going to look at those lines about the sim relationship a couple more times later tonight I hope, and I'll try to get an error log up for Uni as well. I'm at my cousins this weekend; five kids under 9, it's only 330pm and they've already worn me out. I might just pass out cold around 9 instead though.

2nd May 2011, 4:21 PM
Hi Phaenoh - check out my postal mod. It pops up this dialog and fills with people you know. Happy to walk you through it if you want - sorry haven't been around a lot lately so only saw your post now.

2nd May 2011, 5:34 PM
Actually Mog, I've got this almost completely done. We had it working with popping up with only the people you didn't know before we tweaked it to be base game. I have a copy of it working perfectly but not base game, and I have a copy of it basegame with that one problem, so I should be able to combine them together. I gave it a shot the other night but got super confused.

8th May 2011, 10:15 PM
Is your call to the Dialog primitive using Node Version 0x00 or Node Version 0x01 - this dialog changed in NightLife and added a Node Version 0x01. See 0x0024.

Happy to take a look if you want - certainly this dialog can be base game compatible.

16th May 2011, 7:32 AM
Mog, I'd love your help making this basegame. Post #44 on page 2 has the most working copy; Phaenoh_Phonebook15. It's not basegame, but it filters all the sims correctly and does everything else perfectly.

24th May 2011, 5:20 AM
This, is frustrating. I keep getting a bad gosub tree number error in the basegame, even though it runs fine with EPs. I did get it back to sorting out people that we already know, so that was some progress. How do I get both? Help please?

24th May 2011, 5:56 AM
I see that some of your BHAVs are of the 0x8009 format. Echo once said that error sometimes shows up when you have a BHAV in the 8009 format but don't have a post-University EP environment (i.e. base game).

I really wish I could be more helpful, but that is just about all I know about BHAV formats.

25th May 2011, 6:03 AM
I tried that and it just gave me a different error message. Thanks for trying to help MSD. I've been wrestling with this for 7 hours straight tonight and I've found at least 20 different ways to make it not work. I don't think the code for deciding if my sim knows the neighbor sims is being run correctly. Everything else seems to be working fine. I don't think the code I tried to use for base game relationship testing is correct. Mog, I tried inserting your code from your postal system just backwards, using sims I don't know instead. Again, I couldn't get the code to read right or something cuz it just didn't work. This attached version doesn't sort sims correctly, but it is basegame.

25th May 2011, 7:41 AM
MSD is right about the 8009 format BHAVs. They will almost *never* work in a base game environment. If they do work, it's a fluke. Unfortunately, just changing the type in the drop down will not always fix the problem, so much so that in some cases the only way I've found to actually fix an 8009 format BHAV is to recreate it in a new, earlier formatted BHAV.

11th Jun 2011, 2:03 AM
I'm getting the feeling this is not likely ever going to get to basegame so I think I'm going to release it now, requiring any EP above Uni. Is that cool with everyone? Or does anyone have a Hail Mary that they can pull on post #44's version. It stands to reason that this should be possible, because the normal phone tree pulls up a list of sims you do know, so couldn't we just run the opposite and then all the creature caveats on it? Why are we using the Set To Next (Influence) that isn't basegame?