PDA

View Full Version : "In Use?" Cause of disabled school desk?


fway
12th Apr 2010, 7:25 PM
Here's the story: I've been meshing like crazy and decided to make a "school"-ish set by creating objects relating to school, particularly High School and all that. I've made a "school desk" by cloning the stripey chair from the base game and adding slots for the desk part. I found out after placing decorative objects/functional items that the option to sit was disabled.

However, when a Sim sits down, objects are allowed to be placed on the new slots. I realize that the chair itself has a container slot for sims to sit on, but it should not affect the deco slots at all.

I took on a couple troubleshooting tips by creators from the #create chat.

1. Making a new practical for the new container slots. (Didn't seem to work, but helps organize.)
2. Looking up several BHAVs
The ones that stuck out to me were:
--"Goal Check"
--"In Use?"
and Most Importantly:
--"All Slots Empty?"
--or "Slots Empty in This File?"

Now I get stuck as far as the coding goes, but I know it has to do with one of those instructions the BHAV has. I've understood Echo's tutorial as far as using a wizard goes. I think the only problem is knowing how to code the operands and all that. When I see "Expression Stack Object (0x0000)" (I just made that up) I freeze and am stuck. I've looked for a list of "operands", strings, functions, BHAVs, etc. and I seem to be put in circles with it. I think if I understood terms like Literal, stack object, etc I could have a better understanding of hacking.

Edit:
On an unrelated note, sims seem to enter my chair by walking through the metallic arm. I only want them to enter from the right (if the desk is facing the player). What sort of BHAV function would I have to find/create in order for them to stop walking through the metal arm of the chair? Is it the one seen in Echo's tutorial?

GeneralOperationsDirector
12th Apr 2010, 8:49 PM
Well, you might need to update the footprint to make the space in front of the chair unwalkable, and add a routing-slot to the "left" side of the chair as viewed by the occupant.

I`m not sure what BHAVs you need, but "All Slots Empty" does NOT sound useful to me in this context; instead, I think you want one that checks if a *specific* slot is empty.

What happens to the option to Sit if you place objects on the desk while it is occupied? Can the occupying Sim get up and Sit again? Where does the first decorative object go when no Sim is in the chair? Does it go where the Sim sits, or on the desk-arm? Does the object have a Guard Function on the Sit menu item?

fway
13th Apr 2010, 6:43 AM
Well, you might need to update the footprint to make the space in front of the chair unwalkable, and add a routing-slot to the "left" side of the chair as viewed by the occupant.
I believe I set all the routing slots' translations to the same as the "east" one, unless *somehow* it got reverted back.



I`m not sure what BHAVs you need, but "All Slots Empty" does NOT sound useful to me in this context; instead, I think you want one that checks if a *specific* slot is empty.

I was considering this as well. The only thing is I'm not sure how the BHAV function recognizes a specific slot.


What happens to the option to Sit if you place objects on the desk while it is occupied? Can the occupying Sim get up and Sit again? Where does the first decorative object go when no Sim is in the chair? Does it go where the Sim sits, or on the desk-arm? Does the object have a Guard Function on the Sit menu item?

With debug mode on:
The sim is still able to sit, and the sit option is still there (probably because the sim occupied the chair first), and he can get out fine without any error, but once he gets out of the chair he can no longer re-sit in that desk until I remove all of the objects from that desk. The guardian for both sit and stand is BHAV 0x2004 "Interaction - Sit - TEST" It says that if the tree is identified, then it considers the object a chair. He can sit from the left or right, I don't think he could sit from the front.

GeneralOperationsDirector
13th Apr 2010, 3:59 PM
Re routing slots: ::shrug:: Perhaps if you set the footprint to disallow walking on the other side of the chair?

Re checking specific slots: Alas, neither am I. :|

Is that gardian BHAV embedded in your object? If so, can you post a listing of the BHAV? I`m curious about it, as it seems to be saying that the object is not sitable when the deco slots are occupied. The listing of the Sit menu item handler might be of interest as well, for reasons related to the faulty lack of inability to sit through the arm.

I`d still like to know where the first deco object goes when the desk is unoccupied.

I guess that`s about it for now. ;) Good luck with it! :up:

fway
13th Apr 2010, 6:29 PM
The first deco slot's x is at -.22 and closer to the head of the desk. I did follow Echo's tutorial on having sims stop walking through an object and applied it to my desk. However, I have to re-read the beginning of echo's BHAV tutorial, because there was a part at the beginning on how a sim could walk toward an object. "In use?" is not what the BHAV is, but however a part of the "Interaction - Sit - TEST" BHAV.

Thank you. This is probably the only problem I've had so far when it comes to something as complicated as this.

I've also attached the file in my first post if you want to have a look-see.

GeneralOperationsDirector
13th Apr 2010, 6:52 PM
Oy vey, what a mess! That looks like standard EA spaghetti code, for certain! Also, it was difficult to read, as it looks like you gave it a 50% image reduction just to get it to upload, and the severe unsortedness of the code only makes it worse, especially when the transition arrows cross between the two images. Still, I`ve given it a quick once-over, and I did see something that would guarantee that your seat could not be used when there are deco objects in the deco slots. If this guardian BHAV is NOT in your object --and judging by the 0x2004 BHAV code listed in ScreenShot271.jpg, I`m guessing that it is a global function-- you need to copy it into your object, give it a private local BHAV ID, set the new copy as the guardian function, and alter the call to "All Slots Empty". What you would want to alter that instruction TO is something I cannot help you with at the moment, but as written, if that BHAV returns False, which it will if *any* slot is occupied, the guardian function will return False and the Sit menu will NOT appear at all. As this is the exact symptom you describe in your opening post, this is obviously the place to start fixing it. Good luck! :up: