Re: [SSGM 4.1 Plugin] AI Dialogue [message #491256 is a reply to message #487406] |
Wed, 07 October 2015 16:11 |
|
I am going to add some things to the next scripts build that should help you out regarding the sounds and stuff.
ConversationRemarkClass remark;
Conversation->Get_Remark_Info(0,remark);
TDBObjClass *translate_obj = TranslateDBClass::Find_Object(remark.Get_Text_ID());
if (translate_obj != NULL)
{
int sound_def_id = (int)translate_obj->Get_Sound_ID ();
Vector3 pos = Commands->Get_Position(obj);
Commands->Create_Sound(Get_Definition_Name(sound_def_id),pos,obj);
}
Use this code (which assumes obj is the soldier you are playing the sound on and Conversation is the ConversationClass instance) along with the attached ConversationClass.h and DialogueClass.h files (both files will be in the next 4.2 update but will work no problems with the current build of 4.2) and that should let you get the correct sound filename that you need regardless of how its set in the conversation data.
You will also need to call DialogueClass::Get_Option_List and DialogueClass::Get_Silence_Weight instead of accessing the variables directly.
Note that it plays the sound at the origin of the soldier, not the head bone (this IS correct to what the actual dialogue code in Renegade does)
Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
[Updated on: Wed, 07 October 2015 16:12] Report message to a moderator
|
|
|