PDA

View Full Version : Parameters are doubling up


cathair2005
23rd Nov 2006, 2:34 AM
I'm running some tests on the social interaction plugin (the one that allows you to do a super duper hug), and I found this:

Parameters are passed from the semiglobals as it runs the CT - Object Menu command and CT - Object Menu but parameters are also passed from the CT - Object Menu to the CT - Object Menu command.

So which parameters does it end up using? You see, when you run a TEST tree which is what the CT - Object menu seems to be, it passed the stack object as parameter 0 and temporary 0 as parameter 1. This BHAV indeed passes temporary 0 as parameter 1 but gets parameter 0 from somewhere else - and it doesn't seem to come from the socialglobals either.

Any ideas?

Smonaff
23rd Nov 2006, 3:22 AM
Param 0 contains the Object ID of the sim that is clicked on. Anytime you click on a sim the person globals TTAB (untitled tree table Group # 0x7F01EC29 Instance 0x0081) is scanned to see which options will appear in the pie menu that pops up. One of those options is *Interaction - Object Menu (see picture). So like with any other TTAB it passes the object ID of the object that was clicked via Param 0.

cathair2005
23rd Nov 2006, 4:11 AM
Thanks for the info, Smonaff. Even though I understand this, what is confusing me is that I have a TEST tree and an ACTION tree as seen in the pic. I'm showing the BHAV files.

Interaction - Plug In Social - TEST

Parameters sent to CT Object menu =
P0 Local 0x0000 (Active sim)
P1 Param 0x0000 (Clicked on Sim)
P2 Literal 0x0000 (0)

Parameters sent to Interaction - Plug In Social
P0 Plugin Menu
P1 Category no. 56

Interaction - Plug In Social

Parameters sent to CT
P0 Local Variable 0 (Active Sim)
P1 Parameter 1 (Category no. 56)
P2 Literal 0x0000 (0)

CT - Object Menu

Parameters sent to CT - Object Menu Command

P0 Stack Object ID (Hugging Plugin)
P1 Temporary 1 (0x0001)

CT - Object Menu Command

Parameters received are therefore:

P0 Active Sim OR Hugging Plugin
P1 Category value 56 OR literal value 1

However, CT - Object Menu Command, while P1 is indeed literal value 1 choosing from the CT - Object Menu; Parameter 0 is somehow the clicked on sim.

I hope this makes sense because it has taken me a whole day to figure out and still can't grasp it.

Smonaff
23rd Nov 2006, 6:08 AM
Yeah I know it is confusing. Here's something that may help and hopefully not be more confusing.

http://www.modthesims2.com/showthread.php?p=872760#post872760

And in my previous post *Interaction - Object Menu was incorrect, it should have been Debug - Social DL test which I see you already know since it's what calls Interaction - Plug In Social - TEST and Interaction - Plug In Social.

cathair2005
23rd Nov 2006, 6:53 AM
Thank you for your help and the link :)

Um, have I made a mistake in what I said about the parameters? I see what you're saying, the stack object gets sent to parameter 0 but the stack object was set to the social plugin just before it called the action string, therefore I assumed that this was the value of the parameter.

Smonaff
23rd Nov 2006, 8:45 AM
Param 0 can be traced back to Stack Object ID 0x0000 in both Interaction - Plug In Social - TEST and Interaction - Plug In Social which in both cases is set internally to equal the Object ID of the sim that was clicked on, so CT - Object Menu doesn't actually pass anything to CT - Object Menu Command.

Also Param 0 in Interaction - Plug In Social - TEST which is passed to CT - Object Menu as Param 1 is set to 1 if the interaction is autonomous and set to 0 if it's user directed.

cathair2005
23rd Nov 2006, 10:08 AM
Thankyou again for your time. Your information has been very useful though I do disagree in one part - I know first hand from a couple of my hacks with plugins do pass temporary storage 0 to the menu command. This is how we make our menus; using temp 0 so it is passed as param 1. Anway, I'm going to ponder this some more...

Anyway, I know how to make a plugin so I shouldn't really worry it's just I'd like to know the exact fine mechanics behind it ;)

cathair2005
24th Nov 2006, 3:01 PM
Actually, Smonaff I think I'm beginning to understand what you're saying about the autonomy thing in paramter 1. This is very interesting and I discovered it today when I made an assumption. And you backed this assumption up. So thank you for your advice and feedback :)