Simblesse Oblige Forum Index Simblesse Oblige
Forums for serious Simmers to share knowledge about The Sims 1
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Enable Children and Visitors to Cook Autonomously
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Simblesse Oblige Forum Index -> Hacker's Hideout
View previous topic :: View next topic  
Author Message
XANA
Member
Member


Joined: 15 Jan 2015
Posts: 87

PostPosted: Tue Nov 29, 2016 3:43 am    Post subject: Enable Children and Visitors to Cook Autonomously Reply with quote

Hi Everyone,

I'm trying to enable children and adults (including NPCs) to cook autonomously. I figure I can modify some IFF data somewhere to not check for 'Am I a Child?' or similar to enable this.

However, my problem is that I don't know where the BHAVs for uncooked food are stored. I looked under the fridge IFFs but they do not have the uncooked food BHAVs and neither do the FoodSB/FoodHD.iff files.

I also looked in Food.iff under the global Objects, and that got most of it working.

I got sim children to cook autonomously by modifying the Am I a Child? line to not read false, but now the problem is that when visitors interact with the fridge and pull out a food object (like the group meal), it just disappears immediately and costs money.

Where would you suggest I look next, so that I can stop the meal from deleting itself?

Thanks for your help! smile
Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4075

PostPosted: Tue Nov 29, 2016 8:23 pm    Post subject: Reply with quote

"my person data Person Type Equals? Constant 8196:0" checks to see if the sim is a family member.

0 is resident
1 is visitor
2 is NPC
5 is HP party crasher

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
XANA
Member
Member


Joined: 15 Jan 2015
Posts: 87

PostPosted: Wed Nov 30, 2016 12:01 am    Post subject: Reply with quote

Hi Raeven,

Thanks for responding!

I already changed that line (#1 in BHAV 4198 in Food.iff) to call line 2 each time [whether True or False], but the food still immediately disappears.

It happens as soon as the visitor pulls out the uncooked group meal and closes the fridge door, so I think I must be missing a check somewhere.

What could be causing the food to delete itself like that?
Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4075

PostPosted: Wed Nov 30, 2016 3:43 am    Post subject: Reply with quote

BHAV 4198?

Meal making is a whole set of steps that involves many objects. Basically the fridge kicks it all off when the player clicks it (or Sims chooses it through free will) but after its done it's part the food itself is the object in control, directing the Sim to find an object to use for food prep.

That object (counter, food processor, etc) takes control of the operation to instruct the sim HOW to prep food (shovel into the food processor, cut with knife, anything else one can dream up). When that stage is done the food takes over again and instructs the sim to find an object appropriate for cooking food.

Like the 2 appliances before it, the cooker now takes over the operation. When the cooking stage is done the food takes over once more and tells the sim to seek out a object for serving food.

The serving surface takes over briefly to instruct the sim on serving the food (aka how to route to a counter and place the platter down) and then the food takes over a final time sending out a "come and eat" to all of the sims.

When a sim takes a plate form the food the group meal instructs them how to do that but then the single plate instructs them to search for an object for eating food.

The eating surface takes over to get them settled into their seats (or whatever you can dream up) and then the single meal takes over again so they can actually eat.

When they are finished eating the meal the single meal tells them to look for an object to dispose of the plate (dispose by sink or by trash depending on what type of food it is)

The disposal unit then takes over the operation instructing the sim how to dispose of the single meal and deleting it from existence.

The End.

All of those steps need to allow kids and visitors. You already know that everything after a meal is served works for both of them so all of that can be ignored, of course. That leaves 5 objects and 7 steps to check on.

Fridge --> Food (to be prepped) --> Food Prep Object --> Food (to be cooked) --> cooker --> Food (to be served) --> Serving surface.

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
XANA
Member
Member


Joined: 15 Jan 2015
Posts: 87

PostPosted: Wed Nov 30, 2016 5:21 am    Post subject: Reply with quote

Hi Raeven,

Thanks for the detailed post!

Fridge - Using a C&C fridge, edited to enable all menu options for visitors, children and adults. Fridge does not have further checks that required editing. Children can successfully obtain an uncooked group meal autonomously and manually directed. Visitors can not obtain an uncooked group meal without it deleting itself immediately.

Food - In Food.iff, BHAV 4198 'prepare food' change line named 'Am I a Child?' to call the same line for both True & False. The result is that children can now move on to prep & cook steps. Previously, the action to 'Prepare' or 'Cook' would drop out of the queue, while after the modification those actions work as they should for children. Visitors do not have these actions available if they made controllable.

Food Prep (processor etc.) - Using the C&C food processor.

Food Cook (stove etc.) - Using the C&C colonial stove.

Serving Surface (counter etc.) - Using the SSoW Convert-to-Serving-Surface object.

As far as I can tell, the problem might relate to the observation that visitors do not have any possible interactions with uncooked group meals (as an example). The 'Prepare' / 'Cook' interactions, even the 'Clean Up' interaction, are not available.

I suppose the next step is to enable these interactions for visitors. Where does the game obtain 'Prepare' and 'Cook' from? Is there a TTAB (Tree Table) with these actions entered inside?

I looked at every one of the food files and they only have the 'Eat' and 'Clean Up' interactions entered inside the TTABs.
The 'Clean Up' interaction is strange because it already is in an editable TTAB and checked for visitors. Yet, it is not available when I try to direct a controlled visitor towards an uncooked group meal.

I surmise that uncooked food has its own Tree Table somewhere that I have not edited yet.

Thanks for all your help! :)
Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4075

PostPosted: Thu Dec 01, 2016 7:20 am    Post subject: Reply with quote

Raeven wrote:
BHAV 4198?


In the unmodified food file BHAV 4198's second line is "my person data Person Type Equals? Constant 8196:0" (though the lines show out of order before you rewrite the BHAV). This line's false return stops visitors from being able to proceed with food prep.

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain


Last edited by Raeven on Thu Dec 01, 2016 7:49 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4075

PostPosted: Thu Dec 01, 2016 7:31 am    Post subject: Reply with quote

Quote:
I suppose the next step is to enable these interactions for visitors. Where does the game obtain 'Prepare' and 'Cook' from? Is there a TTAB (Tree Table) with these actions entered inside?


Coding in the food file scans objects looking for ones with the appropriate function points. it chooses the the best one.
Quote:
Find Best Object for Function (prepare food)

It then tells the Sim to use that object according to the BHAV(s) listed in the object's function table (OBJf) for that function.
Quote:
Run Functional Tree (prepare food, change icon)

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4075

PostPosted: Thu Dec 01, 2016 7:37 am    Post subject: Reply with quote

Quote:
I surmise that uncooked food has its own Tree Table somewhere that I have not edited yet.


No, uncooked is simply a state the food is in, not a separate file.
The state is defined by an attribute value.

http://workshop.woobsha.com/TheDrawingBoard/viewtopic.php?f=33&t=115

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
XANA
Member
Member


Joined: 15 Jan 2015
Posts: 87

PostPosted: Thu Dec 01, 2016 8:26 am    Post subject: Reply with quote

Raeven wrote:
Raeven wrote:
BHAV 4198?


In the unmodified food file BHAV 4198's second line is "my person data Person Type Equals? Constant 8196:0" (though the lines show out of order before you rewrite the BHAV). This line's false return stops visitors from being able to proceed with food prep.


I enabled debugging objects (add -debug_objects to the shortcut in the Start Menu) and now there is a more complete reproduction of the issue. The game says a 'tree break' occurred when my visitor pulled out a plate of uncooked food from the fridge.

The text file is attached. Maybe now there might be something to go on. :)

Also: If I skip over the Break Point in 'do new adult idle' (PersonGlobals BHAV 8330), what then happens is that the visitor can pull out an uncooked meal with no tree break error.

However, the food prep interaction drops off their queue immediately afterward, leaving them standing there with uncooked food in their hand.

If I force them to drop the food somehow (through manually controlling them with a visitor controller), they can interact with it normally and finish the process. They seem unable to continue with it autonomously.

How can I stop the interaction to 'Prepare' (for uncooked group meals) or 'Cook' (for uncooked light meals) from dropping out of the visitor's autonomous queue?

Edit: Remove the attached files as we don't need these versions anymore.


Last edited by XANA on Sat Dec 03, 2016 9:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4075

PostPosted: Fri Dec 02, 2016 4:27 pm    Post subject: Reply with quote

Don't skip over break points. They only happen when something before that gores wrong. Think of them as a debugging tool.

debug mode only really helps the person who has the code in front of them. It tells the type of error (best it can) and the location but taking out of context is not always helpful. One terminating in a break point would be one of those cases because it means something happened earlier that caused the code to travel down the wrong tree toward the breakpoint. It never should have ended up there in the first place.

As far as I know you should not need to do anything in the global at all. Most things are self contained. The global file is simply a library of super common bits of code that a myriad of objects can use. Something as specific as a child or visitor being allowed to perform a specific operation on a fairly specific object would not be in the global.

Semi-globals are slightly more specific but should still be designed to be used by a bunch of different objects in that category (art, seating, lighting)

I'm not understanding the issue.
Are you saying that matching the false return to the true return on your person type line did not? Or did you not match the returns on that .ine and are off trying other things?

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
XANA
Member
Member


Joined: 15 Jan 2015
Posts: 87

PostPosted: Fri Dec 02, 2016 5:30 pm    Post subject: Reply with quote

Raeven wrote:
Don't skip over break points. They only happen when something before that gores wrong.


Got it. I'll return the line where I skipped the break point back to normal.

Raeven wrote:
I'm not understanding the issue.
Are you saying that matching the false return to the true return on your person type line did not? Or did you not match the returns on that .ine and are off trying other things?


That is exactly what happened. I matched the false line to the true in 'my person data Person Type Equals? Constant 8196:0' in Food.iff and it did not allow the visitor to autonomously make a group meal.

Instead, the visitor is reset (which is I figured what was happening when the break point fired off). The food disappears.

I have not changed any other lines in Food.iff except for the 'Am I a Child?' line [and of course the previously mentioned one] in the 'prepare food' BHAV. I'm only working with Food.iff. There must be something in Food.iff that is firing wrong.

I only took a look at PersonGlobals because the error said that was where the error showed up. I have to wonder why is line #3 'My Slot 0 Not Equal to 0' in 'do new adult idle' (PersonGlobals' BHAV 8330) firing True. That's the sequence that calls the break point.
Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4075

PostPosted: Sat Dec 03, 2016 12:10 am    Post subject: Reply with quote

Slot 0 in a sim = the hand.

"'My Slot 0 Not Equal to 0" returning true means they have something in their hand (in this case the food object).

This is being checked by the personglobal because for some reason the sim is trying to idle. When a sim idles one of the things that personglobals checks is whether that sim is holding something (usually a sim is not allowed to idle until after they have dealt with the object they are holding. Typically the fallback is to drop the object onto the floor).

Offhand I can't think of any reason why changing the person type line would not work out (I would expect them to simply serve a can of beans if the proplem lay with the food prep objects)

If you'd like, I'd be happy to run your food file in my game to see that I get the same results.

Actually ... go back through the object function table (OBJf) and take note of the BHAVs in that. Make sure everything listed there allows your visitor person types as well. I noticed that "food" function is 4104, a test BHAV that allows visitors access to some meal types but not others (refer to my list on my forum (linked above) for details). I don't know for sure that this is interfering but it certainly can't hurt to fix that now.

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
XANA
Member
Member


Joined: 15 Jan 2015
Posts: 87

PostPosted: Sat Dec 03, 2016 9:05 am    Post subject: Reply with quote

Hi Raeven,

Thanks for the help!

I had a look at BHAV 4104 and even then am not able to get it to work.
I was trying each line once so that I could find out which line stops visitors.

I returned BHAV 4104 to normal so that you could have a look at it here.
None of the other BHAVs identified in the Object Function Table had any Person Type lines (that I had not already seen).

I would be happy for you to try getting this to work in your own game. I'll put up Food.iff here.

The lines I marked in the file with '[C]' are the ones I modified slightly to try to make this work (like making the child and person check return the same call either True or False).

Edit: Remove the attached files as we don't need these versions anymore.

Again, thanks so much! :)


Last edited by XANA on Sat Dec 03, 2016 9:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4075

PostPosted: Sat Dec 03, 2016 4:57 pm    Post subject: Reply with quote

Just to clarify, I don't know that I'll be getting it working in my game. But by trying it in another game you get to find out if the problem is a conflict in your game. Nothing sucks more than spending days or weeks trying to fix something that (it turns out (eventually)) wasn't broken!

(By he way, marking the modified lines is a brilliant move)


XANA wrote:

I had a look at BHAV 4104 and even then am not able to get it to work.
I was trying each line once so that I could find out which line stops visitors.


As I said it is entirely possible this wont have any effect on the food prep issue. But it will need changing so no reason to not do it ow and see if it helps.

That BHAV does not "stop" visitors. It restricts them. If you refer to the list in my Drawing Board thread you will notice that the lines in this bhav are about meal types (attribute 1)
Code:
0 "my person data Person Type Equals? Constant 8196:0"

Translation: Sim is a resident. (True? goto 3; False goto 1)

Code:
1 "my person data Greet Status Equals? 1"

Translation This Sim (who we determined in line 0 is not a resident) has been greeted. (True continue with BHAV; FAlse? end the script)

The first line (0) does not stop visitors from doing anything it just checks their person type to see if it should then check their greet status. You don't have anything to change there.

You want greeted visitors to behave like residents, so in th e second line (1) you would change the True return to emulate line 0's true return.

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
XANA
Member
Member


Joined: 15 Jan 2015
Posts: 87

PostPosted: Sat Dec 03, 2016 5:21 pm    Post subject: Reply with quote

Raeven wrote:

You want greeted visitors to behave like residents, so in th e second line (1) you would change the True return to emulate line 0's true return.


Sorry Raeven, I don't understand this word: What does emulate mean in this context?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Simblesse Oblige Forum Index -> Hacker's Hideout All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group