NPC OnConversation event issue.
NeverwinterWights
Member Posts: 339
If I remember right the OnConversation event also acts as an OnClick event for npcs. Maybe not, it's been awhile since I've used it. I've been trying to get NPCs to speak a random one line greeting (not using an actual conversation) using this event. Seems like it should be simple enough but isn't working.
void main()
{
string sTag = GetTag(OBJECT_SELF);
//if (sTag == "BEGGAR_MALE" || sTag == "BEGGAR_FEMALE")
//{
string sGreet;
switch (Random(5))
{
case 0: sGreet = "I haven't eaten in days."; break;
case 1: sGreet = "Please. Can you spare a gold piece?"; break;
case 2: sGreet = "Please show pity on me."; break;
case 3: sGreet = "I'm down on my luck. I just need a little coin."; break;
case 4: sGreet = "Help out a wounded adventurer?"; break;
}
//ActionSpeakString(sGreet);
FloatingTextStringOnCreature(sGreet, OBJECT_SELF);
//}
PlayVoiceChat(VOICE_CHAT_HELLO, OBJECT_SELF);
//ExecuteScript("nw_c2_default4", OBJECT_SELF);
}
0
Comments
either way, this *should* work, so I recommend to debug your script,
here tutorial for debugging: https://neverwintervault.org/article/tutorial/script-debugging-tutorial
Bioware's comment on SpeakString, the keyword is immediately
// The caller will immediately speak sStringToSpeak (this is different from
// ActionSpeakString)