Creating Conversations and Characters

Users who are viewing this thread

Stonewall382

Knight at Arms
(I know some of this stuff is already here, but a) it's mostly all scattered around (though n00bs resource thread helps out a lot), and b) it isn't in lamens terms, which I understand.:P)

(Of course, create backups of your troops.txt and conversations.txt (and hell, why not your sceneobj folder, too) files, if not the whole of M&B (:P), before doing anything. :wink: )

I've found this information through many trial-and-error experiments, and with Ancientwanker adding info, I think I've got it well enough. If any of the real pros would like to add something, or show me what I did wrong, I'd appreciate it, as I'm still working out the kinks here (I don't understand Hex nor Python real well :oops: ).

So...

I created a character, Zel, and threw him in Zendar Center. His index number is 177 (that'll matter later on).
This is Armagan's original text, the generic stuff Zel would normally say (take note of the number of spaces in between everything):

dlg_0 65535 0 0 Hello._What_can_I_do_for_you? 396 0
dlg_0 131071 396 1 -2147483604 0 0 0 Tell_me_about_yourself 397 0
dlg_0 65535 397 0 Ok_then_listen_to_this... 11 1 13016 0 0 0
dlg_0 65535 11 0 Anything_else? 396 0
dlg_0 131071 396 1 44 0 0 0 _Good-bye. 6 0
dlg_0 131071 396 1 -2147483604 0 0 0 _[Leave] 6 0

Now, my version:
dlg_0 177 0 0 Hello_sir. 398 0
dlg_0 131071 398 0 _Hello_there._I'm_$playername$. 399 0
dlg_0 177 399 0 _My_name_is_Zel._I'm_the_stable_hand_here_for_the_Tournament_Master. 400 0
dlg_0 131071 400 0 So_these_horses_will_be_in_the_arena_tonight,_then? 401 0
dlg_0 177 401 0 Yessir._My_horses_will_be_in_the_thick_of_it,_helping_train_our_fighters. 402 0
dlg_0 131071 402 0 And_will_you_be_watching_them_fight? 6 0
dlg_0 177 403 0 Sadly,_no._When_I_am_through_with_my_work_for_the_Tournament_Master,_I_must_start_work_for_my_other_master,_Goodwife_Zel. 404 0
dlg_0 131071 404 The_work_really_never_ends._Well,_I_must_be_going,_but_I_will_try_to_come_back_and_cheer_the_mounted_soldiers_in_the_fight_tonight._I'm_sure_you've_trained_them_well._Have_a_good_day,_sir. 405
dlg_0 177 405 0 And_you,_good_sir. 6 0
(^^Some generic conversation.)

Unfortunately, the conversation stops working at the "watching_them_fight?" line--I think there's some sort of limit to the length of one branch of conversations.

Now, let me show a quote of a conversation I created, that included two "clickable" options:
dlg_0 177 0 0 Hello_my_name_is_Zel. 398 0
dlg_0 131071 398 0 _Hello._ 399 0
dlg_0 131071 398 0 _What's_your_name? 399 0
dlg_0 177 399 0 _Hi._ 400 0
dlg_0 131071 400 0 _Hello._ 6 0
To create options, simply put lines that fulfill two attributes:
1) Each line must have the same convo (and character, of course) ID tag, and
2) The text must, naturally, be different.
You can have them both go to the same ID tag at the end, like with Constable Hareck's meaningless question "Have you worked as a manhunter before?" Or you can put two different next-line ID tags in, so that clicking one option leads to one conversation, and clicking another leads you in a different direction.

Now, what can we garner from all this? I'll disect the bits of code (from left to right) as we go.

'dlg_0' is used at the beginning of every new line of code--it just is.
'131071' is the player tag, used whenever the player is meant to say something.
'177' is Zel's unique conversation tag. Using the unofficial editor, one can find a character's ID tag, and then use it.
'398', '399', and '400' are the conversation (rather than character) ID tags.
'0' is used for everything I know of--it's in some other lines that are there to set off quests, but we don't need to worry about that, so always just put a '0' one space after the conversation ID tag.
"Hello_my_name_is_Zel." is obviously the text the character will say. Underscores (_) are used to denote spaces.
Then, the ID tag for the next conversation is given, one space after the text. Notice that in my last example, after "Hello_my_name_is_Zel," the ID is 398. So, the next line, the response to that, is 398, followed by 399, and 400.
After the 400 line, you see '6 0 '--this always means end the conversation.


A Few Notes

1-Always check your conversation ID tags to make sure they aren't already in the conversation file.

2-Make sure you're using the correct number of spaces in everything.

3-$playername$ is, obviously, the character's playername, and is dependent on your character's name.

4-I haven't tried putting the character's ID for the beginning of a conversation (not sure why you'd want to do it anyway), but I think the game would just go to the NPC's response, and you wouldn't be prompted to say your first line.


This isn't foolproof, and is meant only to be used to create idle conversations--I'm not entirely sure yet how to make quests and the like.
Also, don't worry about the fact that most of the numbers in lines before mine have 100something--those are numbers in Hex, while mine are in Decimal form (open wincalc--view--scientific--upper left-hand corner). They work, so I wouldn't tinker with 'em.;)

Good luck. :D



Btw--If anyone would seriously like to make conversations for characters in the game (characters we'll add in), please post in my Mount & Blade: Plus thread (also in the mod forum), so I can send you the link to our forum.;)


Now real quickly, as it isn't hard:

Creating Characters
To create a character, I use the unofficial Mount & Blade editor, found here:
http://forums.taleworlds.com/viewtopic.php?t=1971

First, go into the game with edit mode enabled (in the 'Configure' option when you launch M&B, or in, I believe, rgl_config in your M&B directory), and go to a city (Zendar would work just fine).
Enable edit mode by using ctrl+e, and then hit ctrl+right arrow, to select an entry point to insert. Change its variation number to something not already in the scene, using the + and - keys. (The lowest variation number in zendar_center is seven.) Then, save the game (just to be safe), exit M&B, and open the Unofficial Editor.
Make sure you're in the 'Units' tab, then click the 'add' button (+). Rename your troop whatever you want (apparently the trp_ part isn't needed, but you might as well use it), and outfit him/her with items, yada yada. Then go to 'Miscellaneous', 'Site' (scroll down to zendar_center (for this example), or whatever place you're trying to put a character into, and then select your entry point (for this example, that would be entry point seven).
Now, save, and open up M&B again, create a new character, and see if your newly-created NPC is there.
You can move his/her placing, and adjust the facing (<.-.-. rhymes), by fiddling with the entry point. One thing, though--no matter what, the character will stand erect, with feet flat on the highest-level surface in the vertical plane the entry point is in.
Thanks to Effidian for the wonderful Editor. :D

You can see, just below your NPC's name, his/her index number--this is what is used in the converations.txt file. :wink:


Have fun! :)
 
I appreciate the support, alec, and thanks for the "great job.":) Now I can go to bed (I just wanted SOMEONE to read it. :D ). :wink:
 
Well, I'd consider it, but...I really have no idea what scripting even is, actually... :oops:

If you give me a code, I can go back through it and find what the variables do. Well, actually, if I knew a language, I could probably do a mediocre job of making my own code too, but unfortunately I don't know any coding languages (does html count? :P ).
 
Woah, cool! Glad I could help! Finally someone found this useful!
*mumbles something about the official mod system coming out the day after he wrote the guide, making all his work obsolete*

Be careful though, as this was for an older version (I think it was actually for .632, though I'm not really sure), and so some stuff might have changed (I doubt it, because it's only conversations and troops, but you should still be wary that this might affect what work you do).
Plus, do you know how to use the Python files? They're (admittedly) a lot easier to use than the text files.

Meh, at any rate, glad I could help. Happy modding, hoam. :)
 
Back
Top Bottom