SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 03-24-10, 04:47 PM   #1
Athlonic
Chief
 
Join Date: Apr 2005
Location: France
Posts: 311
Downloads: 51
Uploads: 2
Default

Quote:
Originally Posted by Heretic View Post
Browsing through the Dialog AI scripts, I found the function Dialog:GameCommand(command, var, var), which looks like it activates the commands from Commands.cfg

So I think it would be possible. All it'd take was someone motivated enough to figure out how to do it.

I've tried to add a "Give me depth under keel" dialog to the navigator officer :

-adding the text dialog line : OK
-make it clickable : OK
-running a script or animation : OK

but

-executing a command in Commands.cfg file : NO LUCK

here is my code :

in "data\Scripts\AI\Dialogs_Default\DT_Nav_all.ai x" file :

added this line to the rootdialog strategy :
Quote:
strategy RootDialog_NAV(Dialog)
{
strategies
{
DialogLine_RootDialog_NAV_NoCampaign_1200
}
}
and then :

Quote:
strategy DialogLine_RootDialog_NAV_NoCampaign_1200(Dialog)
{
strategies
{
DialogLine_RootDialog_NAV_NoCampaign_1200_Click,
DialogLine_RootDialog_NAV_NoCampaign_1200_Init
}
}
strategy DialogLine_RootDialog_NAV_NoCampaign_1200_Init(Dia log)
{
precond
{
Dialog:IsDialogLineClicked( "DialogLine_RootDialog_NAV_NoCampaign_1200" ) == 0
}
action
{
Dialog:AddDialogLine( "Text_Dialog_1200" );
Dialog:SetDialogLineClickId( "DialogLine_RootDialog_NAV_NoCampaign_1200" );
}
}
strategy DialogLine_RootDialog_NAV_NoCampaign_1200_Click(Di alog)
{
precond
{
Dialog:IsDialogLineClicked( "DialogLine_RootDialog_NAV_NoCampaign_1200" ) == 1
}
action
{
Dialog:GameCommand( "Get_depth_under_sub_keel", 0, 0 );
Dialog:PlayAnimation( "Generic_Agree03" );
}
}
in the "data\UPCDataGE\UPCLocalization\dialogs.tsr" file :

Quote:
Text_Dialog_1200=Give me depth under kell !
assuming this in Commands.cfg

Quote:
[Cmd130]
Name=Get_depth_under_sub_keel
Contexts=1,14,15
Key0=0x44,c,"Ctrl+D"
MnID=0x3F250005
HasDelayedExecution=Yes
The CTRL D key works fine, but using the dialog command I just get the agree animation.

Any help would be appreciated ^^
Athlonic is offline   Reply With Quote
Old 03-24-10, 04:59 PM   #2
johan_d
Samurai Navy
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 556
Downloads: 113
Uploads: 1
Default

Lets hope HERETIC comes to the rescue, he understands a lot of this..
fingers crossed!
johan_d is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.