Jump to content

Home

Different dialog, same name


boinga1

Recommended Posts

I'm in a bit of a tight spot. I need to edit the dialogue for the twi'lek domo in the Nar Shadda cantina to allow another character to wear the dancer's outfit. As my mod is now, male characters have no one who can do it, making the quest impossible to complete. However, I can't simply edit the twidomo.dlg file, because there is another dialogue of the same name in the Docks module, which is also an essential part of the quest.

 

My question: is there any way to make this work? I have a vague idea that it would be possible through the use of local or global variables, but I have no idea if or how this would work. Can anyone help?

Link to comment
Share on other sites

I haven't looked, but how about the .utc files that speak the dialogs ... are either of them unique? If so, you could modify the unique utc to speak a different dialog. You'd have to start a game prior to entering Nar Shadaa however.

Link to comment
Share on other sites

If all else fails, you could venture into the domain of extremely ugly hacks....

 

Copy the twidomo.dlg file from 303NAR (Docks) and rename it 303_twidomo.dlg. Then copy the twidomo.dlg file from 306NAR (Cantina) and rename it 306_twidomo.dlg.

 

Then modify the standard OnDialogue event script, "k_def_dialogue01", with something like this:

 

//:: k_def_dialogue01
/*
   Default On Dialogue Script
*/
//:: Created By: Preston Watamaniuk
//:: Copyright (c) 2002 Bioware Corp.

#include "k_inc_generic"
#include "k_inc_switch"
#include "k_inc_utility"


void main()
{
   if (GetTag(OBJECT_SELF) != "TwilekDomo") {
       // ST: This is not the twi'lek you are looking for...
       ExecuteScript( "k_ai_master", OBJECT_SELF, KOTOR_DEFAULT_EVENT_ON_DIALOGUE );
   }
   else {      
       // ST: It's one of the TwilekDomo creatures!
       // ST: OnDialog event code copied from k_ai_master so it can be modified...
       int nMatch = GetListenPatternNumber();
       if(GN_GetSpawnInCondition( SW_FLAG_EVENT_ON_DIALOGUE_INTERRUPT ))
       {
           if( nMatch == -1 )
           {
               ResetDialogState();
           }
           SignalEvent(OBJECT_SELF, EventUserDefined(1004));
           return;
       }

       if(!GN_GetSpawnInCondition(SW_FLAG_AI_OFF))
       {
           object oShouter = GetLastSpeaker();
           object oIntruder;
           object oAttacker = GetLastHostileActor(oShouter);
           if(!GetIsObjectValid(oAttacker) || GetIsDead(oAttacker) || !GetObjectSeen(oAttacker, oShouter)
              || !GetIsEnemy(oAttacker, oShouter))
           {
               if(GetCommandable())
               {
                   if (nMatch == -1)
                   {
                       ClearAllActions();
                       if(GN_GetSpawnInCondition( SW_FLAG_ON_DIALOGUE_COMPUTER ))
                       {
                           ActionStartConversation( GetFirstPC(), "", FALSE, CONVERSATION_TYPE_COMPUTER );
                           return;
                       }
                       else
                       {
                           // ST: If the Domo is in the Docks, use the 303_twidomo.dlg file...
                           if (GetModuleName() == "303NAR")
                               BeginConversation("303_twidomo");
                           // ST: If the Domo is in the Ent. Cantina, use the 306_twidomo.dlg file...
                           else if (GetModuleName() == "306NAR")
                               BeginConversation("306_twidomo");
                           else
                               BeginConversation();
                           return;
                       }
                   }
                   else
                   if(nMatch != -1 && GetIsObjectValid(oShouter) && !GetIsPC(oShouter) && GetIsFriend(oShouter))
                   {
                       if (nMatch >= 1)
                       {
                           oIntruder = GetLastHostileActor(oShouter);
                           if(!GetIsObjectValid(oIntruder))
                           {
                               oIntruder = GetAttemptedAttackTarget();
                               if(!GetIsObjectValid(oIntruder))
                               {
                                   oIntruder = GetAttemptedSpellTarget();
                                   if(!GetIsObjectValid(oIntruder))
                                   {
                                       oIntruder = GetNearestCreature( CREATURE_TYPE_REPUTATION, 
                                                               REPUTATION_TYPE_ENEMY, 
                                                               OBJECT_SELF, 1, 
                                                               CREATURE_TYPE_PERCEPTION, 
                                                               PERCEPTION_SEEN);
                                       if(!GetIsObjectValid(oIntruder))
                                       {
                                           oIntruder = OBJECT_INVALID;
                                       }
                                   }
                               }
                           }
                       }

                       GN_RespondToShout(oShouter, nMatch, oIntruder);
                   }
               }
           }
       }
       if( nMatch == -1 )
       {
           ResetDialogState();
       }
       if(GN_GetSpawnInCondition( SW_FLAG_EVENT_ON_DIALOGUE ))
       {
           SignalEvent(OBJECT_SELF, EventUserDefined(1004));
       }       
   }
}

 

Compile and put in Override along with your two renamed dialog files.

 

Then it would make exceptions for those two files and use them instead of the ones set in the Dialog field in the UTC, if the creature is a Twi'Lek Domo in one of those two areas.

Link to comment
Share on other sites

Another option would be to combine the two dialogs.

 

You could do this by putting the 303NAR dialog as the first branch of the 306NAR dialog. Add to it a conditional script that returns true if the current module is 303NAR. Otherwise, fall through to the (lengthy) 306NAR dialog.

int StartingConditional () {
string sModule=GetModuleFileName();
if (sModule=="303NAR") {
 return TRUE;
}
return FALSE;
}

 

This method would take some patient dialog editing.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...