[SSGM 4.1 Plugin] AI Dialogue [message #487406] |
Tue, 29 April 2014 06:48 ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
Neijwiert
Messages: 124 Registered: October 2009
Karma: 0
|
Recruit |
|
|
This code was written by me some time ago and I never really used it. Now I will release it.
Basicly what this plugin does, it adds a script called 'AI_Dialogue'. You attach this script to a soldier bot and it will enable their voices (their conversations defined in their presets) in multiplayer.
It does not automaticly add the scripts to all soldier bots, due to flexibility.
So for example if you were to go into LE to the preset 'GDI_MiniGunner_1Off' and click modify. If you then go to the Dialogue tab you can see several conversations that need to be executed at a certain event. The plugin takes note of the silence weights and the weights per sound-event.
If you do however add custom converstaions (not sure if that would work server-side though) then you have to use the logical naming westwood uses. The conversation names are exactly the same except it doesn't have the .wav extension.
It has to follow that logic or else my plugin will fail, becouse i have yet to find a way to find the wav file that corresponds with the conversation.
Attached is the source code and the dll file.
EDIT: Feel free to do whatever you like as long as you put some credits in the code i suppose.
[Updated on: Tue, 29 July 2014 05:31] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: [SSGM 4.1 Plugin] AI Dialogue [message #487457 is a reply to message #487451] |
Thu, 01 May 2014 10:42 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
Neijwiert
Messages: 124 Registered: October 2009
Karma: 0
|
Recruit |
|
|
iRANian wrote on Thu, 01 May 2014 09:17 | Yeah that's really cool
Does it work with the 4.0 resource downloader?
|
Don't know. If the custom conversation making works server-side then i suppose it should work.
|
|
|
|
Re: [SSGM 4.1 Plugin] AI Dialogue [message #487460 is a reply to message #487459] |
Thu, 01 May 2014 12:42 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
Neijwiert
Messages: 124 Registered: October 2009
Karma: 0
|
Recruit |
|
|
iRANian wrote on Thu, 01 May 2014 11:49 | It works if the arguments to the script are wav file names to play, instead of the conservation audio stuff via LE.
|
If I would do that, then it would completly nullify the purpose of this whole plugin. The purpose of it is that it can read the actual conversation data from presets, so you don't have to hardcode anything in per preset.
|
|
|
Re: [SSGM 4.1 Plugin] AI Dialogue [message #487461 is a reply to message #487406] |
Thu, 01 May 2014 13:56 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
iRANian
Messages: 4307 Registered: April 2011
Karma: 0
|
General (4 Stars) |
|
|
Doesn't the plugin apply some either state logic? I mean it isn't just grabbing the sound files from the conversation info, it's implementing extra logic to get everything working, isn't it?
Long time and well respected Renegade community member, programmer, modder and tester.
Scripts 4.0 private beta tester since May 2011.
My Renegade server plugins releases
|
|
|
|
|
Re: [SSGM 4.1 Plugin] AI Dialogue [message #488831 is a reply to message #487406] |
Tue, 29 July 2014 06:19 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
|
BTW the reason Find_Conversation(const char *Conversation_Name) doesn't work is that you are using the wrong addresses for it.
This should help
RENEGADE_FUNCTION
ConversationClass *ConversationMgrClass::Find_Conversation(const char *)
AT2(0x006D6C30,0x006D64D0);
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
|
|
|
Re: [SSGM 4.1 Plugin] AI Dialogue [message #491234 is a reply to message #487406] |
Mon, 28 September 2015 11:13 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
dblaney1
Messages: 358 Registered: March 2014 Location: United States
Karma: 0
|
Commander |
|
|
Hey, I am posting a substantially improved version of this that works with 4.2, but also fixes a lot of issues with the original plugin. Works perfect on my test server. I setup all my coop bots to have the proper conversation settings.
Some things I fixed is the enemy killed messages now play correctly, it queues them so that they play next time the isacting flag is reset, all the sounds except for death no longer play if the soldier is already dead. The original version was toggling enable_enemy_seen(). It also was never resetting it to turn back on. Instead of toggling that flag I implemented a bool in the script itself that gets reset after X number of seconds. That way other scripts and the innate behavior aren't affected. Theres a variety of other tweaks that I made as well.
I recommend that if you plan on using this that you either add to this plugin to attach the script to all soldiergameobjs on creation or add that code to another ssgm or da plugin you have on your server including actually player controlled soldiers. This makes it so the bots are informed when they kill a player so they can play the kill taunt.
[Updated on: Mon, 28 September 2015 11:32] Report message to a moderator
|
|
|
|
Re: [SSGM 4.1 Plugin] AI Dialogue [message #491254 is a reply to message #487406] |
Wed, 07 October 2015 14:22 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
|
Still using the wrong addresses for
ConversationClass *ConversationMgrClass::Find_Conversation(const char *) I see...
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
|
|
|
Re: [SSGM 4.1 Plugin] AI Dialogue [message #491255 is a reply to message #491254] |
Wed, 07 October 2015 14:27 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
dblaney1
Messages: 358 Registered: March 2014 Location: United States
Karma: 0
|
Commander |
|
|
jonwil wrote on Wed, 07 October 2015 14:22 | Still using the wrong addresses for
ConversationClass *ConversationMgrClass::Find_Conversation(const char *) I see...
|
Oh I'll fix that. That function wasn't being used at all in the code so I never really touched it. I may make a few tweaks to use it if I can find some ways to improve it.
[Updated on: Wed, 07 October 2015 14:38] Report message to a moderator
|
|
|
Re: [SSGM 4.1 Plugin] AI Dialogue [message #491256 is a reply to message #487406] |
Wed, 07 October 2015 16:11 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) |
|
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
|
|
|