Author Topic: Conditionals on entering a module  (Read 320 times)

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Conditionals on entering a module
« on: March 01, 2011, 09:58:51 am »


               I'm putting together a module, and in an initial conversation script I'm allowing for porting to a given city based upon the race of the PC.

The conditionals based on race work just fine; the thing is I am not successfully scripting conditionals for multiple ports of the same race.

To explain: I have a NPC that asks where a PC wants to go. There are conditionals based on race, and those show up fine, but my PW has subraces and also the alignments that a player chooses for their character may not be the best choice in relation to the home city, so I want a catch-all city that anyone can go to in addition to their home city.

Somehow, the logic of conversational conditional is tripping me up. Let's say I have a halfling. I want the halfing to be able to go to the halfing city AND the outsider city. I've set up the conversation as:

"Where can I go"
(Response)
...other cities
...halfling city
...catch-all city

My halfling can go to the halfling city, but the conditional seems to be a hard TRUE or FALSE, and does not show the catch-all city, so the PC only gets one option in conversation. I want all PCs to get their home city and the catch-all city as an option in conversation at the outset of the module.

What am I missing here, and why doesn't it work when I attach multiple conditionals but only the first one shows? (for example, if I place the conversation and conditional for the catch-all city first then that's the only conversational option. Flip it around, and the reverse is true).

Any suggestions?
               
               

               


                     Modifié par Badwater, 01 mars 2011 - 10:01 .
                     
                  


            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Conditionals on entering a module
« Reply #1 on: March 01, 2011, 01:02:28 pm »


               Don't put a conditional in the TextAppearsWhen node of the catch all city. Thereby it will appear all the time.
               
               

               


                     Modifié par Baragg, 01 mars 2011 - 01:02 .
                     
                  


            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Conditionals on entering a module
« Reply #2 on: March 01, 2011, 06:48:02 pm »


               

Baragg wrote...

Don't put a conditional in the TextAppearsWhen node of the catch all city. Thereby it will appear all the time.


Well, that's what I thought but that's not happening. It doesn't matter whether I have no conditional at TextAppearsWhen or a conditional that returns TRUE for every race, the text line does not appear.

So what else am I possibly missing here? The conditional is simple enough:

int StartingConditional()
{

    // Accept Halfling race
    if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HALFLING)
        return TRUE;

    return FALSE;
}

I'm baffled as to why I'm not getting the conversational line for the catch-all city.
               
               

               
            

Legacy_Xovian

  • Full Member
  • ***
  • Posts: 158
  • Karma: +0/-0
Conditionals on entering a module
« Reply #3 on: March 01, 2011, 07:01:55 pm »


               

Badwater wrote...

Baragg wrote...

Don't put a conditional in the TextAppearsWhen node of the catch all city. Thereby it will appear all the time.


Well, that's what I thought but that's not happening. It doesn't matter whether I have no conditional at TextAppearsWhen or a conditional that returns TRUE for every race, the text line does not appear.

So what else am I possibly missing here? The conditional is simple enough:

int StartingConditional()
{

    // Accept Halfling race
    if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HALFLING)
        return TRUE;

    return FALSE;
}

I'm baffled as to why I'm not getting the conversational line for the catch-all city.

Try this:

int StartingConditional()
{
if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HALFLING)
      {
       return TRUE;
      }
    return FALSE;
}

The brackets can make a big difference for the return statements.
Also keep in mind you'll want the most restrictive conditionals at the top, and the least at the bottom of your conversation nodes.
               
               

               
            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Conditionals on entering a module
« Reply #4 on: March 01, 2011, 07:26:30 pm »


               I gave the added brackets a go and still no dice. And I do have the catch-all city as the last line of dialogue in that part of the conversation.
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Conditionals on entering a module
« Reply #5 on: March 01, 2011, 07:34:56 pm »


               

Badwater wrote...

I've set up the conversation as:

"Where can I go"
(Response)
...other cities
...halfling city
...catch-all city

Are you making conditional NPC nodes or conditional PC response nodes?

You want it to be more like:

PC: "Where can I go?"
NPC: "Here are your options:"
PC: (List of Available Cities)

-420
               
               

               
            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Conditionals on entering a module
« Reply #6 on: March 01, 2011, 07:48:56 pm »


               The NPC nodes are the conditional ones at the moment:

PC: Where can I enter?
NPC: You may go to ______ (conditional)
PC: (Go to home city or catch-all city) (Jump action script, which works fine)

This is how I currently have it set up. I'd like the NPC to be offering the catch all city as well but it's only returning the 1 line of conversation.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Conditionals on entering a module
« Reply #7 on: March 01, 2011, 10:25:56 pm »


               

Badwater wrote...

The NPC nodes are the conditional ones at the moment:


That is your problem.  A NPC can only chose one node to speak.  He will take the first node that he get a True returned on, and never even look at he ones under it.   You will need for your options to be on the PC responce nodes.   Lke suggested above.   

Where do you want to port to.
- Eleven city.
- Dwarven Hold.
- Goblin stinking hole in the ground.
- Rangers grove.
- Centeral city.
               
               

               


                     Modifié par Lightfoot8, 01 mars 2011 - 10:26 .
                     
                  


            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Conditionals on entering a module
« Reply #8 on: March 02, 2011, 12:01:13 am »


               Thanks everyone; that did the trick.