Hidden pie menu options
#1 02-01-2016 
Hello everyone.

I'm currently playing a household with two elders, and I frequently use allmenus on cheat to enable one of them to snooze in the living room arm chair. They don't have room for a recliner, and I think it's much cuter for them to doze off sitting up rather than do that weird belly-sleep in the sofa. And while typing the cheat isn't such a big deal, it does get tiring since I have to turn it off after each use.

Which brings me to my question. I thought I'd go and see if I could mod the pie menu to show the option all the time, to cut out the allmenus-step. Lots of people don't even know snooze exists, since it's usually only autonomous, so making a mod that makes it visible would have the added bonus of more people finding it. Does anyone know what value in pie menu functions decides if an option is visible or not? I've tried to compare menu options that are available with menu options that aren't, but I can't find any consistent patterns. But there has to be something that decides if it's visible, that is altered when the allmenus cheat is turned on. Any ideas/suggestions?
gummilutt, proud to be a member of LeeFish since Jun 2013.

3
#2 05-01-2016 
Update on this. I thought I'd try making a new pie menu option and using the same BHAVs as the original snooze interaction, and that also came out hidden. I had a look at the BHAVs, and it turns out the guardian BHAV it calls called Interaction - Snooze - Test is what's causing the option to be hidden.

I tried not adding a guardian BHAV, and the interaction shows up and works perfectly. Eureka!

However, I now have to decide how to go about this. The easiest would be to make a global mod affecting the BHAV that's hiding it, since that would then work on every chair in game. I do think I could do that. However, the interaction doesn't work unless the Sim is already sitting down, but the option appears at all times. I think I'd be neater if it's nested under sit, so that it only appears if Sims are already sitting down.

There are two problems with that approach. The first one is that each chair has it's own TTAB, so I'd have to make one for each chair, and custom chairs would not be affected at all. Secondly, while I can make the option nest, the Sim never starts that interaction, it just keeps sitting. I tried both with guardian bhav and without. I assume there needs to be something in the BHAV that makes it start when it's a nested interaction.

I think what I'd like to do is offer both a global fix, and a TTAB fix, and let people decide if they want to use both or only the global fix. But in order to do that, I need to learn how to make the snooze interaction start running after selecting it. I'll start digging around BHAVs of objects I know works that way and see if I can figure it out, but I thought I'd post and see if any of you guys know and would be willing to help me out. Perhaps @BoilingOil?

1
#3 05-01-2016 
I'm sorry for double-posting, but I worry that if I edit the previous one it'll re-send a PM to BO due to the tag.

I've looked at it some more, and it turns out that the reason the interaction wasn't work when the Sim wasn't already sitting was due to a faulty check in the guardian BHAV. The action bhav has code directing the Sim to sit if not already sitting, but the guardian bhav for some reason had the same check but rather than directing Sim to sit it just sent false and the interaction fell away. No reason to go around editing TTABs if the interaction works even if Sim isn't sitting. I'll focus on making a global "fix" for the BHAV instead.

But since I'm still very new to this I'd be very grateful for advice on what I've done so far. I've tested it in game and it works as I want it to, but there are a few things I'm not clear on, and it'd be pretty irresponsible to share it if I don't understand it fully, even if it seems to work as I intended it to.

This is the original BHAV. What's making me uncertain if I'm missing something is 0x3 and the black line. Based on my limited knowledge that means nothing is leading to that line, and it won't run. Seems weird, since that means line 0x3-0x7 aren't used. But perhaps there's something I don't know that means it is being used? Or was someone just tired when writing this and it's never been noticed?
[Image: OriginalTest_zpselxuugdp.jpg]

This is what I edited it to.
[Image: MyEditTest_zps1k7pquie.jpg]
I imagine most people don't enable sleeping on community lots, so I thought it best that it stay hidden on community lots. I could always make a version without that part, for those who enabled sleeping. I removed 0x3-0x7 since I interpret it as not having done anything, and I left the sleep interaction line intact. I don't entirely understand what it's doing. I understand that it's some kind of adjustment related to energy. I know it's a BHAV, but even looking at the BHAV itself I don't understand what it's doing.

I guess what I really want help understanding at this point is
1. Am I missing something or is line 0x3-0x7 currently not doing anything?
2. What is sleep interaction doing?

2
#4 05-01-2016 
(05-01-2016 03:23 AM)gummilutt Wrote:  Update on this. I thought I'd try making a new pie menu option and using the same BHAVs as the original snooze interaction, and that also came out hidden. I had a look at the BHAVs, and it turns out the guardian BHAV it calls called Interaction - Snooze - Test is what's causing the option to be hidden.

I tried not adding a guardian BHAV, and the interaction shows up and works perfectly. Eureka!

I can tell you how to go about it, but you may not like it...

Completely removing the Guardian is WRONG! The guardian does not only make it a hidden interaction, but it also performs a check whether a sim can or cannot do the interaction at a specific time. Like: is the sim sitting down in a chair? Is the sim sleepy anough to snooze/drowse? Isn't there too much noise to sleep in? These are just examples of what might be tested. The actual tests might be different.
Anyway, because you removed the entire Guardian BHAV, you have disabled those tests, and THAT is why the option is now always available, even when it really, really *REALLY* should NOT :-)

So, what *needs* to be done, is to remove *only* the part of the Guardian BHAV that causes the hidden effect. But that requires you to understand how to read and edit the BHAV properly, so it does exactly what you need.

---

And now for the next message, where you post the pictures of the BHAV: as you have realised already, lines 0x03 thru 0x07 are never used. So the 'Hide Menu ()' command that you see in line 0x03 is NOT the command that hides this Interaction from the menu. And no, it doesn't mean that they forgot or made a mistake... It means that this part of the BHAV probably *was* originally connected and working, but they later moved the Hide instruction somewhere else, and no longer needed those last lines to run. If *I* were in their place, I would've removed those lines, in stead of merely disconnecting them. But that's something they NEVER do, as if they really don't give a sh*t about all the unneeded code that they foist upon us.

Anyway, what you probably need to do, is to go back to the original unedited version, then select line 0x02 (the one with the Sleep Interactions thingy), and then on the right hand side of the screen click the "view BHAV" link. Because that is actually a line calling a BHAV from the Sleep Interactions semi-global group. And THAT BHAV is probably responsible for the Hide instruction, or maybe it sends you to yet another BHAV, where the real action happens... They can show you around town for a while before you finally get to where you think you need to be... It's not all as simple and clear-cut as it may at first seem.

I hope this helps you a little (or not - evil grin :-P)

4
#5 05-01-2016 
I know that I can't just remove the guardian, I only did it to test if that was what was hiding it, and it definitely is. I am certain about that. The sleep interaction does not have anything about hiding it, and it does not point to any other bhavs either. However, it's not weird that you think so because I did a fail when showing the original one. That's not the original one, and how I managed to miss that I do not know.

The original one does the lot check, and if it's false, it goes to hide, and then performs the test - same object. That check is included in the action bhav, and done better in that one since it deals with a Sim not sitting by directing it to sit, so I definitely do want to remove it.

I'm glad I am correct about lines 0x3-0x7. That means the only question left is the sleep interaction. This is what that one looks like
[Image: sleep%20interaction_zpsn0q9ib1t.jpg]

I tried to iron it out with MTS primites pages, but I still don't understand it.

2
#6 05-01-2016 
Ok, well, don't worry about this Adjust Advertising thing... All it does is make sure that there is nothing else at the current location that the sim will like to do more. In order to do that, it checks some of the sim's motives. But now, I would *still* like to see the real original that you missed. Because you missed it again, and without it, I can not say whether what you're doing is right or not. :-)

2
#7 05-01-2016 
Of course Smile I would have included it in the last post but I had all of three minutes to write it before I had to rush off, and I wanted to reply so that if you had something to say about the sleep one you could do so while I was away. I figured I'd add the original when I got back, and so I will.

Here it is. This time taken from the objects.package to make sure I don't fail again Tongue
[Image: OriginalForReal_zps5a83uvzq.jpg]
The Test - Same Object is included in the action bhav, as I said earlier. What I did was remove the code not being used in 0x3-0x7, and the test since it's already done elsewhere and more effectively. Then I changed directions so that it only hides on community lots and then proceeds with the adjust advertising.

Thanks for the reply on adjust advertising. I'll leave it be as it is. I'd say that means my fix is done, if you agree with my editing. I'll just have to go over compatibility with different EPs Smile (Quick edit: It looks the same in objects from M&G and BG. Really fascinating that they'd ship the game with half the BHAV doing nothing, but good news for me, since that means it's compatible with all the games)

Quick question on a different project while I'm at it. As I mentioned in my other thread here I am making cleaning interactions not be autonomous, and I thought the best way to organize it is one package per object type. That way downloaders can decide which objects they want included and not. Some of them there is a shared TTAB for all objects of that type, so those are no problem, but for toilets and showers each object has it's own TTAB. Making a separate packages for each EP/SP that adds one of those would quickly get annoying for the downloader. Am I correct in assuming that it does not cause any harm to have TTABs of objects from EPs/SPs one does not have? Aside from the fact that the game reads them for no reason since you don't have them. I'll include a list of which group ID is which object for those who wish to clean them out, of course, but as long as it doesn't cause any problems I think it's better to leave it as one package.
(This post was last modified: 05-01-2016 10:37 PM by gummilutt.)

2
#8 06-01-2016 
Currently, the first line already reads: if the current lot is a comm lot, then exit immediately (F). This means that snooze is NEVER available on comm lots, not even as an autonomous choice.
Only if you're NOT on a comm lot, it will hide the option, and make it only available as an autonomous choice for the sim. So ALL you have to do, is to simply change the False Target of the top line (over at the right) to 0x0002 in stead of the 0x0001 that it currently reads, thereby bypassing the "Hide Menu ()" line.

Removing lines 0x4 thru 0x8 seems fine with me, but I would NOT remove the test in line 0x2. For all we know, this may cause the option to snooze to appear also on chairs that the sim is NOT currently sitting in. I would not risk that, if I were you.

---

As for your second question, I think it's safe to include all the TTABs, even for objects that are not currently present in the game. Because since the objects aren't there, the TTABs won't be used anyway. They will just be present for when someone later installs the missing EPs or SPs. No trouble at all.

2
#9 06-01-2016 
You're right, of course. I've removed hide object completely, and changed the community lot check to return false if true, and if false then continue to adjust advertising. I tested it in game, and the option does not appear on community lots.

You're not understanding what I'm saying about the test (or I'm not explaining it properly). You say it would possibly cause the option to appear on chairs a Sim is not sitting in. That is how it works vanilla. The option appears on all chairs (assuming you have allmenus on), but if you click it and the Sim is not sitting in the chair, the action falls out of queue and nothing happens. The check you see in the guardian bhav is faulty. The exact same check is performed by the action bhav, and unlike the guardian, if the check comes back false it instructs the Sim to go sit down in the chair, and when done, it continues with the snooze interaction. Here are the relevant lines from the action bhav.
[Image: action_zpsixmresfv.jpg]
By removing the check from the guardian, I allow the action bhav to take over this check, which is better since it's equipped to deal with it if the check comes back false. In my opinion, if the option only works when a Sim is already sitting, it should be nested under sit, but it isn't and the only way to fix that would be to rework every individual TTAB for every chair. While I'd actually prefer it to be nested, since I think that's neater, that would not help with custom chairs and would require reworking the action bhav as well, since it currently never starts if nested (I tried, as I mentioned in my second post) and modified TTABs for every chair. It makes no sense to leave the check in the guardian bhav when taking it out causes no harm, the interaction functions better and there is less code clutter. I hope that clears it up?

Thank you for the help Smile I appreciate you taking the time to go over what I did. I'll upload it soon Smile

1
#10 07-01-2016 
(06-01-2016 07:37 PM)gummilutt Wrote:  You're not understanding what I'm saying about the test (or I'm not explaining it properly).

Ah, I thought we were becoming fast friends, and then you find it necessary to insult me! :-(

(06-01-2016 07:37 PM)gummilutt Wrote:  You say it would possibly cause the option to appear on chairs a Sim is not sitting in. That is how it works vanilla. The option appears on all chairs (assuming you have allmenus on), but if you click it and the Sim is not sitting in the chair, the action falls out of queue and nothing happens.

Yes, and THAT is what would happen in your game if you remove that check as well. The system would still prevent the sim from snoozing in a chair that it is not sitting in, but why would one want to have an option that is going to fall out of the queue anyway? THAT is why the test is in the Guardian as well. It may not be as elaborate and effective, but it;s good enough to keep out an option that would not work if you selected it.

(06-01-2016 07:37 PM)gummilutt Wrote:  The check you see in the guardian bhav is faulty.

No, it is NOT. I will explain in a moment. Smile

(06-01-2016 07:37 PM)gummilutt Wrote:  The exact same check is performed by the action bhav, and unlike the guardian, if the check comes back false it instructs the Sim to go sit down in the chair, and when done, it continues with the snooze interaction. Here are the relevant lines from the action bhav.
[Image: action_zpsixmresfv.jpg]
By removing the check from the guardian, I allow the action bhav to take over this check, which is better since it's equipped to deal with it if the check comes back false. In my opinion, if the option only works when a Sim is already sitting, it should be nested under sit, but it isn't and the only way to fix that would be to rework every individual TTAB for every chair. While I'd actually prefer it to be nested, since I think that's neater, that would not help with custom chairs and would require reworking the action bhav as well, since it currently never starts if nested (I tried, as I mentioned in my second post) and modified TTABs for every chair. It makes no sense to leave the check in the guardian bhav when taking it out causes no harm, the interaction functions better and there is less code clutter. I hope that clears it up?

It was clear enough already. The thing is, in the final Snooze BHAV, the sim CAN be instructed to go sit in the chair. But the Guardian should never do that. It should only test if the option is allowed to appear in the menu! And THAT is why the order to sit down isn't there. If the guardian would instruct your sim to sit down every time the sim's menu was to be created, (s)he would recieve orders to sit in ALL the available chairs in the room while only checking what to do!

So now your sim sits in chair A, and on chair B the option *also* appears. And then what? If you select the Snooze option on chair B, must the sim get up from chair A and sit down in chair B to go snooze there??? NOT GOOD!!! THAT is why the check should stay there. It checks if the chair that the option is considered for, is also the chair that the sim is on. It should stay that way. Believe me, at some point this is going to bite you in some unmentionable place.

2


Sorry, that is a members only option