• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Tutorial - how to get the talking heads look better

zorglub

Privateer
Storm Modder
Hi all, I'm finally writting this short tutorial. I understand this is far from being a major improvement for the game, but anyway.


First : what am I talking about? In stock PotC as in Build 13, when you enter dialog mode, the face of the person with whom you're talking appears on the top left corner of the screen in a little frame. Its lips move while you hear the greeting sounds of the person, and then it stay idle. The face doesn't show any expression like fear or angryness, whatever is said in the dialog.
You'll agree with me that it appears pretty useless for now.


A thing we could do is removing those talking heads. That is easy : we only have to delete all files in \RESOURCE\MODELS\Heads, and in \RESOURCE\animation\Heads. Then we could edit \RESOURCE\Textures\Dialog\dialog.tga.tx in order to remove the frame and to have the dialog interface being nicer, Seadogs-styled or even more simplificated then Maximus attempt (see http://www.piratesahoy.net/forum/index.php...mp;#entry172212 ).


On the opposite we could try to improve the current talking heads system. Is it possible to have the talking heads being a little more expressive? Yes : there is an easy way to convince yourself.
- Launch TX convertor
- Convert into .tga \RESOURCE\Textures\Characters\Pirat11.tga.tx
- Now copy \RESOURCE\animation\Heads\AN\h_pirat10.an into \RESOURCE\animation
- Launch Inez Dias' Tool.
- Set for the texture directory RESOURCE\Textures\Characters.
- Set for the animation file h_pirat10.an (in stead of man.an, just under the texture directory and right of the ad_x_to filenames check box)
- uncheck 'show skeleton'
- Open the gm file \RESOURCE\MODELS\Heads\h_pirat11.gm. Hey it's Barbossa! What a surprise...
- click on 'cycle animation'
Now do you see what I was meaning?
wink.gif


Now next question : how does it works.
Easy : each model have its related head model in .gm in \RESOURCE\MODELS\Heads, with the same name with 'h_' in front, and using the same texture files than the character model. Animation data is located in the .an files in \RESOURCE\animation\Heads\AN\ - we cannot change thoses - and the .ani files in \RESOURCE\animation\Heads - you can open them with Notepad.
Now try to open one of those .ani file. You'll see something like that :

Code:
animation = Heads\AN\h_pirat10.an

data = "Turn speed", "4.0"

;-------------------------------------------------
; Normal
;-------------------------------------------------

[dialog_stay2]
start_time = 1
end_time = 42
data = "Blend time", "0.1"; sec

[dialog_stay3]
start_time = 42
end_time = 64
data = "Blend time", "0.1"; sec

[dialog_stay4]
start_time = 64
end_time = 103
data = "Blend time", "0.1"; sec

[dialog_stay5]
start_time = 103
end_time = 125
data = "Blend time", "0.1"; sec

[yes4]
start_time = 125
end_time = 148
data = "Blend time", "0.1"; sec

[no4]
start_time = 148
end_time = 170  
data = "Blend time", "0.1"; sec

[dialog_all]
start_time = 1
end_time = 170
data = "Blend time", "0.1"; sec

[dialog_idle]
start_time = 170
end_time = 250
data = "Blend time", "0.1"; sec


;-------------------------------------------------
; Smile
;-------------------------------------------------

[dialog_stay2_smile]
start_time = 251
end_time = 292
data = "Blend time", "0.1"; sec

[dialog_stay3_smile]
start_time = 292
end_time = 314
data = "Blend time", "0.1"; sec

[dialog_stay4_smile]
start_time = 314
end_time = 353
data = "Blend time", "0.1"; sec

[dialog_stay5_smile]
start_time = 353
end_time = 375
data = "Blend time", "0.1"; sec

[yes4_smile]
start_time = 375
end_time = 398
data = "Blend time", "0.1"; sec

[no4_smile]
start_time = 398
end_time = 420  
data = "Blend time", "0.1"; sec

[dialog_all_smile]
start_time = 251
end_time = 420
data = "Blend time", "0.1"; sec

[dialog_idle_smile]
start_time = 420
end_time = 500
data = "Blend time", "0.1"; sec

;-------------------------------------------------
; Angry
;-------------------------------------------------
[...]
An huge file for nothing : the game only use 'dialog_all' and 'dialog_idle' (as you can see in \RESOURCE\INI\dialog.ini). And apparently you cannot do anything against that because it's coded in a .DLL file, DIALOG.dll, in the MODULES folder.


Now I'm going to propose my method to thwart this stock game limitation. If somebody has got a better one, I'd be happy to hear it!
smile.gif

I'd be using an exemple : you are about to annonce Rys Bloom that your talk with the Harbor Master was a succes. He should look happy!

First :
- copy \RESOURCE\MODELS\Heads\h_Chameleon.gm and paste it as h_Chameleon_happy.gm
- copy \RESOURCE\animation\Heads\h_Chameleon.ani and paste it as h_Chameleon_happy.ani. You don't have to do the same with h_Chameleon.an.
- open your new .ani file, and delete all the 'Normal', 'Angry', & 'Afraid' part ; then remove all the '_smile' part in the []s. Save your file.
- now time to add some code in a dialog file. Open 'Rys Bloom_dialog.c' in PROGRAM\DIALOGS. In case "Help_succesful_2", add this magic line :

Code:
Dialog.headModel = "h_Chameleon_happy";
- save your file and test that ingame!

I'll end up by a few advices.
- always rename your files by adding '_happy', '_angry', or '_afraid' at the end of the original name : h_pirat11_angry, h_h_Soldier_Eng_afraid, etc. That way we will be able to use those kind of formula :

Code:
Dialog.headModel = "h_" + NPChar.model + "_happy"
- To have the head speaking again in a dialog, use this : SetEventHandler("frame", "DialogPlayGreeting", 1); By changing the greeting sounds at the same time, you understand this option is interesting! note : this is working only up to Build 13. In Build 14, the greeting code have been changed and this won't work - heads doesn't move their lips anymore anyway.
- I haven't try yet to use the noding animation (the guy saying yes or no by moving his head)


I agree, those are minor changes. But in the future that could lead to interesting features. Like the facial expression of your crewmate changing with your ship moral. Same with your officers. Noticing that an officer who don't like you and have a 'scoundrel' reputation has got suddenly a smiling and happy face could mean he's preparing a mutiny. Etc...
 
Nice! Thanks for posting this! <img src="style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />
 
I would say a tutorial isn't needed for that - everybody can manage it alone. But if you really want to, go on. But not in this topic please! Remember CCC : 'tutorial please, don't spam!' I'd like this one to remain on this subject only.
 
that doesn't exactly make me feel that much better about what i CAN do with the game. <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> fine then, back to topic.
 
Tutorial: Stickied. These facial expressions could be really interesting, especially if we're trying to add personalities to characters as proposed elsewhere.
 
I thought I <i>had</i> stickied this thing, dammit. <img src="style_emoticons/<#EMO_DIR#>/boom.gif" style="vertical-align:middle" emoid=":boom" border="0" alt="boom.gif" />
 
I've updated this tutorial : I've fixed the link that wasn't working anymore due to the forum change, and I've added some comments about the new greeting sounds system - not a lot, as I hope it'll change soon.
 
... I'll soon write back my updated tutorial (it got scrapped together with the Forum crash).

For the time being, I've upload the updated Dialog.c for Build14 alpha8 into my folder, on the FTP.

The necessary explanations are written in the file :
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->at the begining of the dialog, use directly Dialog.Mood = whatever you want (smile, angry, afraid.)
// If you want to change head expression again during the same dialog, use the Change_Mood(whatever) command
//Whatever being normal, smile, angry or afraid.<!--QuoteEnd--></div><!--QuoteEEnd-->
 
Of course! We lost that as well. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
At least your work already made it into the code for the next update and Short Jack Gold already made use of it in the Jack Sparrow storyline.

BTW: There is no need to add <i>Dialog.Mood = "normal";</i> at the top of the dialog files, is there?
Short Jack Gold did add that to many dialog files.
Do I understand correctly that with your Change_Mood function, the Dialog.Mood line isn't actually required anymore?
 
<!--quoteo(post=299217:date=Feb 3 2009, 08:48 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Feb 3 2009, 08:48 AM) <a href="index.php?act=findpost&pid=299217"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Of course! We lost that as well. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
At least your work already made it into the code for the next update and Short Jack Gold already made use of it in the Jack Sparrow storyline.

BTW: There is no need to add <i>Dialog.Mood = "normal";</i> at the top of the dialog files, is there?
Short Jack Gold did add that to many dialog files.
Do I understand correctly that with your Change_Mood function, the Dialog.Mood line isn't actually required anymore?<!--QuoteEnd--></div><!--QuoteEEnd-->Yes please can we clarify this - I added it as some characters start with an angry disposition and I "assumed" that by having it there we can change characters expression as the game proceeds.
 
I suspect you do need such a line when a character starts out smile/angry/afraid, but not for normal because that's the characters' expression by default anyway.
 
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->At least your work already made it into the code for the next update and Short Jack Gold already made use of it in the Jack Sparrow storyline.<!--QuoteEnd--></div><!--QuoteEEnd--> <img src="style_emoticons/<#EMO_DIR#>/buds.gif" style="vertical-align:middle" emoid=":drunk" border="0" alt="buds.gif" /> *victory* <img src="style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" />

<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->I suspect you do need such a line when a character starts out smile/angry/afraid, but not for normal because that's the characters' expression by default anyway.<!--QuoteEnd--></div><!--QuoteEEnd-->
That's right. If no 'Dialog.mood' is given, 'normal' mood is used by default - so you don't need to specify Dialog.mood = "normal";

If during a dialog you wish to revert a head with angry, smile, or afraid expression to normal, you need to use Change_mood = ("normal");

<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Do I understand correctly that with your Change_Mood function, the Dialog.Mood line isn't actually required anymore?<!--QuoteEnd--></div><!--QuoteEEnd-->Well... yeah, of course you <i>could</i> always use Change_mood() in stead of Dialog.mood, if you wanted to... Personnally I find it more logical to use Dialog.Mood when you're at the first case of the dialog, as a head model reset is not needed.
I'll advise to do as I said : always use Dialog.mood when we can, and Change_mood when we don't have a choice.

in summary :

_________________dialog first case______alone in another dialog case
_Dialog.mood__________works_______________doesn't work_(*)____
Change_mood__________works_________________works__________

(* : To say the truth, it does work if you play a greeting sound at the same time (with dialog.greeting), but that's another story - in the current code we shouldn't do that)


EDIT : right Pieter. oops.
 
<!--quoteo(post=299285:date=Feb 4 2009, 01:56 AM:name=a simple virtual sailor)--><div class='quotetop'>QUOTE (a simple virtual sailor @ Feb 4 2009, 01:56 AM) <a href="index.php?act=findpost&pid=299285"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->That's right. If no 'Dialog.mood' is given, 'normal' mood is used by default - so you don't need to specify Dialog.mood = "normal";
If during a dialog you wish to revert a head with angry, smile, or afraid expression to normal, you need to use Change_mood = "normal";<!--QuoteEnd--></div><!--QuoteEEnd-->I take it you mean <i>Change_mood("normal");</i> here, right? <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />

<!--quoteo(post=299285:date=Feb 4 2009, 01:56 AM:name=a simple virtual sailor)--><div class='quotetop'>QUOTE (a simple virtual sailor @ Feb 4 2009, 01:56 AM) <a href="index.php?act=findpost&pid=299285"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Well... yeah, of course you <i>could</i> always use Change_mood() in stead of Dialog.mood, if you wanted to... Personnally I find it more logical to use Dialog.Mood when you're at the first case of the dialog, as a head model reset is not needed.
I'll advise to do as I said : always use Dialog.mood when we can, and Change_mood when we don't have a choice.<!--QuoteEnd--></div><!--QuoteEEnd-->Personally I'd be inclined to use Change_mood() always since it always works and that prevents confusion between two codes for the same thing. But I don't really care as long as the end result works. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
 
Just a short note that we need to fix the Douwesen soldier dialog files for the new system; the old system doesn't work anymore since the inclusion of the Period soldiers, but the new system should.
 
I have updated the Douwesen soldier and Pieter Nolt dialogs to use the new mood changing system in Build 14 Alpha 8.5.
 
Outdated thread moved out of the Tutorials forum.
Superceded by: http://forum.piratesahoy.net//dialogs-head-sounds-camera-t15442.html
 
Back
Top