Buggy Dialog

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Buggy Dialog
Shock Trooper
Member # 5459
Profile Homepage #0
Okay so I can't quite figure out what's causing the dialog in my scenario to go crazy for some players (at least SkeleTony and DreamGuy). The problem is, I've been told, that the NPCs give all the responses when they're only supposed to give half of them. Here are two examples of the dialog script:

begintalknode 19;
state = 19;
nextstate = -1;
question = "Greetings Mahrmmrrh. What are you doing here?";
text1 = "_No no. Put more stress on the 'mmrr' and to answer your question I work for Master Tybonson. I am his servant or butler, whichever he needs more._";
text2 = "_I see that the nephil in your group has taught you the proper stress on nephilm names. But to answer your question, I work for Master Tybonson. I am his servant or butler whichever he needs more._";
code = if (species_in_party(2) == 0)
remove_string(2);
else
remove_string(1);
break;

begintalknode 28;
state = -1;
nextstate = 29;
question = "Mayor";
text1 = "There are two people sitting round a large desk in this small room. The first is the captain of the troops in Sattle, the second is the mayor. She is in her forties and is currently looking exhausted.";
text2 = "_Mm... looks like we got visitors Bobby. Greetings and welcome to our village, although currently not as peaceful as it used to be._ She gestures at the maps and parchments on the desk.";
text3 = "They are maps of the surrounding areas. _I am mayor Worrington and this is captain Remington. What can we do for you?_";
text4 = "_Mm... looks like we got... By the gods! Bobby look!_ She points at a slith in your group. _What are you doing here? How did you get in here._ The captain speaks. _Calm down Evelyn. I'm sure this is not our enemy._";
text5 = "The mayor is still sitting around her desk.";
action = INTRO;
code = if (species_in_party(3) == 0)
remove_string(4);
else {
remove_string(2);
remove_string(3);
}

I'm beginning to think that maybe the problem is with SkeleTony's and DreamGuy's version of the scenario (their download was corrupted or something. :confused: )

If anyone knows what the problem could be, I'm all ears.

[ Tuesday, March 15, 2005 01:29: Message edited by: Smoo ]

--------------------
These are my scenarios. I may have too much free time but I really don't care.
Backwater Calls, Magus of Cattalon, Rats Aplenty
Get them here
Visit The Lyceum for all your rating needs.
Posts: 211 | Registered: Sunday, January 30 2005 08:00
...b10010b...
Member # 869
Profile Homepage #1
I think the problem is that you're using if-else incorrectly. If you use "else" in a conditional statement, you MUST also put braces around the code to execute if the condition is true.

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Infiltrator
Member # 148
Profile #2
Use break;

--------------------
My ego is bigger than yours.
Posts: 480 | Registered: Thursday, October 11 2001 07:00
Shock Trooper
Member # 5459
Profile Homepage #3
Even if that is the case Thuryl, why aren't I having the problem? Why is the dialog buggy with only some players? And should the code be like this?

code = if (species_in_party(2) == 0) {
remove_string(2);
}
else
remove_string(1);
break;

Please use illustrations and write as if you're giving advice to a complete idiot.

And the code had a break. It just eluded my copying skills.

--------------------
These are my scenarios. I may have too much free time but I really don't care.
Backwater Calls, Magus of Cattalon, Rats Aplenty
Get them here
Visit The Lyceum for all your rating needs.
Posts: 211 | Registered: Sunday, January 30 2005 08:00
...b10010b...
Member # 869
Profile Homepage #4
If I were you I'd just use braces with absolutely every conditional to make sure. No harm in it.

Anyway, the reason I suggested that as the possible problem is that Bahssikava's Guardpost used to have the same bug in beta, and looking at the two dialogue scripts the only difference I see now is that one uses "else" statements and the other doesn't.

In fact, try rephrasing your dialogue script without "else" and see if that helps. So:

code =
if (species_in_party(2) == 0)
remove_string(2);
if (species_in_party(2) != 0)
remove_string(1);

EDIT: I do notice that another difference is that Kelandon puts a carriage return after "code =" and you don't. No idea if this has relevance.

[ Wednesday, March 16, 2005 10:49: Message edited by: Thuryl ]

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Off With Their Heads
Member # 4045
Profile Homepage #5
That wasn't the problem with my script, as I recall. Moreover, I don't uses braces every single time I use the if-else setup -- look at the early towns in Bahssikava. I don't think that's the problem.

It's possible that species_in_party is bugged, or something bizarre is going on with the syntax here.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Infiltrator
Member # 148
Profile #6
I just copied this from the first post:
code = if (species_in_party(3) == 0)

Is there a species #3? I thought the valid range was 0-2.

Edit:
Try adding get_species(which_char) to the dialog code. After it runs through the party members, you can see values it returns. Maybe there is a problem with the program.

[ Wednesday, March 16, 2005 19:10: Message edited by: Dahak ]

--------------------
My ego is bigger than yours.
Posts: 480 | Registered: Thursday, October 11 2001 07:00
Shock Trooper
Member # 5459
Profile Homepage #7
I guess I'll just write the dialog without the else and hope the problem will be fixed by that.

Thanks for your help.

--------------------
These are my scenarios. I may have too much free time but I really don't care.
Backwater Calls, Magus of Cattalon, Rats Aplenty
Get them here
Visit The Lyceum for all your rating needs.
Posts: 211 | Registered: Sunday, January 30 2005 08:00
Infiltrator
Member # 4637
Profile Homepage #8
Are all players using the same BoA version? You should use the most up-to-date version. Maybe that's why some get the error and others not. Probably there was a bug in the earlier versions.

--------------------
Visit the Blades of Avernum Center
and the Beta Testing Center

--------------
"Beware lest anyone cheat you through philosophy and empty deceit, according to the tradition of men, according to the basic principles of the world, and not according to Christ." Colossians 2:6-9
Posts: 483 | Registered: Tuesday, June 29 2004 07:00
Warrior
Member # 5415
Profile #9
I have the most recent version of BoA, and I saw all sorts of problems like the ones mentioned above. Constantly, all over. Not every single person I talked to, but a smallish but significant percentage of them, and especially in the town by the mine. This scenario was the only one I ever saw have a problem with that, so it's logical to assume that it's in the coding of the scenario.
Posts: 62 | Registered: Thursday, January 20 2005 08:00