View Single Post
Old 03-24-10, 04:47 PM   #7
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