Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [SSGM 4.1 Plugin] AI Dialogue
[SSGM 4.1 Plugin] AI Dialogue [message #487406] Tue, 29 April 2014 06:48 Go to next message
Neijwiert is currently offline  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 #487410 is a reply to message #487406] Tue, 29 April 2014 09:12 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
Your code still contains an ::OnChat() event hook which implements a !test command.

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 #487414 is a reply to message #487406] Tue, 29 April 2014 11:05 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
Oh crap. Thanks for noticing, completly forgot to remove that. Will remove that asap.
Re: [SSGM 4.1 Plugin] AI Dialogue [message #487416 is a reply to message #487406] Tue, 29 April 2014 11:43 Go to previous messageGo to next message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma: 0
General (1 Star)
Very nice Thumbs Up

http://i32.photobucket.com/albums/d42/XpertMaverick/xpertyankee.jpg

Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.

Part time streamer - https://twitch.tv/gg_wonder
Re: [SSGM 4.1 Plugin] AI Dialogue [message #487433 is a reply to message #487406] Wed, 30 April 2014 10:31 Go to previous messageGo to next message
OuTSMoKE is currently offline  OuTSMoKE
Messages: 52
Registered: April 2009
Location: Chicago, IL
Karma: 0
Recruit

Tested with him last night, is good shit. Thumbs Up

http://i237.photobucket.com/albums/ff42/BTNHBoardOuTSMoKE/CNCSig2.jpg
Kambot NewMaps 4.1 Marathon Server Owner


Re: [SSGM 4.1 Plugin] AI Dialogue [message #487438 is a reply to message #487406] Thu, 01 May 2014 01:19 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
Any videos of it in action? ;p

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 #487444 is a reply to message #487406] Thu, 01 May 2014 05:21 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
As per request: http://www.youtube.com/watch?v=2LBal_Ap8E8&feature=youtu.be
Re: [SSGM 4.1 Plugin] AI Dialogue [message #487451 is a reply to message #487406] Thu, 01 May 2014 09:17 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
Yeah that's really cool

Does it work with the 4.0 resource downloader?


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 #487456 is a reply to message #487406] Thu, 01 May 2014 10:09 Go to previous messageGo to next message
Mauler
Messages: 448
Registered: May 2003
Location: Alberta, Canada
Karma: 0
Commander
Lol nice stuff
Re: [SSGM 4.1 Plugin] AI Dialogue [message #487457 is a reply to message #487451] Thu, 01 May 2014 10:42 Go to previous messageGo to next message
Neijwiert is currently offline  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 #487459 is a reply to message #487406] Thu, 01 May 2014 11:49 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
It works if the arguments to the script are wav file names to play, instead of the conservation audio stuff via LE.

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 #487460 is a reply to message #487459] Thu, 01 May 2014 12:42 Go to previous messageGo to next message
Neijwiert is currently offline  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 messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
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 #487467 is a reply to message #487406] Fri, 02 May 2014 09:05 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
you should be able to use dialogue from the strings server side no problem even custom strings?

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: [SSGM 4.1 Plugin] AI Dialogue [message #488829 is a reply to message #487406] Tue, 29 July 2014 05:32 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
Fixed the debug message and uploaded the updated files.

EDIT:
oh sorry didn't see your message Iran. Yeah I implemented my own logic to reflect the original behaviour in singleplayer.

[Updated on: Tue, 29 July 2014 05:36]

Report message to a moderator

Re: [SSGM 4.1 Plugin] AI Dialogue [message #488831 is a reply to message #487406] Tue, 29 July 2014 06:19 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

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 messageGo to next message
dblaney1 is currently offline  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 #491253 is a reply to message #491234] Wed, 07 October 2015 06:31 Go to previous messageGo to next message
sla.ro(master) is currently offline  sla.ro(master)
Messages: 610
Registered: September 2010
Location: Romania
Karma: 0
Colonel
dblaney1, can you upload the binary? thanks. Thumbs Up

Creator of Mutant Co-Op
Developer of LuaTT
Re: [SSGM 4.1 Plugin] AI Dialogue [message #491254 is a reply to message #487406] Wed, 07 October 2015 14:22 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

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 messageGo to next message
dblaney1 is currently offline  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
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

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

Previous Topic: LevelRedit, a .mix to .lvl converter!
Next Topic: Tiberium Crystal War 2 Test Client
Goto Forum:
  


Current Time: Wed Dec 11 14:33:24 MST 2024

Total time taken to generate the page: 0.01249 seconds