Replies: 5 (Who?), Viewed: 1126 times.
Test Subject
Original Poster
#1 Old 15th Mar 2020 at 6:59 AM
Default Dynamic pie menus (adding/changing string actions)
Hi all. So I've got this idea of creating an object with a dynamic menu (hope I'm using the right term) and I don't really know how to do it.

It should be like that: I click on the object in the game and a certain option in the pie menu appears, let's call it "Do X". A sim does that thing. Then I click on the object once again. The "Do X" is no longer visible but the "Do Y" appears. After "Do Y" is completed, it disappears again and "Do Z" appears.

What I don't know is how to make an interaction disappear and another one appear instead. After a long searching I learned about those string attributes and I created the strings "X done?" and "Y done?". I'm guessing I have to put them somehow into the interactions: Y - TEST and Z - TEST (guard bhavs) via Expression command but... I'm a bit lost here. So... I've created the command and it says: Expression (Stack object's attribute 0x0005 ("X done?") > Literal 0x0000). What should there be instead of the underlined part? I'd be grateful for any help.
Advertisement
Theorist
#2 Old 15th Mar 2020 at 4:27 PM
This question needs more detail. Are you trying to make it so a Sim can do X once, then never again for the rest of their lives, or do you want the choices to reset after they've done X, Y and Z? And is the object for multiple Sims to use at once, or not?

A dynamic pie menu or add/change action strings are used for building up a pie menu on the fly, like how a crib will build a pie menu letting you choose which infant or toddler to put to bed.
Test Subject
Original Poster
#3 Old 17th Mar 2020 at 6:45 AM
Default Thank you
Thank you for reply and sorry for being so late. I couldn't access the site but I think that meanwhile I figured it out finally. Now I'm wondering if it is possible to make an object with a function similar to writing a novel or painting. When you can stop the action at any moment and then resume it from where you finished. But not necessarily by the same person.

In other words, how could you make an object to "remember" the progress and allow for resuming work next time? I was thinking about setting a constant value. But I could also be totally wrong.
Lab Assistant
#4 Old 17th Mar 2020 at 7:04 PM
I'd say create another attribute like you did earlier, only instead of 0 - not done, and 1 - done, its value keeps growing until a certain level you set. If you store that level in a BCON, you can change it once and it'll be accessed by all functions that use that number in any way. That's if you want the same session to be continued by anyone. Otherwise it probably involves personal tokens, and i'm unfamiliar with those.

saint_diana, true Ravenclaw, perpetually amused that Galadriel is Arwen's granny
Theorist
#5 Old 17th Mar 2020 at 7:28 PM Last edited by omglo : 17th Mar 2020 at 10:12 PM.
Okay, in this case where you want the Sim to pick up the same interaction at a later time, you would use add/change the action string.
This is what I would do. Set two attributes, amount complete and finished. Decide how many times the Sim will perform the interaction and that will be the value for finished. Lets say that the Sim has to perform the interaction five times to complete the process.

Interaction - TEST
0 Stack Object's Attribute 0 (Amt Complete) == Literal 0 True 1, False 2
1 Add/Change Action String - Start Interaction
2 Add/Change Action String - Continue Interaction

Interaction
0-2 whatever preparatory code you'd add
3 - Stack Object's Attribute 1 (Finished) := Literal 5
4 - 7 Interaction Code Loop
8 - Stack Object's Attribute 0 (Amt Complete) += Literal 1
9 - Stack Object's Attribute 0 (Amt Complete) >= Stack Object's Attribute 1 (Finished) True B False A
A - Wait for Notify True C False 4
B - Stack Object's Attribute 0 (Amt Complete) := Literal 0
C - Other code to end the interaction

ETA: if you wanted to make it so no sim but the original sim could finish it, you wouldn't need a token. You could set a third attribute, like Stack Object's Attribute 2 := My Object ID, somewhere before the start of the interaction loop. Then add a line in the TEST, Stack Object's Attribute 2 == My Object ID True return True, False return False. That's how things like the easel store the painting owner.
Test Subject
Original Poster
#6 Old 18th Mar 2020 at 2:10 AM
Oh, thank you soooo much. You're my hero. Perfect!
Back to top