Hello again! "mode" anon here
Sorry yeah now I see how confusing my ask was- (I mean I am very confused about how stuff works as a begginer so yeah sounds right)
So I use the girl and triangle template from Zarla so I think it's yaya? I think I saw that somewhere.
What I want to do: I want to have what I call a "watching mode" so that my ghost would sit still and watch stuff with the user. I have special poses for the mode.
To do that, I separated the regular poses in randomtalk with the mode poses using an if/else to check if the mode is on or not
To put the mode on and off, I put two buttons in my ghost menu
And what's not clicking is what do I need to write exactly under those buttons so it turns the mode on and off....?
I dunno if it's clear, here's part of my code:
this is in aitalk (the stuff in green is the stuff I want to happen when the mode is on) ->
RandomTalk : nonoverlap_pool
{
if watchmode == "on"
{
"\1\s[161]\0\s[162]"
"\1\s[161]\0\s[163]\w8\w8\w8\w8\w8\w8\0\s[162]"
"\1\s[161]\0\s[164]\w8\w8\w8\w8\w8\w8\0\s[162]"
"\1\s[161]\0\s[165]\w8\w8\w8\w8\w8\w8\0\s[162]"
"\1\s[161]\0\s[166]\w8\w8\w8\w8\w8\w8\0\s[162]"
"\1\s[161]\0\s[167]\w8\w8\w8\w8\w8\w8\0\s[162]"
"\1\s[161]\0\s[168]\w8\w8\w8\w8\w8\w8\0\s[162]"
"\1\s[161]\0\s[169]\w8\w8\w8\w8\w8\w8\0\s[162]"
"\1\s[161]\0\s[170]\w8\w8\w8\w8\w8\w8\0\s[162]"
"\1\s[161]\0\s[171]\w8\w8\w8\w8\w8\w8\0\s[162]"
"\1\s[161]\0\s[172]\w8\w8\w8\w8\w8\w8\0\s[162]"
"\1\s[161]\0\s[173]\w8\w8\w8\w8\w8\w8\0\s[162]"
and then this part I struggle with is in menu, I know some stuff are wrong it was filler because I just can't figure out what I need to write here ->
MenuRun : all
{
"![*]\q[Ask something,askmenu]\n"
"![*]\q[Give something,giftmenu]\n"
"![*]\q[Play,gamemenu]\n"
"![*]\q[Show me a picture,picmenu]\n"
"![*]\q[Watch something with me!,screentime]\n\n[half]"
Select.screentime
{
ScreenOrNot
}
ScreenOrNot : all
{
"\0\s[5]\b2Watching time?\n\n[half]"
"\![*]\q[Watching time!,watchon]\n"
"\![*]\q[Enough watching.,watchoff]\n\n[half]"
"\![*]\q[Nevermind,CANCEL]\n"
Select.watchon
{
"\1\s[161]\0\s[162]![enter,watchmode]"
}
Select.watchoff
{
"\1\s[15]\0\s[5]That was great!![leave,watchmode]"
}
I think I'm gonna give up this option if I can't figure it out soon enough but it makes me a bit sad because I was very enthusiast about the idea. Anyway, can you help me? That's fine if not
Thanks for writing back! This paints a much clearer picture, we can certainly help! You are correct, if you're using the Girl and Triangle template then you're using YAYA (unless you have an older version written in AYA, but that's very unlikely these days)
You're actually almost there, the one thing you're missing is that you need to know how to assign your variable!
In RandomTalk you have written the following:
This is checking if a variable named "watchmode" is equal to the string "on". So all we need to do is assign the string "on" to watchmode when you want the mode on, and assign it to something else like "off" when you want it to be off.
This is quite simple to do. In your function Select.watchon, just add the following on a separate line within the brackets:
And in your function Select.watchoff, do the same, but assigning "off" instead of "on":
That should get it working for the menu buttons! (You won't need the \![enter,watchmode] and \![leave,watchmode] tags you have in red there, I'm assuming those are the placeholders you spoke of. They're not valid SakuraScript tags, so SSP would just ignore them!)
There are a couple other things you'll want to do to avoid bugs though. In your OnFirstBoot function, you'll want to make sure you define the variable watchmode, that way your ghost has it from the start and it doesn't cause any unexpected behavior. You can just add the following somewhere within the brackets of OnFirstBoot:
And, assuming that you don't want watchmode to stay on if the user closes the ghost and then opens it again later, you'll also want to change it to be off whenever the user opens the ghost!
There are a few ways to accomplish this, but I would highly recommend that you add the event OnInitialize to your ghost for this if you don't already have it. This event runs any time your ghost loads, no matter the reason. A normal bootup? Changed from another ghost? Switched to this ghost because the last ghost got uninstalled? It doesn't matter, it always runs OnInitialize, so you don't have to copy this variable change to OnBoot and OnGhostChanged and OnVanished, etc.
This is the setup I would recommend:
OnInitialize
{
//If you use the Reload SHIORI option in the dev palette, this check ensures that this code won't run, so that it doesn't silently kick you out of watch mode. Just to make your life as a dev a bit easier!
if reference0 != "reload"
{
watchmode = "off"
}
}
But of course, maybe you want it to persist across sessions until the user turns it off! If that's what you want, then you can skip this part.
I hope that helps you out! If you've got more questions or something's not working right, feel free to send another ask. What you're looking to do is very much possible.
And like I said, you very nearly had it figured out on your own, so take heart! You're doing well already, and if you run into anything that you're not sure how to approach, we're glad to help answer questions and give resources ✨