They do it this way, so it *can* be changed easily without having to change the code in hundreds of BHAVs that all affect the same traits. They simply alter the numbers in a single BCON slightly, and all BHAVs can then use the new values. That's what make modding a lot simpler in many cases.
The value 0x02EE is a hecadecimal (base-16) number, translating to a decimal value of 750. In the personality screen, we normally see only ten blips per trait, so it ranges from 0 to 10. But in reality, each of these blips represents 100, so the TRUE range of each personality trait is from 0 to 1000. 750 in this case means that the sim must have a minimum of seven blips, and half of the eighth to pass this test.
Does this help, @gummilutt?
What is the operand for a literal value, that's held inside the BHAV rather than a BCON? Is that what literal value is for?
If the answer is that it can check BCONs with different group, how does one make it do that? I've only ever seen it list instance number and then line in the BHAV, never anything about group.
However, if the objects are all diverse and have nothing in common, you'll be in trouble. Well, there *was* a way, by means of a BCON in the GLOBAL group. But alas, the EAxians have made that impossible by claiming ALL possible BCON numbers in that group for themselves. They're really ALL used up, and you cannot make a new GLOBAL BCON to save your life.
Now here is the big thing. All BHAVs and BCONs belonging to a single object have - as you may have noticed - a Number in the 0x20xx range. All semi-globals, however, have numbers in the 0x10xx range, and true GLOBALs use the 0x00xx range.
Now since there is only ONE true Global group, using a global BCON is as simple as just using the correct instance number, its personal ID, so to speak. The BHAV will know where to find that.
But with SEMI-Globals, the situation is a little more complex. There are as many semi-global groups as there are different categories of 'objects'. So the object needs to have an file of type GLOB - a semi global file - in which the group instance number of the associated semi global group is defined. Once that is set correctly, you can simply act as if you're dealing with a local or global BCON again. You just use the appropriate BCON number in the 0x10xx range, and the game will know in which semi-global group to look for that BCON.
Hoping this helps,
If I have to I'll just have to make separate BCONs for each object, it'll be more cluttered than I personally like and take longer for the user to setup, but not much I can do about it. Would you mind if I sent you a PM with a few questions? I don't want to talk about it openly until I'm further along the process of making it
So, if all the objects are of the type 'chair', you'll end up making your BCON in the group named "ChairGlobals".
Personally, I would open the latest Objects.package - M&G in my case -, look for the object by name and finally use a filter to isolate the entire group. But indeed, cloning would also work.
Once you know that it works this way, it isn't really very hard whichever way you do it.
Personally, I would prefer keeping the conversation as public as possible, but a single PM would not really be a problem as long as you can keep it brief. ;-)
The project involves editing guardian bhavs, just like the snooze one, and I think I need to know more about what it does and what code in it will actually mean. I don't know them enough and I can't always rely on you or someone to go over my work.
What is the purpose of guardian bhavs? I understand that it tests things, but with what purpose? From what you said in the other thread it sounded like it's purely to decide if the menu option should be available or not. But that doesn't seem to always be the case. For example, the same object test in the snooze test hid the option if it came back false, but the personality check in the first post of this thread was also in a guardian bhav and the option appears even though my test Sim has 0 playfulness, after I removed the hide menu line from it.
What I want to be doing, in the end, is making the guardian reject autonomous use of the action, but not player-directed use. I've been looking a bit at other mods that do that, but conflicting information has made me confused.
EDIT: Having poked around more, I've answered some of my own questions. I see now that guardian bhav checks do apply in all situations, I just wasn't following the true/false stuff properly earlier and misinterpreted what I saw. Am I correct in understanding that guardian BHAVs are there to check if the menu option should appear, and nothing else?
How does one go about setting a check in guardian that only stops autonomous behavior, not player-directed? Like I said I've been poking around at mods that do that, but so far I haven't been able to figure it out.
The Guardian BHAV has only one function: to make sure that only sensible options appear in the context menu. If you click another sim - for example - you expect to get all kind of social interactions available, right? But you *ONLY* get interactions that make sense with respect to the height of the current relationship between your sim and the other.
Now how is that done? There is a huge TTAB somewhere that contains ALL the social interactions that you could imagine. When you click the other sim, the system will try to populate the menu with those. For each of the interactions in this TTAB, it finds the Guardian BHAV and runs that in order to find out if the accompanying option may be added to the menu. If your sim's relationship to the other, for example, is not romantic in nature, or they have only just begun flirting and are not enough in love yet, the Guardian BHAV belonging to the "Kiss.../Make Out" option will result in a False, and therefor the "Kiss.../Make Out" will NOT appear in your menu. And similar tests will be done for all other options to try and find out which will appear on the menu and which won't.
When you click an object, however, the Guardians of the relevant interactions may test if the sim is even in the same room as the object, or if the sim is fit and strong enough to do what the object would allow him to do. For example, my "Smustle Limited" mod contains an edited Guardian BHAV that makes sure that autonomous smustle is only available to downtownies, or when you are playing in downtown. And even then, it will only give TRUE if the sim is in a room where music is actually being played! Even if you try to direct the sim, you can not order them to smustle in a room without music.
The Guardian will also be run when the system is trying to determine what options the sim could choose from when it is not being directed - the so-called autonomous actions.
Now for your question about autonomous versus user-directed actions... this is one that may actually puzzle you. I even have to look it up myself now... Hold on, I'll be right back to edit the message...
ETA: Ah, THERE it is... When the system starts a guardian BHAV, it sets the variable named Param 0x0000 in the following manner:
- When you clicked another sim, and it is trying to build up a menu for you, the Param will be set to the value 0 (zero)
- But when it is checking whether the sim can do something autonomously (i.e. you're not directing it at present), then the Param will be set to the value 1 (one)
So effectively, in a Guardian BHAV, you can find out if a sim is autonomously acting with one of the following simple tests:
- [prim 0x0002] Expression (Param 0x0000 == Literal 0x0000)
- [prim 0x0002] Expression (Param 0x0000 <> Literal 0x0001)
Either of the above tests will result in TRUE if you are directing the sim, or FALSE when the sim is autonomous.
And if you use either of the following:
- [prim 0x0002] Expression (Param 0x0000 <> Literal 0x0000)
- [prim 0x0002] Expression (Param 0x0000 == Literal 0x0001)
Either of those will result in TRUE if the sim is autonomous, or FALSE when you're directing them...
There *is* also a global BHAV named "Autonomous - Am I?" or something to that effect, but that one does NOT work properly when accessed from a Guardian. So you are advised not to try that, because you will be disappointed with the result.