/
pm_anchor.dic
80 lines (68 loc) · 5.95 KB
/
pm_anchor.dic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//---------------------------Anchors and OnTranslate--------------------------
//This .dic file is for setting up anchor words, which are links to set conversations attached to certain words automatically. It also deals with OnTranslate, which is a fairly unique function. All text goes through OnTranslate first before it displays on your ghost, which is how it knows to turn certain words into links. Before you try it yourself, I've already tried adding automatic \w8 pauses after periods and that totally breaks everything.
//Why should I care about anchor words, you ask? Or what can I use them for? Well, you can set up anchor words to easy explanations for things your ghost might talk about that might confuse your user. People they know, places they've been, pop culture references the user might not get, information about you the creator or the world the characters from, items in an item menu, basically any number of things. Anchor words can be a handy repository of information! Or just an easy way to set up some cheap jokes. The power is yours!
//Make sure to read the walkthrough (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 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!
//This file is very short, so don't worry! And if you aren't planning on using anchor words, you just have to delete a few things and you'll be done!
//--OnTranslate
//As I said above, OnTranslate filters through all the text your ghost displays and does whatever you specify to it. This is a powerful function that can be used in a lot of creative ways I bet, but I wouldn't mess with it too much since you can pretty easily break stuff.
//If you're not interested in any anchor words, delete all the lines that start with _talk = REPLACE under OnTranslate.
OnTranslate
{
_talk = reference0
_talk = RE_REPLACE(_talk, CHR%"(?!(\[|\*))\*([^\*]+)\*(?!\*)", "\![embed,OnItcheck]") ; _talk = REPLACE(_talk, "**", "\![embed,Onbocheck]") ; _talk = REPLACE(_talk,"~~", "\![embed,Onstcheck]") ; _talk = REPLACE(_talk, "__", "\!embed,Onuncheck]")
_talk = REPLACE(_talk, "\п", "\s"); _talk = REPLACE(_talk, "\к", "\e"); _talk = REPLACE(_talk, "\ж", "\w"); _talk = REPLACE(_talk, "\н", "\n"); _talk = REPLACE(_talk, "(половина)", "[half]")
_talk = REPLACE(_talk, "\s[600]", "\s[600]%(isix)")
_talk = REPLACE(_talk, "\s[60]", "\s[60]%(hesdead)")
_talk = REPLACE(_talk, "Anchor 1", "\_a[anchor1]that\_a")
_talk = REPLACE(_talk, "anLina", "\_a[anchor2]Lina\_a")
_talk = REPLACE(_talk, "anJora", "\_a[anchor3]Jora\_a")
_talk = REPLACE(_talk, "anValya", "\_a[anchor4]Valya\_a")
_talk = REPLACE(_talk, "anPasha", "\_a[anchor5]Pasha\_a")
_talk = REPLACE(_talk, "anVanya", "\_a[anchor6]Vanya\_a")
_talk = REPLACE(_talk, "anVadik", "\_a[anchor7]Vadik\_a")
{
"%(_talk)"
}
}
//Some brief explanation about what's going on in those REPLACE lines! Basically, the function looks through the script and looks for a defined word or set of words. In this case, it's "Anchor 1". It then replaces "Anchor 1" with the second set of text, "\_a[anchor1]Anchor 1\_a". \_a if you recall is the dialogue code for linking something, so this is linking the words Anchor 1 to something called anchor1 set up in the next function, OnAnchorSelect.
//This is being used to change a word into a link, but you could conceivably use this to replace any text with any other kind of text if you wanted. I tried to replace . with .\w8 as I mentioned above which did not turn out well, haha, but there are probably other ways this could be used successfully.
//--OnAnchorSelect
//OnAnchorSelect runs whenever someone clicks one of the links as specified above, or a link that begins with http://.
OnAnchorSelect
{
if "http://" _in_ reference0 //checking to see if the link is a web address
{
"\j[%(reference0)]\e" // \j is a tag that will open a specified url in the user's browser of choice. This basically just tells the ghost to open the webpage stored in reference0, which would be the address that the user just clicked. I didn't get too much into \j in the walkthrough page because I have literally never used it except here.
}
elseif "https://" _in_ reference0
{
"\j[%(reference0)]\e" //this makes more links work + rss if i remember right. maybe an or operator would have worked better, but oh well.
}
else //if it's NOT a web address
{
case reference0 //case is a unique thing I've only really seen here in anchor.dic, and as far as I can tell it sets up reference0 for evaluation to see if matches any of the below criteria, which are all tagged with when. I wouldn't mess with much of this stuff unless you have a better grasp of this kind of thing than I do, haha. You can add as many things here as you want to set up above as long as you follow the basic format.
//Friendys = (0,0,0,0,0,0) vadik, vanya, pasha, valya, jora, lina
{
when "anchor1" //if the link is this value
{
"\1\s[18]Huh?\w2 Oh, just whatever happened to his wrist. You can see the bandage, right? \0\s[9]Yup, just tell %(username) about everything that's ever happened to me.\w4 Go right ahead.\e"
}
when "anchor2"
{Friendys[6] = 1}
when "anchor3" //if the link is this value
{Friendys[5] = 1}
when "anchor4"
{Friendys[4] = 1}
when "anchor5"
{Friendys[3] = 1}
when "anchor6"
{Friendys[2] = 1}
when "anchor7"
{Friendys[1] = 1}
when "anchor8"
{Friendys[0] = 1}
}
}
}