this is what you have:
<object name="npc">
<inherit name="editor_object" />
<conversation type="stringdictionary">1 = A;2 = B;3 = C</conversation>
<speak type="script">
msg (StringDictionaryItem (npc.conversation , GetRandomint (1,3)))
</speak>
</object>
so, first, just remove the: msg ()
and see if it nor works
if, you still get the error, then try changing the npc to: this
so, here's what it should look like:
(first try this)
<object name="npc">
<inherit name="editor_object" />
<conversation type="stringdictionary">1 = A;2 = B;3 = C</conversation>
<speak type="script">
StringDictionaryItem (npc.conversation , GetRandomint (1,3))
</speak>
</object>
and, if the error still comes up, then try this:
<object name="npc">
<inherit name="editor_object" />
<conversation type="stringdictionary">1 = A;2 = B;3 = C</conversation>
<speak type="script">
StringDictionaryItem (this.conversation , GetRandomint (1,3))
</speak>
</object>
otherwise, then try this instead:
<object name="npc">
<inherit name="editor_object" />
<conversation type="stringdictionary">1 = A;2 = B;3 = C</conversation>
<speak type="script">
StringDictionaryItem (this.conversation , GetRandomint (1,3)-1)
</speak>
</object>
---------------------------
actually, I know what's causing the error, I think, lol:
first, you still got to remove the msg ()
so, you first need it to look like this:
<object name="npc">
<inherit name="editor_object" />
<conversation type="stringdictionary">1 = A;2 = B;3 = C</conversation>
<speak type="script">
StringDictionaryItem (npc.conversation,GetRandomint(1,3))
</speak>
</object>
now, the error is because the ' StringDictionaryItem ' gets the enumerated stringdictionary:
0: 1 = A
1: 2 = B
2: 3 = C
but the ' GetRandomInt (1,3) ' gets literally 1, 2, or 3
and thus you have a problem: as there is no "3"
GetRandomInt value ~ StringDictionaryItem enumeration
N/A ~ 1 = A ~ (error)
1 ~ 2 = B
2 ~ 3 = C
3 ~ N/A ~ (error)
so, you don't have any matching up of the "1=A" nor do you have a 3rd StringDictionary topic (as the count starts from 0, not 1)
so, you need it to look like this:
<object name="npc">
<inherit name="editor_object" />
<conversation type="stringdictionary">1 = A;2 = B;3 = C</conversation>
<speak type="script">
StringDictionaryItem (npc.conversation,GetRandomint (1,3)-1)
</speak>
</object>
-----------------
if you wanted to just use the: GetRandomInt (1,3)
then you'd need to use it with the switch script:
result = GetRandomInt (1,3)
switch (result) {
case ("1") {
msg ("A")
}
case ("2") {
msg ("B")
}
case ("3") {
msg ("C")
}
}
so, basically you can't do both the: (GetRandomInt) and (StringDictionaryItem)
however, you can do both of: (GetRandomInt - 1) and (StringDictionaryItem)
or, you don't use the StringDictionaryItem, and instead use: (GetRandomInt) with (result=GetRandomInt expression) and the (Switch:result script)