Back to the Korax Forum Archives


Forum

SE Conversations

Thu, 03 Jan 2008 16:27:22

Crimson Wizard

Good news, Janis added script parser to Vavoom progs, so it should be easy now to make any custom scripts we need. Thus I am raising this topic. Primary question is - what should the conversation look like in SE?
Thu, 03 Jan 2008 17:53:59

Firebrand

I imagine something very similar to that conversation system in Strife, with a few additions (like the commands for NPCs system or some new inventory system for stores). Also, some ACS execution stuff could come in handy <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->.
Sun, 06 Jan 2008 21:16:02

RambOrc

I am still lobbying for my concept of town areas being designated in SE (since we have dozens to hundreds of 3D locations physically separated by the travel map anyway, shouldn't cause any kind of strange transitions). In town areas, controls are different except for movement - you have no in-screen weapon, you can't attack anybody, but on the other hand you can trade and interact with NPCs (buy, sell, talk). In dungeon and wilderness areas (basically the same, depending whether they are indoors or outdoors maps), you won't find NPCs but you can fight. Separating stuff this way should IMO make building the game much easier. With this concept, you can spend as much time in the trade or conversation popup window as you want, since there won't be a monster coming at you from behind. They did it in Strife this way much of the time, and in the few cases where they didn't it actually didn't work out too well. But of course this is up to discussion so fire away.
Mon, 07 Jan 2008 08:56:08

Crimson Wizard

I have nothing against removing attack abilities in town; as for outdoors, we could make so that NPCs won't talk if there are monsters nearby. But actually I was asking about different thing; what I had in mind is how the dialog structure should look like.
Mon, 07 Jan 2008 13:18:04

RambOrc

As Firebrand proposed, similar to Strife should be good, a couple of lines of text overlaid over a background picture of the speaker.
Mon, 07 Jan 2008 19:09:22

Firebrand

As for a script lump format, IIRC there were some test conversations on KDev that were from the SE alphs build, I think a format similar to that one would be best for them, it might change in the future to allow additions to the system, and it's easy to do IMO, which is important so everyone can contribute dialogs for any part of the game by just making text files <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->.
Tue, 08 Jan 2008 14:28:04

Crimson Wizard

There are so much stuff on kdev, I am bored searching for that "dialog lump"; what if we reorganise kdev contents at once? Anyway, here's my proposal on how dialog script could look like:
#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 shop
Shop contents could be defined in same script, in #person entry, as well as initial amount of gold as similar things.
Tue, 08 Jan 2008 22:12:45

RambOrc

For the scripting language created by Janis just open up the KMOD 3 beta, it's either in a text file on the file level or compiled into the wadfile. His take was different, I can't easily say which is better to use. The concept Janis created allows very long threads with many forks (it can get quite complicated though), OTOH that system used a widescreen "camera shot" of the NPC and the player talking and had only 2 lines available for text at a time, while if we go with a Strife-like system, we can put considerably more text on the screen at a time.
Wed, 09 Jan 2008 10:02:18

Crimson Wizard

Still cannot find it. I downloaded KMOD 3 Beta from SVN but there's nothing like dialog script in WAD.
Wed, 09 Jan 2008 11:19:24

dj_jl

Found it in koraxdev_old. Here's the example conversation script:
//	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
	}
}
Wed, 09 Jan 2008 12:55:41

Crimson Wizard

Ok I found this in <!-- m --><a class="postlink" href="http://downloads.orcishweb.com/koraxdev/koraxdev_old/scatteredevil/se-bin.zip">http://downloads.orcishweb.com/koraxdev ... se-bin.zip</a><!-- m --> They have such features like consequent replicas, automatic replicas from player, random replica selection and NPCs talking to NPCs.
Thu, 10 Jan 2008 09:44:53

Crimson Wizard

Heh, after an attempt to merge these two script styles I've got following syntax idea.
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:) -->
Fri, 18 Jan 2008 10:19:20

Crimson Wizard

Hmm, I got so obsessed by this idea that worked all night <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> so today I am really drowsy but I've got a working extended script parser for conversations and basic syntax sctructures are parsed correctly already, so that it is possible to call "hello" and "bye" blocks. Now I need to put this into game as normal dialog, because I tested that in main menu.
Fri, 18 Jan 2008 14:20:21

Firebrand

Sounds like good progress <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->, I would like to see the dialogs working in game.
Fri, 18 Jan 2008 14:26:47

Crimson Wizard

I think I will use RambOrcs photo as a background pic <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Fri, 18 Jan 2008 14:56:57

RambOrc

Which one?
Sun, 20 Jan 2008 17:50:37

Crimson Wizard

Wheehehehehee <!-- s:twisted: --><img src="{SMILIES_PATH}/icon_twisted.gif" alt=":twisted:" title="Twisted Evil" /><!-- s:twisted: --> [img:2cxv29qj]http://downloads.orcishweb.com/koraxdev/koraxrpg/shots/rambo_talking.jpg[/img:2cxv29qj] [img:2cxv29qj]http://downloads.orcishweb.com/koraxdev/koraxrpg/shots/the4thclass_talking.jpg[/img:2cxv29qj] Currently supported: - Scripts importing. CONINFO lump is being read on game start to register basic info about existing conversations, and there's no need to put everything in one lump, since it's possible to add other lumps using "import" command like "import myscript". - Person name and picture definitions. - 'Hello', 'bye' and 'choice'. - Commands: 'say', 'cls' (clear screen), 'end' (sais bye and terminates). Conversation is attached to objects using ConversationID variable (like in Strife) equal to one mentioned in person delcaration.
Sun, 20 Jan 2008 17:56:29

Firebrand

Looks cool! Nice work so far, I guess this is a good milestone to reach for the RPG <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->.
Mon, 21 Jan 2008 11:20:17

RambOrc

Not bad. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Tue, 22 Jan 2008 10:52:23

Crimson Wizard

I am going to upload the code as soon as I get variables and simple conditions working. Meanwhile, I think we may use similar script for defining more specific persons data like shop contents and initial inventory (something like PERSINFO) and a quest script which will add quest variables and journal logs (maybe QUESINFO). For PERSINFO syntax shoud be very simple like
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.
Wed, 23 Jan 2008 00:04:28

The 4th Class

Well done CW! <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> Though when you have the NPC speaking more than one line, you shouldn't repeat his name after each and every line.
Wed, 23 Jan 2008 08:37:25

Crimson Wizard

[quote="The 4th Class":ghei8klg]Though when you have the NPC speaking more than one line, you shouldn't repeat his name after each and every line. Not every line but every "say" command in script. That's because its possible to make other persons (e.g. player) speak as well. Meanwhile, you can make them "say" multiple lines of text at once.
Wed, 23 Jan 2008 13:28:54

Firebrand

It would be better to just display the current NPC conversation line, instead of showing them all IMO <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->.
Wed, 23 Jan 2008 14:23:42

Crimson Wizard

[quote="Firebrand":lnhfe3j5]It would be better to just display the current NPC conversation line, instead of showing them all IMO <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->. That could be done simply by "cls" command in script. But I thought it could be useful to see some dialog history. Number of shown lines is limited anyway.
Wed, 23 Jan 2008 15:59:19

RambOrc

The real convos in the game would mostly contain several lines of text, even several paragraphs, so having only the last thing a guy says on the screen would make sense.
Mon, 19 Apr 2010 18:07:27

RambOrc

I'm currently playing around with conversations, a question and an observation: - the pics used in the original sample now scale and instead of the whole picture being shown in a small part of the screen, it now only displays part of the picture really big (this might have something to do with how the travel map background was changed for MS3) - how do I designate different NPCs for different conversations? is there a single NPC for every conversation in the game files?
Tue, 20 Apr 2010 21:25:09

Crimson Wizard

[quote="RambOrc":2p9a6og6] - how do I designate different NPCs for different conversations? is there a single NPC for every conversation in the game files? Either by creating new class in DECORATE and define conversation id, or using ACS function Thing_SetPersonId(tag, person id). Person id is a number from such line(s) in conversation script:
conitem [person_name] person_id [, con_name con_id]
Fri, 25 Jun 2010 12:58:04

RambOrc

Can you give me a sample code I can put into DECORATE for an NPC which I can copy and multiply?
Mon, 28 Jun 2010 03:00:42

Crimson Wizard

[quote="RambOrc":1yoac43z]Can you give me a sample code I can put into DECORATE for an NPC which I can copy and multiply? But there's such code in DECORATE already, it defines basic peasant NPC we were using all this time. It should be simply one line:
ConversationID X
where 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)
Mon, 28 Jun 2010 07:30:37

RambOrc

How does that define the sprites and sounds for the NPC? How do I assign a specific AI to them?
Mon, 28 Jun 2010 09:06:23

Crimson Wizard

[quote="RambOrc":1bl4m09q]How does that define the sprites and sounds for the NPC? How do I assign a specific AI to them? Erm... huh I thought you were talking about conversations. Sprites & AI is such a broad topic... well, check krpg/basepak.pk3/actors/townfolk.txt and npcs.txt, they have some npcs declared. For more info about customizing visual look and AI you better check corresponding topics on ZDoom Wiki...
Thu, 01 Jul 2010 12:12:59

Firebrand

You might be interested in checking about DECORATE in the ZDoom wiki as CW suggests <!-- s;) --><img src="{SMILIES_PATH}/orc9.gif" alt=";)" title="Wink" /><!-- s;) -->.
Thu, 01 Jul 2010 12:45:31

RambOrc

There is a bunch of things on the more technical side of the code and resources that you intimately know (DECORATE, ACS, what's what in a wadfile etc) but still expect me to learn about them so I can deal with them alone. I know you guys don't have much time, but recently every week or two I take another start at getting the MS4 beta together and run into still another such thing, I have no problem with writing the conversations for the NPCs and making a map where I place them, but also having to learn how to create the NPCs first in the resources is just too much of a hurdle. It's really inefficient that you have the knowledge to do these things quickly, but expect me to learn it too. I just want to move forward with the game, I don't see the point of being able to do everything myself. I need your help, with creating NPCs and with other things.
Thu, 01 Jul 2010 17:03:23

Crimson Wizard

Well, we can create them ofcourse, I thought you wanted to do something yourself. You just tell what's needed. Actually I appear too rarely on the forums lately, but still may find time to make things.
Thu, 01 Jul 2010 20:40:21

RambOrc

Ah cool, I'd like to order following NPCs with a side dish: - generic NPC 10x (current peasant sprite is fine) - warrior NPC 5x - mage NPC 5x - cleric NPC 5x
Fri, 02 Jul 2010 03:21:02

Crimson Wizard

[quote="RambOrc":zq0v3t55]Ah cool, I'd like to order following NPCs with a side dish: - generic NPC 10x (current peasant sprite is fine) - warrior NPC 5x - mage NPC 5x - cleric NPC 5x I dont get it. What was it all about look and AI? I mean, you just need to have variants of existing ones, no matter how exactly they look? (and how all this related to conversations?)
Fri, 02 Jul 2010 09:46:17

RambOrc

As far as I can understand, every one of these 25 NPCs has his own unique ID, and a conversation tree I build is tied to this thing ID. What I mean is for the story, it starts at the small order base, where you have an NPC of that order who gives you quests, plus a generic peasant to chitchat with. Then you go to the big city, where you get two more order NPCs in the order base (one specific and unique, the other order NPC just with some chitchat, this latter can be added several times to the map). Outside of the order bases, you can talk to any of a hundred peasants wandering the streets, and the peasants are technically 3-4 different types with different conversation options.
Fri, 02 Jul 2010 11:33:04

Crimson Wizard

[quote="RambOrc":2du17151]As far as I can understand, every one of these 25 NPCs has his own unique ID, and a conversation tree I build is tied to this thing ID. Not exactly. Actor class declared in DECORATE defines default person's ID. But if you call Thing_SetPersonId ACS function from inside map script, you can assign unique person IDs to only particular actors, thus overriding default setting. So, if you want, for example, 10 peasants each with unique conversation, you may stil use same class, but assign different person ids to them from map scripts. Ofcourse, you you need them look differently (i.e. have other sprites or AI), then you will need to create new classes in DECORATE.
Sat, 03 Jul 2010 19:53:56

RambOrc

Since order NPCs should look like their order and quest givers shouldn't wonder around, that's 8 different types of which only one exists currently (wandering peasant).
Sun, 04 Jul 2010 21:09:09

Firebrand

I think we can create simple base classes for each of the order's NPCs, then just inherit from them according to what type of NPC is needed (wandering or standing still, etc.), and use the ACS scripts to assign their own IDs.

Back to the Korax Forum Archives