Back to the Korax Forum Archives
Crimson Wizard
Firebrand
RambOrc
Crimson Wizard
RambOrc
Firebrand
Crimson Wizard
#person name=$<localized string> pic= <other data here> #hello switch=<switch number local>[, <switch number global>] text=$<localized string> #bye switch=<switch number>[, <switch number global>] text=$<localized string> #replica switch=<switch number>[, <switch number global>] text=$<localized string> answerid=<answer id (number)> #answer <id> switch=<switch number>[, <switch number global>] text=$<localized string> trigger local <switch number>[, <switch number>, ...] trigger global <switch number>[, <switch number>, ...] script <map number> <script number> [some other actions]Example:
#person "Legion Officer" PIC101 #hello 0 "Hail, warrior" #bye 0 "Fare thee well" #replica 0 "Hi, how are you?" 1 #replica 0 "Do you have any quests for me?" 2 #answer 1 0 "I am fine, thank you" #answer 2 !1 "Not this time, come again later" #answer 2 1 "Yes, I've got one task for you"So, we have 4 types of entries here: 'hellos',"byes", "replicas" and "answers". Hellos are person's phrases said when conversation commences, byes - when it ends. Replicas are available player sentences. Answers are NPC's replicas. Availability is controlled by SWITCHES (kind of boolean variables). They could be global or local (that affect only this current NPC) for convenience. In the sample above player's replica "Do you have any quests..." have 2 possible answers, first available if switch 1 is OFF ( '!1' means "NOT 1"), second available when switch 1 is ON. Assuming switch 1 is OFF initially, switch 1 could be set ON, so answer changes from #1 to #2. Every entry can have additional commands activated when the phrase "comes into play"; commands could be switch toggling, script running etc whatever, like displaying shop buy/sell menu like:
#hello display shopShop contents could be defined in same script, in #person entry, as well as initial amount of gold as similar things.
RambOrc
Crimson Wizard
dj_jl
// Note: Number enclosing conversations and numbers in speeches are // TIDs assigned in level editor, -1 is for player. 1 // Assign to the first mage { OldMage1 // Just a name, not used { speech // Begins a speech { // <speaker> <speaking_to> <text> 1 -1 "How can I help you?" } choice // begins a choice { Clear // This flag says that screen (previous speech) must be cleared { // <text> <label> "Who are you?" WhoAreYou } { "What are you doing?" Walking } } WhoAreYou: // This is a label speech { -1 1 "Who are you?" } speech { 1 -1 "I'm an old mage." } jump End // Jump to the specified label Walking: speech { -1 1 "What are you doing?" } speech { 1 -1 "Just walking around." } End: end // Ends conversation } } 2 { OldMage2 { speech { 2 -1 "I don't want to talk with you." } speech { -1 2 "Why's that?" } speech { 2 -1 "Because I don't like you!" } speech { -1 2 "OK, I see." } end } }
Crimson Wizard
Crimson Wizard
person <Person Literal ID (used in dialog&quest scripts)> <Person Numeric ID (used in map scripts)> { name { } pic { } // local variable var <variable name> { [ boolean | integer ] <initial value> } < hello | bye | choice [<choice name>] <choice text> | speech <speech name> > <speech flags> [ if ( <availability conditions> ) ] { if ( <some conditions> ) say <who> <to whom> <text> [<voice file>] <some other actions here> } }Simple examples:
person GenericTownfolkMale 11011 { name "Billy Boy" hello { // simple block can be written inline say myself Player "Hi there." } bye { random { say myself Player "Bye." say myself Player "Cya." say myself Player "Have a good day." } } }
person GenericTownfolkMale2 11012 { var bool NameIsKnown 0 name if ( NameIsKnown ) "John Smith" name if ( !NameIsKnown ) "Commoner" hello { if ( Player.Class is Fighter ) say myself Player "Hail, Fighter" if ( Player.Class is Mage ) say myself Player "Good day, Wizard" if ( Player.Class is Cleric ) say myself Player "God bless you, Priest" } choice "Ask his name" if (!NameIsKnown) { say Player myself "What is your name?" say myself Player "My name is John Smith." set NameIsKnown 1 } }Example 3 (Switches, Advanced Commands)
person LegionOfficer 666 { var int QuestStatus 0 name "LegionOfficer" hello { if ( Player.Class is Fighter ) say myself Player "Hail to thee!" else { say myself Player "I can't say anything to you" end // 'end' command terminates conversation without "bye" } } choice "Ask for orders" { say Player myself "Can you give me some orders?" if ( QuestStatus is 0 ) { say myself Player "Ok, I have a quest for you. Bring me 1 Disc of Repulsion. Are you ready to go for this task?" yesno QuestStatus 1 0 // quick command for displaying 2 player choices, which set corresponding values to variable if ( QuestStatus is 0 ) say myself Player "I'll wait till time you are ready for this." else say myself Player "Great, return to me when you get one." } if ( QuestStatus is 1 ) { say myself Player "You have already got an order." } if ( QuestStatus is 2 ) { say myself Player "No more orders for now." } } choice "Repeat quest details" if (QuestStatus is 1) { say Player myself "Can you repeat your order?" say myself Player "Bring me 1 Disc of Repulsion." } choice "Give him Disc of Repulsion" if ( (QuestStatus is 1) and (Player.HasInventory DiscOfRepulsion 1) ) { say Player myself "Here's Disc of Repulsion, sir." say myself Player "Good work, soldier!" set QuestStatus 2 Player.RemoveInventory DiscOfRepulsion 1 Player.GrantExperience 1000 } }Example 4 (Forks)
person NPC 111 { hello { say myself Player "Do you like to hear my story?" yesno jump Story none end } speech Story { say myself Player "Bla bla bla." say myself Player "What do you want me to tell you also?" // Construct immediate selection choices { TellAboutHimself TellAboutFamily TellAboutCity } } // Hidden choices can be displayed only using "choices" command choice TellAboutHimself "Ask about himself" Hidden { ... } choice TellAboutFamily "Ask about his family" Hidden { ... } choice TellAboutCity "Ask about the city" Hidden { ... } }Heh, what a mess <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Crimson Wizard
Firebrand
Crimson Wizard
RambOrc
Crimson Wizard
Firebrand
RambOrc
Crimson Wizard
person person_name person_id (to adress from map scripts) { var var_name var_type initial_value // private person's variable inventory { item_name item_quantity flags (trade, respawn etc) } }Persons can be declared both in PERSINFO and CONINFO (conversations) but if there are matching names they are treated like a same person (PERSINFO has a priority for defining person_id) . In QUESINFO everything is quest-subordinated.
quest quest_name quest_id open (if set, quest is given at game start) { var var_name var_type initial_value // quest variable journal journal_entry_name journal_entry_title [open (if set this entry appears as soon as quest is received)] { journal texts... } event... { do something hee, like enable journal entries } }Well, the idea is still quite raw.
The 4th Class
Crimson Wizard
Firebrand
Crimson Wizard
RambOrc
RambOrc
Crimson Wizard
conitem [person_name] person_id [, con_name con_id]
RambOrc
Crimson Wizard
ConversationID Xwhere X is person ID. (Parameter is called ConversationID but that's because I am using existing one that is put there for Strife support. It will mean person id in KRPG, not actual conversation id)
RambOrc
Crimson Wizard
Firebrand
RambOrc
Crimson Wizard
RambOrc
Crimson Wizard
RambOrc
Crimson Wizard
RambOrc
Firebrand