Author Topic: Two questions...  (Read 1735 times)

Legacy_Apeleutheros

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Two questions...
« on: May 04, 2016, 10:58:23 pm »


               

First I want to say I'm really new to scripting. I'm currently trying to slog through and learn the system, so I apologize if my questions are basic or ignorant. I've put together a handful of scripts but I really don't understand the hows and whys yet. I've been working on a module for some time (Mostly making: characters, maps, and an assortment of items.) and am attempting to dig in and learn the nuts and bolt of the toolset.


 


Anyways first question is about the <Race> token used in conversations or the journal. I'm writing a conversation where a NPC greets the PC by saying: "Greeting master <Race>... 'Tis a fine evening, is it not?"


 


My testing character is a dwarf, so I assumed the NPC would say: "Greeting master Dwarf... 'Tis a fine evening, is it not?", but instead he says "Greetings master "dwarven"... 'Tis a fine evening, is it not?"


 


Dwarven is a good racial description of my character but it is not a racial noun.


 


Grammatically this seriously bothers me... like, I want to gouge out my eyes when I see it.  I noticed the same problem while playing through the Aielund saga with a dwarven character recently.


 


Is there another token that states the PC's race as a noun rather than an adjective? If not, does anybody have a script I can copy and paste that will accomplish this?


 


 


Secondly, I was curious how to set up conversations so there is an initial "first time" conversation which has some descriptive points to it, but the after the initial conversation, it reverts to a basic default conversation.


 


Example:


 


(The PC walks up to the inn keeper and initializes a first time conversation.)


 


start- [As you approach the elderly inn keeper is busy wiping down the bar with a dirty rag. As you draw near, he abashedly conceals the filthy rag under the bar, and produces a half smirk.]


 


"What can I do for you?" -end


 


Now on a second conversation, the descriptive part becomes unnecessary, repetitive, and stupid. I know it's probably just a simple script but after working on the module all day my brain is a bit tired and my problem solving skills are shot. I googled around for a copy and paste script I can alter but I'm not coming up with anything. Any help would be appreciated.


 


 


 



               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Two questions...
« Reply #1 on: May 04, 2016, 11:18:15 pm »


               

Have you got a copy of the Lexicon yet? It may or may not prove useful in sorting out your problem. I would urge you to read the description before you download it. Also have you got Lilac Soul's Script generator? I found it a useful tool both as a script generator and a learning tool.


 


TR



               
               

               
            

Legacy_Apeleutheros

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Two questions...
« Reply #2 on: May 04, 2016, 11:54:36 pm »


               


Have you got a copy of the Lexicon yet? It may or may not prove useful in sorting out your problem. I would urge you to read the description before you download it. Also have you got Lilac Soul's Script generator? I found it a useful tool both as a script generator and a learning tool.


 


TR




Thanks. I'm downloading it now. I can use all the help I can get '<img'>.


               
               

               
            

Legacy_AndrueD

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +0/-0
Two questions...
« Reply #3 on: May 05, 2016, 02:51:24 am »


               


Anyways first question is about the <Race> token used in conversations or the journal. I'm writing a conversation where a NPC greets the PC by saying: "Greeting master <Race>... 'Tis a fine evening, is it not?"


 


My testing character is a dwarf, so I assumed the NPC would say: "Greeting master Dwarf... 'Tis a fine evening, is it not?", but instead he says "Greetings master "dwarven"... 'Tis a fine evening, is it not?"


 


Dwarven is a good racial description of my character but it is not a racial noun.


 


Grammatically this seriously bothers me... like, I want to gouge out my eyes when I see it.  I noticed the same problem while playing through the Aielund saga with a dwarven character recently.


 


Is there another token that states the PC's race as a noun rather than an adjective? If not, does anybody have a script I can copy and paste that will accomplish this?




Yah. You can make custom token but just faster to make sentence different like "Greetings [token] creature... 'Tis a fine evening, is it not?" I am thinking use of "master" make it harder to sound right in speech, but keep if you like it that way.


 


Lexicon has simple tutorial that tell better how to use convo.



               
               

               
            

Legacy_KMdS!

  • Sr. Member
  • ****
  • Posts: 364
  • Karma: +0/-0
Two questions...
« Reply #4 on: May 05, 2016, 05:22:58 am »


               

Use the SetCustomToken method and set up a conditional to eveluate the race of the PC speaker....here is something. Place it in the text appears when script slot and use the <custom4651> token in  the text of the conversation.


 


/*
Racial types defined in NWN and their int values
 
int    RACIAL_TYPE_DWARF                = 0;
int    RACIAL_TYPE_ELF                  = 1;
int    RACIAL_TYPE_GNOME                = 2;
int    RACIAL_TYPE_HALFLING             = 3;
int    RACIAL_TYPE_HALFELF              = 4;
int    RACIAL_TYPE_HALFORC              = 5;
int    RACIAL_TYPE_HUMAN                = 6;
int    RACIAL_TYPE_ABERRATION           = 7;
int    RACIAL_TYPE_ANIMAL               = 8;
int    RACIAL_TYPE_BEAST                = 9;
int    RACIAL_TYPE_CONSTRUCT            = 10;
int    RACIAL_TYPE_DRAGON               = 11;
int    RACIAL_TYPE_HUMANOID_GOBLINOID   = 12;
int    RACIAL_TYPE_HUMANOID_MONSTROUS   = 13;
int    RACIAL_TYPE_HUMANOID_ORC         = 14;
int    RACIAL_TYPE_HUMANOID_REPTILIAN   = 15;
int    RACIAL_TYPE_ELEMENTAL            = 16;
int    RACIAL_TYPE_FEY                  = 17;
int    RACIAL_TYPE_GIANT                = 18;
int    RACIAL_TYPE_MAGICAL_BEAST        = 19;
int    RACIAL_TYPE_OUTSIDER             = 20;
int    RACIAL_TYPE_SHAPECHANGER         = 23;
int    RACIAL_TYPE_UNDEAD               = 24;
int    RACIAL_TYPE_VERMIN               = 25;
int    RACIAL_TYPE_ALL                  = 28;
int    RACIAL_TYPE_INVALID              = 28;
int    RACIAL_TYPE_OOZE                 = 29;
*/
 
int StartingConditional()
{
    object oPC = GetPCSpeaker();
    int nRace = GetRacialType(oPC);
    string sResult = "";
 
    switch(nRace)
    {
        case RACIAL_TYPE_DWARF:
            sResult="Dwarf";
            break;
        case RACIAL_TYPE_ELF:
            sResult="Elf";
            break;
        case RACIAL_TYPE_GNOME:
            sResult="Gnome";
            break;
        case RACIAL_TYPE_HALFLING:
            sResult="Halfling";
            break;
        case RACIAL_TYPE_HALFELF:
            sResult="Elf";
            break;
        case RACIAL_TYPE_HALFORC:
            sResult="Orc";
            break;
        case RACIAL_TYPE_HUMAN:
            sResult="";
            break;
    }
    SetCustomToken(4651, sResult);
    return TRUE;
}

               
               

               
            

Legacy_Apeleutheros

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Two questions...
« Reply #5 on: May 05, 2016, 06:27:36 pm »


               


 


Use the SetCustomToken method and set up a conditional to eveluate the race of the PC speaker....here is something. Place it in the text appears when script slot and use the <custom4651> token in  the text of the conversation.



/*
Racial types defined in NWN and their int values
 
int    RACIAL_TYPE_DWARF                = 0;
int    RACIAL_TYPE_ELF                  = 1;
int    RACIAL_TYPE_GNOME                = 2;
int    RACIAL_TYPE_HALFLING             = 3;
int    RACIAL_TYPE_HALFELF              = 4;
int    RACIAL_TYPE_HALFORC              = 5;
int    RACIAL_TYPE_HUMAN                = 6;
int    RACIAL_TYPE_ABERRATION           = 7;
int    RACIAL_TYPE_ANIMAL               = 8;
int    RACIAL_TYPE_BEAST                = 9;
int    RACIAL_TYPE_CONSTRUCT            = 10;
int    RACIAL_TYPE_DRAGON               = 11;
int    RACIAL_TYPE_HUMANOID_GOBLINOID   = 12;
int    RACIAL_TYPE_HUMANOID_MONSTROUS   = 13;
int    RACIAL_TYPE_HUMANOID_ORC         = 14;
int    RACIAL_TYPE_HUMANOID_REPTILIAN   = 15;
int    RACIAL_TYPE_ELEMENTAL            = 16;
int    RACIAL_TYPE_FEY                  = 17;
int    RACIAL_TYPE_GIANT                = 18;
int    RACIAL_TYPE_MAGICAL_BEAST        = 19;
int    RACIAL_TYPE_OUTSIDER             = 20;
int    RACIAL_TYPE_SHAPECHANGER         = 23;
int    RACIAL_TYPE_UNDEAD               = 24;
int    RACIAL_TYPE_VERMIN               = 25;
int    RACIAL_TYPE_ALL                  = 28;
int    RACIAL_TYPE_INVALID              = 28;
int    RACIAL_TYPE_OOZE                 = 29;
*/
 
int StartingConditional()
{
    object oPC = GetPCSpeaker();
    int nRace = GetRacialType(oPC);
    string sResult = "";
 
    switch(nRace)
    {
        case RACIAL_TYPE_DWARF:
            sResult="Dwarf";
            break;
        case RACIAL_TYPE_ELF:
            sResult="Elf";
            break;
        case RACIAL_TYPE_GNOME:
            sResult="Gnome";
            break;
        case RACIAL_TYPE_HALFLING:
            sResult="Halfling";
            break;
        case RACIAL_TYPE_HALFELF:
            sResult="Elf";
            break;
        case RACIAL_TYPE_HALFORC:
            sResult="Orc";
            break;
        case RACIAL_TYPE_HUMAN:
            sResult="";
            break;
    }
    SetCustomToken(4651, sResult);
    return TRUE;
}



Worked beautifully. Thank you!


               
               

               
            

Legacy_Apeleutheros

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Two questions...
« Reply #6 on: May 05, 2016, 06:42:38 pm »


               

I figured out the answer to the other question. It was just a matter of setting up a variable at the end of the conversation and then having the NPC check for the variable on the subsequent conversations.



               
               

               
            

Legacy_Apeleutheros

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Two questions...
« Reply #7 on: May 05, 2016, 06:53:27 pm »


               

I think I've finally created my first simple quest! I even added some nice bells and whistles including:


 


-Custom colored text.


-The quest giver's name is initially "Old Gnome" but after he introduces himself he uses a "SetName" script changing his name to "Meldrik"


-Involves two NPCs. Quest giver asks you to purchase something from the barmaid and offers recompensation.


-A chance for some RP. By tipping the barmaid give the PC 1 good alignment point.


 


Sorry for patting myself on the back, lol. I've always been daunted by scripting and confused by the conversation editor. Having actually accomplished something and having it feeling polished, is extremely encouraging to me.


               
               

               
            

Legacy_KMdS!

  • Sr. Member
  • ****
  • Posts: 364
  • Karma: +0/-0
Two questions...
« Reply #8 on: May 05, 2016, 07:16:44 pm »


               

Congrats!!!!!! Where's the party gonna be? lol. Feels good, I remember, and it still happens to me to this day.



               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Two questions...
« Reply #9 on: May 05, 2016, 07:36:31 pm »


               

Have you tried the built in Plot Wizard or if that's too limited Scriptease?


 


TR



               
               

               
            

Legacy_Apeleutheros

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Two questions...
« Reply #10 on: May 05, 2016, 10:43:53 pm »


               


Have you tried the built in Plot Wizard or if that's too limited Scriptease?


 


TR




I haven't been using the Plot Wizard, but I have downloaded scriptease and will probably give it a try soon.