Conversation sorter

What It Does
Sorts a multilevel conversation and performs an action based on your decisions at the end.

All kinds of options can be set by conversing with NPCs.

How It Works

 * clear the local variable "option" at the beginning of the conversation
 * add choices to the left of the existing ones (I allow 9 choices per question)
 * sort using if or whatever type of programming you want at the end.

The Scripts
Clear

void main { SetLocalInt(GetPCSpeaker,"option",0); }

a sample option ActionTaken
you'll only ever need 9

void main { int nSelection = 1; int nMult=1; int nMemory = GetLocalInt( GetPCSpeaker, "option" ); while (nMemory>=nMult) { nMult=nMult*10; } nSelection = nSelection * (nMult); int nOption = nMemory + nSelection; SetLocalInt( GetPCSpeaker, "option", nOption ); }

a sample conversation end (normal) script
you need one per conversation

void main { int nTemp; int nP1; int nP2; int nString = GetLocalInt( GetPCSpeaker, "option" ); if (nString>=1) {nTemp=nString/10; nP1=(nString-nTemp*10); nString=nTemp;} if (nString>=1) {nTemp=nString/10; nP2=(nString-nTemp*10); nString=nTemp;} string sMessage = "First answer="+IntToString(nP1) +" Second answer="+ IntToString(nP2); SendMessageToAllDMs(sMessage); SendMessageToPC( GetPCSpeaker, sMessage); }

The variable "option" is reusable The option scripts (1-9) are reusable. I use set_option_1 - set_option_9 for mine. Please use those conventions so that conversations you make will be easily sharable among the community.