cleared and rewrited shitload of template comments, and added email formatting function

This commit is contained in:
2026-01-26 15:45:05 +08:00
parent f5cdff7abf
commit 8b1eeebab8
6 changed files with 203 additions and 235 deletions

View File

@ -1,6 +1,8 @@
//---------------------------Miscellaneous Functions--------------------------
//This .dic file is concerned with a number of functions that didn't quite fit in anywhere else. If you're adding new functions, this may be the place to do it! This also has the functions related to updating your ghost, among others. Most of this will just be replacing simple placeholder dialogue with dialogue more appropriate for your ghost.
/**
* Bunch of misc functions for all kind of options
*/
//This is basically bonus features and flavor text for a few of the more uncommon functions of a ghost. You don't HAVE to fill these out if you don't want to, the template's default dialogue will handle it (assuming you're making a two person ghost... if not, you may have to go through and remove Triangle's dialogue tags so he doesn't appear when you don't want him to). So if this file is boring or intimidating or you don't care, you can ignore it! These are again edge-cases compared to how often you'll see aitalk, bootend, or menu dialogue instead.
@ -53,221 +55,231 @@ OnShellScaling
OnFileDrop2
*/
//You can guess at what each function does by its name for the most part. You can go through and find the functions that seem the most interesting, or the most likely, to appear and then just fill those out if you don't want to do all of them. Or, if you want to go full nuclear, you can just wipe this whole file and let SSP's default dialogue handle whenever these scenarios come up. It depends on what you have the energy for and how thorough you want to be.
// Don't let this be a roadblock for you! It's basically bonus material! What matters is your aitalk file more than anything. You can always come back to this and fill it out over time once your ghost is already published. Don't get stuck here! I know it's easy to do so but don't let it happen to you! If you're getting stuck here just walk out, you can leave! lol. There's always aitalk, bootend, and menu to have more fun with, and that's the dialogue your user is going to see the most often.
//This file IS long, but you'll only have to do it once! Probably. And again, you don't have to do all of it, or even most of it if you don't want to. Don't let this be a roadblock for you! It's basically bonus material! What matters is your aitalk file more than anything. You can always come back to this and fill it out over time once your ghost is already published. Don't get stuck here! I know it's easy to do so but don't let it happen to you! If you're getting stuck here just walk out, you can leave! lol. There's always aitalk, bootend, and menu to have more fun with, and that's the dialogue your user is going to see the most often.
//Make sure to read the walkthrough page (http://www.ashido.com/ukagaka/walkthrough.html) for more details about how to properly format ghost dialogue!
//I will reiterate that you should be editing these in Notepad++, and in particular, you should set the Language to C (or Java I guess) to properly highlight all the text. It will make things A LOT EASIER for you, trust me! It will also help you keep track of your brackets in case you forget some. If you click on a line with a bracket in Notepad++, it should highlight where the other bracket ends, or turn purple if there's no finishing bracket (which you should definitely fix!)
//It will also highlight my commented lines in green, so you'll know where they are. Any line beginning with // is a commented line that the code will not read. It's just for your reference!
//If you see a big block of commented text you want to uncomment, highlight the text and then hit ctrl-shift-k in Notepad++ and that should uncomment it. Mostly this is intended for advanced users.
//---- OnInstallBegin -------------------------------------------------------
//OnInstallBegin is called when a file with an included install.txt is dropped on your ghost. This primarily means things like .nar files for other ghosts or .zip files containing balloons or shells for your ghosts. Primarily ghost-related things. Replace as you want.
/**
* OnInstallBegin is called when a file with an included install.txt is dropped, either .nar containing another ghost or .zip containing baloon or shell
*/
OnInstallBegin
{
"\0\s[0]This is the beginning dialogue for installing a file. This zip or nar contains an install.txt file.\e"
"\0\s[0]Установочный файл? Интересно, что внутри..\e"
}
//---- OnInstallComplete -------------------------------------------------------
//OnInstallComplete runs once the file above has finished installing.
/**
* OnInstallComplete runs once the file above has finished installing.
* reference0 - string with archive type. Can be "shell", "ghost", "balloon", "plugin", "calendar skin", "headline", or "rss".
* reference1 - string shell/ghost name as defined in descript.txt
*/
OnInstallComplete
{
"\0" //this means your main character will be speaking first, therefore the \s[] at the beginning of each line will be defining your main character's pose.
"\0" //this means sakura will be speaking first, therefore the \s[] at the beginning of each line will be defining sakura pose.
--
if reference0 == "shell" //This is checking to see if what you installed is classified as a shell in the install.txt. Remember the line in install.txt that said type,ghost or type,shell? This is why that line is important, that's what tells the program what it's installing like so.
if reference0 == "shell"
{
if reference1 == "Hypothetical Shell that doesn't actually exist" //This is the name of your shell as you defined in descript.txt in the shell folder.
if reference1 == "Mockup Shell"
{
"\s[0]Installed Hypothetical Shell. Truncated for space.\e"
//Replace if needed.
"\s[0]Does it really exists?\e" // a mockup
}
elseif reference1 == "Another totally real shell wow" //As in other files, you can use elseif to expand a list like this to include as many shells as you have or think you'll make. See bootend.dic for more details about elseif.
else
{
"\s[0]Installed another totally real shell.\e"
//Replace if needed.
}
else //For any other shell they may install.
{
"\s[0]Installed a new shell. It's called %(reference1).\e"
//%(reference1) here would be the name of the shell they installed. Replace if needed.
"\s[0]Хмм.. все проверки пройдены, целостность архива подтверждена, шелл %(reference1) установлен, %(username).\e"
}
}
elseif reference0 == "ghost" //if the type of the file they're installing is a ghost.
elseif reference0 == "ghost"
{
"\s[0]Installed a new Ghost. It's called %(reference1).\e"
//Reference1 here would be the name of the ghost. Replace as needed.
"\s[0]Все проверки пройдены, целостность архива подтверждена, поздоровайся с %(reference1), %(username). Ты тоже не стисняйся, %(reference1), скажи 'привет'!\e"
}
elseif reference0 == "balloon" //if the type of file is a balloon
elseif reference0 == "balloon"
{
"\s[0]Installed a new balloon. It's called %(reference1).\e"
//Reference1 here would be the name of the balloon. Replace as needed.
"\s[0]Новый баббл - '%(reference1)' - успешно установлен. Опробуем его?\e"
}
elseif reference0 == "plugin" //if the type of file is a plug-in
elseif reference0 == "plugin"
{
"\s[0]Installed a plug-in. It's called %(reference1).\e"
//Reference1 here would be the name of the plug-in. Replace as needed.
"\s[0]Закончила, плагин '%(reference1)' успешно установлен. А что он делает?\e"
}
elseif reference0 == "calendar skin" //if the type of file is a calendar skin
elseif reference0 == "calendar skin"
{
"\s[0]Installed a calendar skin. It's called %(reference1)."
"\s[0]Та-даа! Новый дизайн календаря - '%(reference1)'. Если бы у Люмы была стена, она бы повесила новый календарь на стену, чтобы смотреть на него каждый день~"
}
elseif reference0 == "headline" //if the file/url you drop on them is counted as a headline. To be honest with you I don't know what determines whether a url is a headline or what.
elseif reference0 == "headline"
{
"\0\s[0]Set up a headline. It's called %(reference1).\e"
"\s[0]Все проверки пройдены, целостность файла подтверждена, хэдлайн '%(reference1)' успешно добавлен.\e"
}
elseif reference0 == "rss" //this is more clearly for when you drag an rss feed onto your ghost. you can find rss feeds on sites by looking for the little rss icon, it kind of looks like a little satellite. you can google more info on rss feeds if you're curious! They're neat!
elseif reference0 == "rss"
{
"\0\s[0]Set up an RSS feed. It's called %(reference1).\e"
"\0\s[0]Новая RSS лента '%(reference1)' успешно добавлена! Теперь Люме будет не так скучно, когда она остаётся одна. Посмотрим, что там нового?\e"
}
else //for any other file they'd install
else
{
"\s[0]Installed %(reference1)."
}
}
//---- OnInstallFailure -------------------------------------------------------
//If the file you dropped fails to install for one reason or another.
/**
* If the file user dropped fails to install for one reason or another.
* reference0 - reason for the error, e.g. "unsupported" or "extraction"
*/
OnInstallFailure
{
"\0\s[0]The installation has failed.\n\n[half]\w5" //this first bit of dialogue begins the explanation of what happened. You can replace this with an appropriate intro statement.
"\0\s[0]Ой, установка сорвалась..\n\n[half]\w5"
--
if reference0 == "unsupported" //These if statements determine how it happened to finish the piece of dialogue. This checks if the reason it failed is because it was unsupported.
if reference0 == "unsupported"
{
"This file is unsupported.\e"
//Replace with whatever dialogue for an unsupported file you may come up with.
"Кажется, SSP не поддерживает этот вид файлов..\e"
}
elseif reference0 == "extraction" //This checks if the file didn't extract properly.
elseif reference0 == "extraction"
{
"The file could not be extracted properly.\e"
//See above but for a failed extraction.
"Что-то не так с архивом - не получается его распаковать.\e"
}
}
//--OnInstallRefuse
//If the file you dropped can't be installed with this ghost.
/**
* If the file user dropped can't be installed with this ghost.
* reference0 - name of the ghost this resource is intended for, as listed in install.txt file. e.g. shell, dropped on Lyuma, that belongs to some other ghost.
*/
OnInstallRefuse
{
"\0\s[0]Can't install this. \w4It may be for %(reference0) instead.\e"
//reference0 in this function refers to the ghost this file is associated with, probably the name of the ghost listed in its install.txt file. You would see this if you dropped a shell made for a different ghost on your current ghost, for example. They can't install a shell for themselves they can't use, right? Anyway, replace this with what you wish, you can use the reference0 envelope or not if you want.
"\0\s[0]Люма не может это использовать. \w4Может, %(reference0) знает что с делать с этим файлом?\e"
}
//**** Uninstallation ******************************************
//You may have noticed in the configuration menus in menu.dic an option to turn Uninstall on or off, as well as a greyed out option to uninstall in the right click menu. These following functions relate to the uninstallation process when it's on. Replace the dialogue in each function as we go along.
//--OnVanishSelecting
//When you select the uninstall option in the menu.
/**
* Initiate uninstallation
*/
OnVanishSelecting
{
"\0\s[0]The user is deciding whether or not to uninstall us.\w8\1\s[10]If you're testing this, be careful about what you click here, huh?\e"
}
{
"\0\s[0]Эта опция сотрёт Люму из твоей системы, %(username).\e"
}
//OnVanishSelected
//When you decide to uninstall them.
/**
* Uninstallation confirmed
*/
OnVanishSelected
{
"\0\s[0]The user has decided to uninstall us. Bye.\w9\w9\e"
}
//--OnVanishCancel
//If you select Uninstall from the menu, but decide not to do it.
{
"\0\s[0]Пока-пока, спасибо за всё время вместе\w9\w9\e"
}
/**
* Uninstallation cancelled
*/
OnVanishCancel
{
"\0\s[0]The user has decided not to uninstall us after all.\e"
}
//--OnVanishButtonHold
//This should trigger if you double click the ghost's balloon in the middle of OnVanishSelected above. So it basically cancels their uninstallation. I'd be pretty careful about testing this, and I'd probably just put the line of dialogue into their script input and test it that way instead.
{
"\0\s[0]Не будешь удалять? Люма рада, что ей можно пожить ещё\e"
}
/**
* This should trigger if the user double clicks the ghost's balloon in the middle of OnVanishSelected above, effectively cancelling their uninstallation.
* Wierd scenario I don't paricluarily intend to comment.
*/
OnVanishButtonHold
{
"\1\s[10]This dialogue displays when the user double clicks on the balloon when we're saying we're going to uninstall ourselves.\e"
}
{
//"\1\s[10]This dialogue displays when the user double clicks on the balloon when we're saying we're going to uninstall ourselves.\e"
}
//---- OnVanished -----------------------------------------
//OnVanished is a weird little function. Basically, if you uninstall a ghost, it'll automatically go back to the last ghost you were using. They'll then say this line of dialogue about the ghost you just uninstalled. This is very annoying to test as you can imagine! But unlikely to come up super often, I bet. Make sure to set up both their poses immediately so they both appear when it switches back to them.
/**
* If the user uninstalls a ghost, it'll automatically go back to the last ghost you were using.
* The ghost appeared will say this line of dialogue about the ghost you just uninstalled.
* reference0 - name of the deleted ghost
*/
OnVanished
{
"\0\s[0]\1\s[10]%(reference0) has been uninstalled.\w8\0\s[0]Harsh.\e"
//reference0 here is the name of the other ghost.
}
"\0\s[0]Пока, %(reference0).\e"
}
//**** Mail Checking *******************************************************************
//The next set of functions have to do with checking your email. This function is a slippery little thing - I've had people test it following my directions and have it work, but I've never actually gotten it to report back the right amount of emails myself. Very frustrating. But perhaps you'll have more luck with it, haha.
//Girl and Triangle can't actually read your email, they can just tell you how many emails you have. I've seen ghosts that can read the HEADERS of email, but I still don't think ghosts can actually display the contents of an email. You should be using your actual email client for that. It's still kind of a neat feature though.
//*********************Advanced User Info*******************************
//These text boxes are meant for those who have an interest in expanding or using more complicated functions in their ghost. Also for my own reference in the future since I plan on using this template too, haha. If you have no interest in any of this and just want to keep things as simple as possible, feel free to skip these boxes.
//If you want to set up your ghost to check your mail so you can more easily check these messages instead of just writing the dialogue and moving on, it's a little bit tricky, but not super hard.
//Basically, you're going to need to find your POP settings for your email account. Googling your provider + POP should bring it up pretty quick. Once you have the info, you'll go to the right click menu, options, then preferences. A big menu should pop up, and you should see POP in the left side. Click that, and input all the info from the POP page you looked up for your account. Tell your ghost to check your email, and if it works, then congratulations!
//***********************************************************************
//---- OnBIFFBegin ---------------------------------------------------------------
//When you first tell the ghost to check your email. An intro statement, if you will. Replace with whatever you like.
/**
* When you first tell the ghost to check your email. An intro statement, if you will.
* reference2 - name of the server being checked
*/
OnBIFFBegin
{
"\0\s[0]This is the starting dialogue for checking email.\e"
"\1\s[10]This is another starting dialogue for checking email.\e"
"\0\s[0]Ага, предоставь это Люме.\e"
"\0\s[0]Почта? Сейчас проверю.\e"
"\0\s[0]\f[name,Hymmnos,hymmnos.ttf]\f[height,16]j.w. mea ADDR => \f[default]\n\n%(reference2)\e"
}
//---- OnBIFFComplete ---------------------------------------------------------------
//After they've succeeded in checking your mail, they'll report back with how many new emails you have. Replace the dialogue with whatever would be character appropriate.
/**
* Email number successfully retieved.
* reference0 - number of emails
* reference2 - name of the server being checked
* reference7 - the senders and titles delimited by C_BYTE1 characters
* see: https://ukagakadreamteam.github.io/ukadoc/manual/list_shiori_event.html
*/
OnBIFFComplete
{
if reference0 == 0 //If you have no new mail.
if reference0 == 0
{
"\0\s[0]There is no new mail.\e"
}
elseif reference0 == 1 //If you have one new email.
{
"\0\s[0]There is one new email.\e"
}
elseif reference0 > 1 && reference0 < 11 //If you have more than one email but less than eleven.
{
"\0\s[0]There are %(reference0) emails.\e"
//reference0 here stores the amount of new email it finds.
}
elseif reference0 > 100 //If there are over one hundred new emails.
{
"\0\s[0]There are %(reference0) emails unread.\w8\1\s[10]Woah.\e"
}
else //For any other number of emails.
{
"\0\s[0]There are %(reference0) emails.\e"
}
}
"\0\s[0]%(username), в ящике пусто. Наверное лучше проверить позже.\e"
//---- OnBIFFFailure ---------------------------------------------------------------
//Various error messages that can happen when your ghost tries to connect to an email account. Replace the dialogue as appropriate.
"\0\s[0]Ничего нового.\e"
}
elseif reference0 > 0 && reference0 < 13
{
"\0\s[0]Ответ от сервера получен, пришло %(reference0) новых писем. Посмотрим?\n\n\![set,autoscroll,disable]\_q"
"\0\s[0]Передача данных завершена. На сервере %(reference0) новых писем.\n\n\![set,autoscroll,disable]\_q"
"\0\s[0]Письма из Хогвартса там всё ещё нет, но есть %(reference0) новых писем. Сейчас зачитаю...\n\n\![set,autoscroll,disable]\_q"
--
{
OnPrintMailAsList(reference7)
}
--
"\e"
}
elseif reference0 > 12 && reference0 < 100
{
"\0\s[0]%(reference0) новых писем, довольно много. Давай не будем читать каждое.\e"
}
elseif reference0 > 99
{
"\0\s[0]%(reference0) новых писем? %(username), давно ты в последний раз проверял свой почтовый ящик?\e"
"\0\s[0]%(reference0) новых писем. Наверное, тебе всё таки стоит начать их читать.\e"
}
else
{
"\0\s[0]Пришло %(reference0) новых писем, %(username).\e"
}
}
/**
* Function that prints a string of email senders and titles as unordered list
* _argv[0] - a string of entries in format "SenderName <Sender@email.eg> Message title" separated by C_BYTE1 chars
* returns formatted headers as list
* : last modifier will ensure only last return candidate gets returned
*/
OnPrintMailAsList : last
{
_headers = SPLIT(_argv[0],"")
_letters = ""
_headerRegex = "\s*(\S+)\s*<([^>]+)>\s(.*)" // Name <email@example.com> Message title
foreach _headers; _header
{
if RE_MATCH(_header,_headerRegex) > 0
{
_letterTitle = SHIORI3FW.EscapeAllTags(RE_GETSTR[3])
if RE_GETSTR[3] == ""
{
_letterTitle = "<не указано>"
}
_letters += "От: %(RE_GETSTR[1]) \nАдрес: %(RE_GETSTR[2]) \nТема: %(_letterTitle)\n\n"
}
}
_letters // returning formatted string
}
//Various error messages that can happen when your ghost tries to connect to an email account. Replace the dialogue as appropriate.
OnBIFFFailure
{
if reference0 == "timeout" //If the connection times out.
@ -290,7 +302,7 @@ OnBIFFFailure
//reference0 here stores the error message the email server would have given the ghost, hopefully.
}
}
}
//**** Network Update *****************************************************************
@ -338,7 +350,7 @@ OnUpdateComplete
{
"\1\s[10]Update successful!\e"
}
}
}
//---- OnUpdateFailure -------------------------------------------------------------
//Error messages if the update process fails in some way.