Replies: 10 (Who?), Viewed: 3354 times.
Field Researcher
Original Poster
#1 Old 18th Jul 2006 at 9:13 PM Last edited by Max3D : 20th Jul 2006 at 2:07 PM.
Default About Menu and sims targeting
new question....
i wish to learn now the "many sims menu" works.
for example the the insiminator "quick relations" menu...
when you click on it you can select one from all sims present on the lot...

i need something like that...
to change some guest parameter with my object.

but looks a bit complex, i've watched inside some object that will use "dinamic" menu, and i've discoveret that thay have a Text list (Str#) file with something like "Hate Me../$Object"
where "object" (i suppose) will be one of the guest sims, also, there is a Pie Menu String with the "Hate Me" text that will be linked in TTAB
but how all interact ?
and also, how to explane to the game that i'm working on the selected sim and not on mine sim ?

hehe.. that maybe require a tutorial
Advertisement
Fat Obstreperous Jerk
#2 Old 19th Jul 2006 at 3:11 AM
Dynamic menus like this are generated in the test tree with the Action String (0x32) primitive. The entry used in the Pie Menu is thus a placeholder and is never used. Try dissecting some of my various objects that utilize this functionality for details.

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Field Researcher
Original Poster
#3 Old 19th Jul 2006 at 1:23 PM Last edited by Max3D : 19th Jul 2006 at 10:12 PM.
so.. once i've set the submenu string "Friend.../$Object" in both pie menu
in bhav i will call it with OpCode 0x0032
on this way my target will bhe the one selcted on the menu...
what will be next depend on the next tread following the true line..

is it right ?

for example
0: 0x0032 Add/Cnage the Action String ("myDynaMenu/$Object")
1: 0x0002 (my energy := 0x0000)

on this way my Object should fall in sleep.. right ? :D

i'm pretty confused
i'm still using this operands...
00 00 00 00 05 00 00 00
00 00 00 00 00 00 00 00

but for some (why?) reason SimPE take the Insim. funcion
indeed 05 = "Have Twins With.../$Objects"


**** edit
i've made a some tests but i can't undrestand how the
Text List the TTAs and TTAb interact ....
in which base the the BHAV x32 catch my Text List, or didn't and show the submenu (Have a Twin.../$Object) from another object
and... how the game know that i need on the menu to chose a sim even an object ? :P

why me are me and not you ?
where i'm and where we go ?
to be or not to be.. to flame or not to flame ?
Retired Duck
retired moderator
#4 Old 20th Jul 2006 at 11:24 AM
Dynamic menus are somewhat more complicated than that. Here's a vastly oversimplified version.

The "Add/Change the Action String" has to go inside a loop in the guardian function. Each time it is called in that loop, you want the current stack object to be another of the alternative targets. When it is called, the action BHAV should havethe stack object's ID for whichever of the added menu options was selected stored in its param 0x00.

There's a lot more to it than that, but that's should be enough to make sense of the existing objects' code.
Field Researcher
Original Poster
#5 Old 20th Jul 2006 at 12:52 PM Last edited by Max3D : 20th Jul 2006 at 1:16 PM.
thnx to you booth maybe i've got it now ^^
so the Guardian MUST have a loop, on this way every cicle of the loop will catch a person.. right ?

Code:
0: 0x0002: Expression Local 0x00: = Literal 0x00
1: 0x0002: Expression Stack Object ID 0x0: = Literal 0x0
2: 0x001F: Set to Next (person, resoult in Stack Object ID 0x0000) True:goto2  False:error
3: 0x0032: Add/Change.... 
4: 0x0002: Expression Local 0x00 += Literal 0x00 True:goto2 False:error


the line 4 will add the next guest to the stack
on this way when we'll have no more persons (decided on line 2) the cicle will stop and the Non-Test BHAV will be executed

... Echo, you mean that on my action bhav i should have at the first line
0x0002 Expression (Stack Object's 0x000B (object id) := Literal 0x0000) ?
... to define the stack... but this will empty it... or not ?
Retired Duck
retired moderator
#6 Old 20th Jul 2006 at 1:15 PM
Almost. Line 2 will set the next guest to the stack. Lines 1 and 4 are not actually doing anything useful in that example; the former is setting local 0 to 0, and the latter is adding 0 to that, so essentially it's a variable that is never read and always set to 0.

All you really need from that example in the Guard would be lines 1 through 3. Just make sure that the "add/change" loops back to the "set to next".
Field Researcher
Original Poster
#7 Old 20th Jul 2006 at 1:31 PM
by the way it continue to use a menu from another object
Retired Duck
retired moderator
#8 Old 20th Jul 2006 at 1:40 PM
Er... I'm not sure what you mean... Your object isn't referencing the correct pie menu functions file? Check that the "Interaction Table" value in the OBJD's Raw Data tab has the same value as the instance number from your Pie Menu Functions/Strings.
Field Researcher
DELETED POST
Original Poster
20th Jul 2006 at 1:50 PM
This message has been deleted by Max3D.
Field Researcher
DELETED POST
Original Poster
20th Jul 2006 at 3:51 PM Last edited by Max3D : 20th Jul 2006 at 7:36 PM.
This message has been deleted by Max3D.
Field Researcher
Original Poster
#9 Old 24th Jul 2006 at 11:26 AM
Another answare about Dynamic Menu and Sims selection.

My sim have to no appear on the menu, something like "talk with../$Object" you can't talk your self (eaven you'r crazy lol )
to do that i supposte that i need to add a condition to skip my sim.. any help ?

tnx in advice
Field Researcher
#10 Old 24th Jul 2006 at 7:33 PM Last edited by christianlov : 24th Jul 2006 at 7:52 PM.
Not sure I can help you,

0: 0x0002: Expression Local 0x00: = Literal 0x00
1: 0x0002: Expression Stack Object ID 0x0: = Literal 0x0
2: 0x001F: Set to Next (person, resoult in Stack Object ID 0x0000) True:goto3 False:goto5

<------- Here needs to be some more checking lines ------------>
to skip the selected sim,
stack object id equal? my object id true:go2 false:go3

3: 0x0032: Add/Change Action String <------- "$Object" It will be more easier to type in text strings in the action strings set and use PJSE add change action string wizard. be sure to see if it's reading private strings in the main pjse screen.
4: 0x0002: Expression Local 0x00 += Literal 0x01 True:goto2 False:error

5 0x0002: Expression local 0x00 > literal 0 true:true false:false


In action bhav, it will receive the object id in param 0. Then
you can make it like this

Action BHAV(number of params=1 locals=1)

1 Verify person ID(param0) true:goto2 false:false
2 stack object id 0x0 := param 0. true: goto3 false: error
3 Go to relative postion(anywhere near, any direction) true:true false:false

or if that 'talk' interaction is from the person globals, please find the pie menu number.

and

3 local 0 := stack object id 0 go4
4 stack object id 0 := my object id go5
5 push interaction
Field Researcher
Original Poster
#11 Old 30th Jul 2006 at 5:23 PM
it was an hard battle .. but i win it :D

thnx 2 all for the help
Back to top