Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
*shrugs*
retired moderator
Original Poster
#1 Old 21st Feb 2008 at 11:05 PM Last edited by maybesomethingdunno : 21st Feb 2008 at 11:25 PM.
Default "Privacy - Ignore person?" bhav and clothing check
I am trying to determine if the "[global 0x0138] Privacy - Ignore person?" bhav is the right bhav I should use for an interaction.

Can someone please explain to me:
What is the required arg?
What is the "Test Object Type (Stack Object ID 0x0000, is instance of: GUID 0x50596292..." for?
What NPC types it is supposed to be checking against?

Thanks in advance.

Edited to add:
I know how to make a Sim change into an outfit linked to a custom GUID, but is there a way to check to see if the Sim is already wearing the outfit linked to the custom GUID?

In other words, if I have an interaction that changes a Sim into a certain outfit with the "change clothes spin" animation, is there a way to avoid the "change clothes spin" if the Sim is already wearing the outfit?

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Advertisement
The ModFather
retired moderator
#2 Old 22nd Feb 2008 at 1:40 AM
In Global 0x0138, Param0 = 1 means "Ignore person if its gender is same with mine".

The "Test Object Type" line checks whether the current Stack Object is a "NPC - Robot" (GUID 0x50596292); if false, then checks if it's a "NPC - Social Bunny"; if false again, checks if it's a "NPC - Therapist".

In order to check if a sim is already wearing a particular outfit, I guess you can check My (or Stack Object's) Person Data 0x0077 and 0x0078 (i.e. Outfit GUID1 and Outfit GUID2).

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
*shrugs*
retired moderator
Original Poster
#3 Old 22nd Feb 2008 at 4:11 AM Last edited by maybesomethingdunno : 22nd Feb 2008 at 5:23 AM.
Thank you for your response.

I believe I misunderstood how the BHAV is used. Somehow, I was under the impression that I could use this to see if the Sim had a certain level of privacy (e.g. "am I in good company? if 'yes', return true and proceed; if 'no', return false and end the interaction") without shooing any Sims. Somewhat like a kind of guardian bhav, I guess.

I have:
0x0 "[global 0x0126] Privacy - Shoo Sims (2 args:Literal 0x0001,Literal 0x0003)"
If true, 0x1; if false, return false
0x1 "[prim 0x0002] Expression (My person data 0x0042 (private) := Literal 0x0001)"
If true, 0x2; if false, return Error
0x2 "[prim 0x0002] Expression (My person data 0x0008 (Current Outfit) == My person data 0x0077 (Outfit Source GUID1))"
If true, 0x7; if false, 0x3
0x3 "[prim 0x0002] Expression (My person data 0x0008 (Current Outfit) == My person data 0x0078 (Outfit Source GUID2))"
If true, 0x7; if false, 0x4
0x4 "[prim 0x006A] Animate Sim (animation: "a2o-clotheschange" ...)"
If true or false, 0x5
0x5 "[prim 0x0079] Change Outfit (Target: My 0x000B (object id), source: GUID ...,"
If true or false, go to 0x6
0x6 "[prim 0x0002] Expression (My person data 0x0042 (private) := Literal 0x0000)"
If true or false, go to 0x7 and the rest of the interaction


But, my test Sim does not shoo his roommate (even with mutual 0/0 short and long term relationship) and the clothing checks are returning true when they should be returning false. The Sim is in his everyday clothes, not the GUID linked clothes.

I apologize if I am totally mixed up. It has been one of those days, when it seems best to go back to bed and start the day over again.

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
One horse disagreer of the Apocalypse
#4 Old 22nd Feb 2008 at 12:40 PM
If you get those GUIDs indexed (option on Special Buttons in BHAV editor) then the plugin will actually translate the GUIDs on the fly so you can see at a glance what object or NPC they are talking about.

To save you having to create the index every time you use SimPE, after building it, Save Index (to default file). Then there is an option in Extra, Preferences, Custom where it will be loaded automatically each time.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
The ModFather
retired moderator
#5 Old 22nd Feb 2008 at 3:28 PM
Global 0x126 (Privacy - Shoo sims) perform many checks; the sims are shooed only if really needed.
Here is a list of tests performed by the BHAV: if one of them is positive, then NO shoo is performed.
  • Am I very outgoing (>= 9 points out of 10)?
  • Am I outside?
  • For every sim on the lot: Ignore person? (If one of the following checks is positive, then the person must be ignored and not shooed):
    • Is in a different room?
    • Is a robot?
    • Is a Social Bunny?
    • Is a Therapist?
    • (Only if using an urinal) Is different sex?
    • Is child or older (i.e. not baby nor toddler)?
    • Is too distant (> 8 tiles away)?
    • (For adults/elder only) Is in love with me?
    • Is ghost?
    • Is blocked / can't move?

If NONE of the above conditions are met, then the sim is shooed (the global "Privacy - Shoo sim" performs the animations, too).

Browse the list above, and probably you will find which condition causes your sim not to shoo his roommate.

As for the clothing change, I'm not sure. However, the "spin" animation is already contained in the BHAV "Change Outfit" (your line 0x04 is redundant).
Moreover, the check I was suggesting is not the one in lines 0x02 and 0x03; I meant something like:

0x2 "[prim 0x0002] Expression (My person data 0x0077 (Outfit Source GUID1) == Literal 0xAAAA)"
If true, 0x7; if false, 0x3
0x3 "[prim 0x0002] Expression (My person data 0x0078 (Outfit Source GUID2) == Literal 0xBBBB)"
If true, 0x7; if false, 0x4

where 0xAAAABBBB is the GUID of your custom outfit (ehm... not sure if the AAAA and BBBB should be swapped -- I don't remember is the "GUID1" is the leftmost or rightmost part of the actual GUID...).

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
*shrugs*
retired moderator
Original Poster
#6 Old 23rd Feb 2008 at 7:01 AM Last edited by maybesomethingdunno : 23rd Feb 2008 at 7:29 AM.
Thank you both.

Inge Jones, I did not realize that was what that button did. I will certainly look into that option.

Numenor, when I bypass the manually added "spin" animation, it seems the outfit just appears on the Sim without the spin.

I am using Vagrant's method for associating custom clothes with custom careers (and I am temporarily using his GUID), so that with a GUID of 0x0019C600 I have:
[0x0] "[prim 0x0002] Expression (My person data 0x0077 (Outfit Source GUID1) == Literal 0xC600)"
T:1 F:2
[0x1] "[prim 0x0002] Expression (My person data 0x0078 (Outfit Source GUID2) == Literal 0x0019)."
T:7 F:2
[0x2] "[prim 0x0002] Expression (My person data 0x0042 (private) := Literal 0x0001)"
T:3 F:E
[0x3] "[private 0x1005] Privacy (4 args: Literal 0x0001, Literal 0x0003, Literal 0x0001, Literal 0x0001)"
T:4 F:4
[0x4] "[prim 0x006A] Animate Sim (animation: "a2o-clotheschange" [AdultAnims:0x0F (Private)], Event tree: --- (Private), Anim Speed: ---, Interruptible: False, Start at tag: ---, Trans to Idle: False, Blend out: True, Blend in: True, Flip Flag: False, Synch to last anim: False, Use controlling object as anim source: False, Not hurryable: False, IK Object: Stack Object ID 0x0000, Priority: 0x00 (low))"
T:5 F:5
[0x5] "[prim 0x0079] Change Outfit (Target: My 0x000B (object id),
source: GUID 0x0019C600, Outfit index: My person data 0x0008 (Current Outfit), Clear GUID pointers in person data fields: False, Save change: False)"
T:6 F:6
[0x6] "[prim 0x0002] Expression (My person data 0x0042 (private) := Literal 0x0000)"
T:7 F:7

It seems that may only work with the Everyday category. I have not tested all the categories, but while my test Sim was wearing a swimsuit, he did not change into the custom suit when I tested the interaction.

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
One horse disagreer of the Apocalypse
#7 Old 23rd Feb 2008 at 8:23 AM
Quote: Originally posted by maybesomethingdunno
Inge Jones, I did not realize that was what that button did. I will certainly look into that option.


Help|Topics|PJSE|Contents|Behaviour Function Plugin goes into more detail about how to use it.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
*shrugs*
retired moderator
Original Poster
#8 Old 26th Feb 2008 at 8:52 PM Last edited by maybesomethingdunno : 27th Feb 2008 at 10:59 PM.
Original post:
Okay, I tested it with all the clothing categories. The Sim indeed changes into the custom outfit only when wearing "Everyday" clothing. For all other categories, the Sim performs the spin animation but the clothes do not change. If the Sim is already wearing the custom outfit, the Sim does not perform the animation and the rest of the interaction is carried out as normal.

So, it would seem there may be a problem with one of the "false" returns of the "My person data 0x0077 (Outfit Source GUIDX)"?

Or, perhaps the "[prim 0x0079] Change Outfit (Target: My 0x000B (object id), source: GUID 0x0019C600, Outfit index: My person data 0x0008 (Current Outfit), Clear GUID pointers in person data fields: False, Save change: False)" bhav?

I have tried adding checks (e.g. "[prim 0x0002] Expression (My person data 0x0008 (Current Outfit) == Literal 0x000X)"), but it did not work. I looked to see what made a Sim already wearing a swimsuit skip the "change to swimsuit" in a diving board, but I could not see how to apply it to my situation.


Updated New Post:
Hooray! I may be totally wrong, but I will yell "hooray!" anyway. If this is indeed the correct solution (as it would seem to be), it was totally obvious and I should slap myself on the forehead for being so oblivious to it. If it only works with "Everyday" clothing, why not just change the Sim into "Everyday" clothing?

For easier reuse, I have split this into its own bhav so that I have:

0x0 [prim 0x0002] Expression (My person data 0x0077 (Outfit Source GUID1) == Literal 0xC600)
T:1;F:2
0x1 [prim 0x0002] Expression (My person data 0x0078 (Outfit Source GUID2) == Literal 0x0019)
T:True;F:2
0x2 [prim 0x0002] Expression (My person data 0x0042 (private) := Literal 0x0001)
T:3;F:E
0x3 My own version of the Privacy Bhav
T:4;F:4
0x4 [prim 0x006A] Animate Sim (animation: "a2o-clotheschange" ....
T:5;F:5
0x5 [prim 0x0079] Change Outfit (Target: My 0x000B (object id), source: the sim's outfits, Outfit: Casual 1, Clear GUID pointers in person data fields: False, Save change: False)
T:6;F:6
0x6 [prim 0x0079] Change Outfit (Target: My 0x000B (object id), source: GUID 0x0019C600, Outfit index: My person data 0x0008 (Current Outfit), Clear GUID pointers in person data fields: False, Save change: False)
T:7;F:7
0x7 [prim 0x0002] Expression (My person data 0x0042 (private) := Literal 0x0000)
T:True;F:True

Now, the quick change to "Everyday" was not visible in my test. Under "normal" gameplay in which there may be some lag, I currently cannot say for certain if the "Everyday" clothing will be visible if even for a fraction of a moment. If such is the case, there is not much (if anything) I could do and people will either just have to deal with it or come up with a better solution for me.

Thanks everyone (and I apologize if I bloated this post too much.) :D

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
*shrugs*
retired moderator
Original Poster
#9 Old 29th Feb 2008 at 8:52 PM Last edited by maybesomethingdunno : 29th Feb 2008 at 9:00 PM.
Sorry for the double post, but I felt like a new thread for such a small and somewhat related question was perhaps just as bad.

My interaction should be base-game compatible; I have all the EPs unchecked in the FileTable in SimPE for cloning. But, I have been doing many of my testing in my full game environment. I tried the interaction with a Servo and the game crashed after the Servo changed into the custom clothes and then later tried to change back into its normal "Servo-suit" (it seemed to be caught in "clothing change" loop of some kind with a dresser).

So, I want to add the "[global 0x04B4] Robot - Sim Is Servo? (2 args...)" bhav to determine if the Sim is a Servo. If the current Sim is a Servo, it will not change clothes for the interaction. But, I do not understand what the two args should be.

I have followed the code to the "[prim 0x007E] Lua (Script: "Robot - Is Sim Servo" [LuaScript:0x3C (Global)], args: Param 0x0000, Param 0x0001, Literal 0x0000, type: Definition, definition in: objLua file)" bhav and I have looked in several objects, in the semi-globals, and on the forums, but I do not see where it is used to see how it is used. Any ideas?

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Retired Duck
retired moderator
#10 Old 29th Feb 2008 at 11:34 PM
That's a reference to a Lua script. Lua scripting didn't come in until the later EPs, and is still fairly uncommon. There's some info on them here:
http://www.modthesims2.com/showthread.php?t=90095
*shrugs*
retired moderator
Original Poster
#11 Old 1st Mar 2008 at 6:23 AM Last edited by maybesomethingdunno : 1st Mar 2008 at 6:28 AM.
A Lua luau for me, then?

Okay, bad jokes aside...I cannot say I have read all of AdidasSG2's ".pdf" file on the subject, but I did read the beginning parts and the more TS2-specific area (around page 22 and onwards) at the very least.

Since the "[prim 0x007E] Lua (Script: "Robot - Is Sim Servo...)" bhav seems to have all its operands in place except for those two parameters for (Op7 and Op8 as well as Op 10 and Op11, right?) to be passed in via the global, I still need those args.....which I assumed I would find hinted at in the Lua script.

Looking at the ObjectScripts.package in C:\Program Files\EA GAMES\The Sims 2 Open For Business\TSData\Res\ObjectScripts, I see:
"...0B": SELF: {R5} = {R4}; {R4}[verifyNeighborId]" and
"...25: SELF: {R6} = {R5}; {R5}={R5}[getObjectGUIDFromObjectID]"

...so would I use "0B" and "25" as my args? Or am I completely wrong and/or completely misunderstanding the nature of Lua and what I am supposed to be doing?

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Retired Duck
retired moderator
#12 Old 1st Mar 2008 at 6:38 AM
Hang on, do you just need to know what parameters to put in for 0x04B4?

[global 0x04B4] Robot - Sim Is Servo? (2 args:
Sim ID=0x0000,
Use nID?=0x0000)

My guess, put the sim's neighbour ID in the p0 and literal 1 in p1. If that doesn't work, change p1 to 0. One or t'other ought to do it. Then you don't have to touch lua at all!
*shrugs*
retired moderator
Original Poster
#13 Old 1st Mar 2008 at 7:34 AM
"[global 0x04B4] Robot - Sim Is Servo? (2 args:My person data 0x001F (neighbor id), Literal 0x0001)" seems to work perfectly. Thank You!

Correction of previous post: I repeated the Servo-dresser issue and the crash seems actually to take place when the Servo is changing from the custom outfit to the Servo formal wear (not into the normal Servo-suit). I do not know why the crash takes place, but I rather add this Servo check than create a game-ending scenario.

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Back to top