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!
Quick Reply
Search this Thread
Sockpuppet
Original Poster
#1 Old 27th Apr 2008 at 11:35 AM Last edited by Kabuto : 13th May 2008 at 7:11 PM.
[RESOLVED] Run Tree by Name("CT - Warmth Modifier") doesn't load my private function !
Hi,

about my cool water shower, I've got imported the "CT - Warmth Modifier" function and change the group ID to 0xFFFFFFFF !
But the game ignore it and load the global one.
Why it doesn't load my private function ?


TTAB call "Interaction - Take Shower" (global) which call "Take Shower Loop" (global) which call "Run Tree by Name("CT - Warmth Modifier")".


[prim 0x001C] Run Tree by Name (Tree name: "CT - Warmth Modifier" [NamedTree:0x0B (SemiGlobal)],
Search for BHAV: Private SemiGlobal,
push onto my stack by guid (in temp 0 & 1),
args:
Literal 0x0026, // Cool/Warm Interaction: 0x26 Warm-Bath/Bubblebath
Literal 0x0000, // #Loops Per Increment
Literal 0x0000) // if >0 , Person ID
Advertisement
Retired Duck
retired moderator
#2 Old 28th Apr 2008 at 11:40 AM
"CT - Warmth Modifier" gets called on the "Controller - Temperature Receptivity" object, not on the shower. If you look in the "Take Shower Loop" function, you can see that the line directly before the RTBN was checking that the object had the GUID 0xD216EE01, which is the controller, not the current shower.
Sockpuppet
Original Poster
#3 Old 28th Apr 2008 at 8:18 PM
And ???


So I must to do my local "Interaction - Take Shower" and "Take Shower Loop" in order to put the code of the "CT - Interaction - Make Snow Angel" function ?

[prim 0x0020] Test Object Type (Stack Object ID 0x0000, is instance of: GUID 0xD216EE01)

[prim 0x001C] Run Tree by Name (Tree name: "CT - Warmth Modifier" [NamedTree:0x01 (Private)],
Search for BHAV: Private SemiGlobal,
push onto my stack by guid (in temp 0 & 1),
args:
Literal 0x0001,
Literal 0x0000,
Literal 0x0000)
One horse disagreer of the Apocalypse
#4 Old 28th Apr 2008 at 8:27 PM
Yes, import those BHAVs so you can adapt the entire chain of calls to call your own CT Warmth modifier. Now as you have a local version of it, there is no need to use Run Tree By Name - simply call the BHAV directly.

Why not actually add a menu option to have a cool shower as a seperate option?

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Sockpuppet
Original Poster
#5 Old 28th Apr 2008 at 10:45 PM Last edited by Kabuto : 27th May 2008 at 11:00 PM.
It's a good idea, it's better than another clone because it would extend any existing shower/bath !

But I'm still a beginner, I need to do more tests !


About the cool shower, finally I do my private copy of the "Interaction - Take Shower" and "Take Shower Loop" functions and call the Run Tree by Name("CT - Warmth Modifier") because just I need to change the arguments !

[prim 0x001C] Run Tree by Name (Tree name: "CT - Warmth Modifier" [NamedTree:0x01 (Private)],
Search for BHAV: Private SemiGlobal,
push onto my stack by guid (in temp 0 & 1),
args:
Literal 0x0007,
Local 0x0003,
Literal 0x0000)

So I choose the coldest interaction Param0 = 0x7 (Drink lemonade), Param1 = Local3 (#Loop) and Param2 = 0x0 (No Person ID) !

Local3 = 0x0 but Local3 = Temp0 after Run Tree by Name("CT - Warmth Modifier") was called ! It's based on the "Interaction - Drink" !

I don't know if it is necessary, most of time just the Param1 = 0x0 !
Field Researcher
#6 Old 1st May 2008 at 10:38 AM Last edited by CtfG : 1st May 2008 at 10:43 AM.
Some of my running projects also demand new privates and semiglobals, and maybe it is a bit of help what I found out about these.

1. There is a big difference between custom objects ( Group 0xFFFFFFFF ) and modifying game objects ( no modificiation to group number). If you want to mod an existing game object in only one or two aspects, add a new private / semi and set its instance to the highest possible number (usually 0x000010FF for privates, and 0x000020FF for semi). But stick to the existing group number! Changing the group number in BHAVs / BCONs that refer to a non-cloned object will always fail (finding this out cost me some precious hair *laughs* )

2. Sometimes, 0x10FF and/or 0x20FF don't get accepted. Then turn back to 0x107F or 0x207F resp. Though "The Sims 2" occupies lots of Gigabytes on the HD, some BHAVs and BCONs can only be adressed up to ....7F. ( I tried adding a new global BOON at 0x0180 - and failed. It was neither accepted nor recognized.)

3. If you just want to add a pie menu option, follow Inge's suppestion or "Add/Change the Action string" with your new option. Add a new Pie Menu String like "Dynamic Menu" or " *Shower1 ", set the Guard BHAV to your TEST BHAV, including the call 0x0109 (Hide Menu) when the outcome of that test if FALSE, and set the Action BHAV to the Private / Semi you want to be executed. In your own TEST ( or Guard ) BHAV, you then enable the Pie Menu Option with "Add/Change".

4. Echo mentioned an interesting point. With "FreeTime", Maxis is turning away from "direct adressing" through BHAVs, and moving closer to using controllers, which store certain interaction parametes and also the affected sims' IDs. Since "The Sims 2" base game contained a lot of code from "The Sims 1", I strongly assume that "The Sims 3" will solely use controllers, because then there will be no more "single" lots in the hood, but just one great hood. Almost the whole "Romance" system (flirt, hug, kiss etc.) was changed to these controllers with "FreeTime". There is no more direct "Kiss Sim B", but a lot of "Store SimA nID, SimB nID, Interaction-Code-For-Kiss in this controller". Next, this controller initiates the actual kiss by adressing SimA and SimB. (Just as a crude and rough example.) It might be a good idea to spend some time investigating these controller thingies

Let Teens Live Alone With TeenStar PC
Let Teens Adopt A Baby/Toddler/Child
>>> Check my profile page for further hacks <<<
Retired Duck
retired moderator
#7 Old 1st May 2008 at 11:29 AM
Quote: Originally posted by CtfG
4. Echo mentioned an interesting point. With "FreeTime", Maxis is turning away from "direct adressing" through BHAVs, and moving closer to using controllers, which store certain interaction parametes and also the affected sims' IDs.


Controllers have been around since TS1, I haven't noticed them becoming any more common over time...
One horse disagreer of the Apocalypse
#8 Old 1st May 2008 at 11:36 AM
Just a caveat with adding new custom semiglobals - if everyone followed this advice and simply used the highest acceptable number, all those hacks would clash! Every now and again I mention that we could do with a registry for custom globals and semiglobals, like we have for GUIDs. In the meantime, choose an instance number at random which is sufficiently high to clear any that might be added with future EPs. That gives the least chance of a clash.

WRT custom globals, I asked around a while back and the only modders I know who use them are myself and Jase. I am using the 0x900 range, while Jase uses the 0x500, 0x600 *and* 0x700 ranges (for inteenimator)

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Field Researcher
#9 Old 1st May 2008 at 12:44 PM Last edited by CtfG : 1st May 2008 at 12:51 PM.
You're right, Inge. That's why I started to document all resource with their numbers in CtfG's older hacks and in my own hacks and include this documentation in the upload. Sooner or later this surely will conflict if it doesn't get organized.

@Echo: I noticed the rise in using controllers with the social interactions in FreeTime. Almost all of them now check in BCON 0x0100 for min/max relation values and then "Push Interaction" via controller. Before FT, this all was done right in the corresponding BHAV.

Let Teens Live Alone With TeenStar PC
Let Teens Adopt A Baby/Toddler/Child
>>> Check my profile page for further hacks <<<
Back to top