Author Topic: Dialogue Help: The Sequel (with more problems than the original)  (Read 315 times)

Legacy_redmokah

  • Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Dialogue Help: The Sequel (with more problems than the original)
« on: February 16, 2011, 01:47:25 am »


               I find it humbling that even though I had basic knowledge in C++, I can't even figure out how to program the most basic actions in NWScript ):

So I'm trying to create a full cutscene where the PC is invisible. I'll figure out all the camera angles and crazy stuff later, but right now I'm trying to make two NPC's have a conversation with each other. Assuming there's no way to have NPC-to-NPC dialogue box conversations, this will have to be shown through floaty text.

I'm can't seem to figure out how to correctly stagger the text, so that one line will appear, wait a few seconds, the next line appears, waits a few seconds and so on and so forth. All the actions seem to start at the same time, and my ActionWait commands are applied individually rather than in sucession.

Also, I noticed when the script executed my code, it didn't name the player whatever the user would have named the PC, but rather just called him/her 'Player'. "So I got a dialogue that went: You're looking for Player?"

// I have no idea what the code is to insert the code into text boxes haha. I tried variants of 'nwscript', but none of them worked ):

void main ()
{
    // Variable Declaration of Independence
    object npc_vurk = GetObjectByTag ("npc_vurk");
    object npc_amilia = GetObjectByTag ("npc_amilia");
    object npc_lemli = GetObjectByTag ("npc_lemlia");
    object npc_vrish = GetObjectByTag ("npc_vrish");
    string pc_alias = GetPCPlayerName (GetEnteringObject());

    // Dialogue Strings
    string talk_prison001 = "Hello miss. Correct me if I'm wrong, but I ain't see you round here before. How can Vurk be of service?";
    string talk_prison002 = "... I'm here to see " + pc_alias;
    string talk_prison003 = "You want to see " + pc_alias + "? Haha. Can't do that. A prisoner in solitary ain't seein' nobody.";
    string talk_prison004 = "Where's Lemli?";
    string talk_prison005 = "The warden? That ain't goin' do much. It's state law miss--";
    string talk_prison006 = "Miss...";
    string talk_prison007 = "Miss!!!";

    // Meat of the Story
    AssignCommand (npc_vurk, ActionSpeakString (talk_prison001));
    ActionWait(5.0);
    AssignCommand (npc_amilia, ActionSpeakString (talk_prison002));
    ActionWait(5.0);s
    AssignCommand (npc_vurk, ActionSpeakString (talk_prison003));
    ActionWait(5.0);
    AssignCommand (npc_amilia, ActionSpeakString (talk_prison004));
    ActionWait(3.0);
    AssignCommand (npc_vurk, ActionSpeakString (talk_prison005));
    ActionWait(3.5);
    AssignCommand (npc_amilia, ActionSpeakString (talk_prison006));
    ActionWait(1.5);
    AssignCommand (npc_vurk, ActionSpeakString (talk_prison007));

}
               
               

               


                     Modifié par redmokah, 16 février 2011 - 01:54 .
                     
                  


            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Dialogue Help: The Sequel (with more problems than the original)
« Reply #1 on: February 16, 2011, 02:19:19 am »


               You actually can set it up so they speak to eachother, or at the very least, make it looks like they are speaking to eachother.

I am the same way with have the c++ background, and the logic still remains.



Download Lilac Soul's NWN Script Generator V2.3 from http://nwvault.ign.c...r.detail&id=625

It will help a ton if you dont use it already. Using this alone will give you the ability to have them both speak to eachother.
               
               

               
            

Legacy_Krevett

  • Full Member
  • ***
  • Posts: 203
  • Karma: +0/-0
Dialogue Help: The Sequel (with more problems than the original)
« Reply #2 on: February 16, 2011, 03:32:55 am »


               Use the GetName function instead of GetPCPlayerName to get the name of the character. And Use DelayCommand to Delay your SpeakString by 2 to 3 seconds to get them appearing in the right order
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Dialogue Help: The Sequel (with more problems than the original)
« Reply #3 on: February 16, 2011, 03:44:25 am »


               As Krevett already replied, you need to use GetName in place of GetPCPlayerName. You also need to assign the ActionWait to each NPC.

AssignCommand(npc_vurk, ActionWait(5.0));

Hope that helps.
               
               

               


                     Modifié par GhostOfGod, 16 février 2011 - 03:44 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Dialogue Help: The Sequel (with more problems than the original)
« Reply #4 on: February 16, 2011, 03:46:14 am »


               I can see a few misunderstandings of the system here. First Function - GetPCPlayerName returns the name of the player or the players account name not the name of the character the player is playing. To get the name of the players character use.: Function - GetName


Second you can add as many NPC to a standard conversation as you want.  You just need to add there tag to the speaker box  on the node you want them to speak.  Check chapter 5 in The Guide to Building Volume I – The Aurora Toolset Manual 

Next there seems to be a miss understanding of the fact that all scripts run on an object.  Since this script is useing GetEnteringObject(); To define oPC I can only assume that it is running on either a door,area or trigger.   every one of your ActionWait( fdelays) will be adding a pause into that objects action que and have zero effect on any of your npc. 

A brief discription of the action que.   

Action que's are a first in first out buffer on objects(but not all objects) it is a list of actions for that object to take.  As soon as the object finishes an action, it goes to the action que stored on its object, to get the next action to do off the top of the list. 

Hence what you are doing is adding several different strings to speak, to several differant action que's, not to a single action que.  all of your wait instructions since they ar not assigned are being placed into the action que of the object that the script is running on.   I think you can see the problem here. 

you may want to check out:Tutorial - Robert Johnsen - Handling Cutscene Delays
               
               

               


                     Modifié par Lightfoot8, 16 février 2011 - 03:51 .
                     
                  


            

Legacy_redmokah

  • Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Dialogue Help: The Sequel (with more problems than the original)
« Reply #5 on: February 19, 2011, 05:37:45 am »


               Thank you guys so much (: All this really helped me a lot and I think I'm finally getting a grip on NWScript fundamentals.