Stumped on dialogue.

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: Stumped on dialogue.
Apprentice
Member # 4701
Profile #0
I've been making a HLPM for the last couple of days, really just to familiarize myself with the editor before I get started on a real scenario. Anyway, it's basically done, except for a strange problem. I have 7 shops in the HLPM: Priest Spells, Mage Spells, Alchemy Recipes, Combat Skills, Weapons, Armor, and Misc. items. I've set up the shops for each of them (starting with shop 129 and going down, to avoid any kind of inconvenience for a scenario author), and created the dialogue. Nothing special,they just give one little line when you talk to them, and then you can buy whatever. The problem is, only the priest spells teacher works properly. The other 6 at first said nothing when spoken to, and had only an "OK" option to end the conversation. I then discovered I had accidentally made 2 talk node 11s. So I fixed that, and now they give their first line, but the only option is still "OK", ending the conversation. You can't buy from them, and I can't figure out why the Priest works and they don't.

EDIT: Oh, and every shopkeeper is calling the appropriate node when talked to -- I made them call the same node as their creature number, for simplicity (which is why it starts at 6).

Here's my script:
begintalkscript;

begintalknode 6;
state = -1;
nextstate = 1;
question = "Priest Spell Teacher";
text1 = "_Hello, my child. I am here to teach you certain holy rituals, if you wish to learn them._";

begintalknode 7;
state = -1;
nextstate = 2;
question = "Mage Spell Teacher";
text1 = "_Greetings. I am here to teach you certain powerful magics, if you wish._";

begintalknode 8;
state = -1;
nextstate = 3;
question = "Alchemy Teacher";
text1 = "_Hello there, youngsters. I can teach alchemy recipes._";

begintalknode 9;
state = -1;
nextstate = 4;
question = "Skills Teacher";
text1 = "_Here you can learn special combat skills to help in your journey._";

begintalknode 10;
state = -1;
nextstate = 5;
question = "Armor Vendor";
text1 = "_I am an armorsmith. Would you like to browse my wares?_";

begintalknode 11;
state = -1;
nextstate = 6;
question = "Weapons Vendor";
text1 = "_I make weapons. Have a look at my inventory?_";

begintalknode 12;
state = -1;
nextstate = 7;
question = "Item Vendor";
text1 = "_I sell anything that isn't weapons or armor. Have a look?_";

//If you want to change the price adjustment, change the next to last number. The
//same applies to all the shops.
begintalknode 13;
state = 1;
nextstate = -1;
question = "Learn Priest Spells";
code = begin_shop_mode("Priest Spells","", 125,1,1);
text1 = "_Very well. Here are the spells I can teach you._";

begintalknode 14;
state = 2;
nextstate = -1;
question = "Learn Mage Spells";
code = begin_shop_mode("Mage Spells","", 126,1,1);
text1 = "_Of course. Here are the spells I can teach you._";

begintalknode 15;
state = 3;
nextstate = -1;
question = "Learn Alchemy Recipes";
code = begin_shop_mode("Alchemy Recipes","", 124,1,1);
text1 = "_What would you like to learn?_";

begintalknode 16;
state = 4;
nextstate = -1;
question = "Learn Skills";
code = begin_shop_mode("Special Skills","", 123,1,1);
text1 = "_These are the skills you can learn.";

begintalknode 17;
state = 5;
nextstate = -1;
question = "Purchase Armor";
code = begin_shop_mode("Armor","",128,1,1);
text1 = "_Here are the most recent works I've finished._";

begintalknode 18;
state = 6;
nextstate = -1;
question = "Purchase Weapons";
code = begin_shop_mode("Weapons","",129,1,1);
text1 = "_Here's what I got for ya._";

begintalknode 19;
state = 7;
nextstate = -1;
question = "Purchase Items";
code = begin_shop_mode("Items",127,1,1);
text1 = "_What would you like?_";

break;
It's probably some stupid little thing I'm not seeing.

Also, I have another minor problem. The first time the player moves, the game gives the message

trainer Error: State not found -2 (trainer is the scenario script)

Nowhere do I try to call a state -2. I have "variables;", "LOAD_SCEN_STATE", and "START_SCEN_STATE". Am I missing anything? The game keeps running just fine, but it's a bit annoying and unpolished to have that message there.

[ Tuesday, July 13, 2004 06:07: Message edited by: Blank83 ]
Posts: 4 | Registered: Monday, July 12 2004 07:00
Shock Trooper
Member # 3276
Profile #1
You are missing INIT_STATE.
Also, the text1 is shown AFTER the shopping is OVER with, so it makes more sense for it to say you finish shopping. Other then that, I will copy and paste your script into my testing scenerio and hammer out whats wrong.
Be right back.

EDIT! Oh! You should NOT have break; at the end of dialouge scripts!

EDIT 2:Sorry, my eyes are bad and cant read the small code print until I paste it to something larger :(
Well, Why do you start with node 6? You have a new set of nodes and states for each town.

EDIT 3:I know people have their own ways of doing things, but I suggest a series of nodes together that are for one charecter.Like nodes 1-10 could be for one and 11-20 could be for another.

EDIT 4: You forgot your break after beginshopmode. Also, have the code after the code line, like
code =
Your code here;
break;

EDIT 5: This is how the script looks with all the changes. It will now work.
begintalkscript;

begintalknode 1;
state = -1;
nextstate = 1;
question = "Priest Spell Teacher";
text1 = "_Hello, my child. I am here to teach you certain holy rituals, if you wish to learn them._";

begintalknode 2;
state = -1;
nextstate = 2;
question = "Mage Spell Teacher";
text1 = "_Greetings. I am here to teach you certain powerful magics, if you wish._";

begintalknode 3;
state = -1;
nextstate = 3;
question = "Alchemy Teacher";
text1 = "_Hello there, youngsters. I can teach alchemy recipes._";

begintalknode 4;
state = -1;
nextstate = 4;
question = "Skills Teacher";
text1 = "_Here you can learn special combat skills to help in your journey._";

begintalknode 5;
state = -1;
nextstate = 5;
question = "Armor Vendor";
text1 = "_I am an armorsmith. Would you like to browse my wares?_";

begintalknode 6;
state = -1;
nextstate = 6;
question = "Weapons Vendor";
text1 = "_I make weapons. Have a look at my inventory?_";

begintalknode 7;
state = -1;
nextstate = 7;
question = "Item Vendor";
text1 = "_I sell anything that isn't weapons or armor. Have a look?_";

//If you want to change the price adjustment, change the next to last number. The
//same applies to all the shops.
begintalknode 8;
state = 1;
nextstate = -1;
question = "Learn Priest Spells";
code =
begin_shop_mode("Priest Spells","", 125,1,1);
break;
text1 = "_Very well. Here are the spells I can teach you._";

begintalknode 9;
state = 2;
nextstate = -1;
question = "Learn Mage Spells";
code =
begin_shop_mode("Mage Spells","", 126,1,1);
break;
text1 = "_Of course. Here are the spells I can teach you._";

begintalknode 10;
state = 3;
nextstate = -1;
question = "Learn Alchemy Recipes";
code =
begin_shop_mode("Alchemy Recipes","", 124,1,1);
break;
text1 = "_What would you like to learn?_";

begintalknode 11;
state = 4;
nextstate = -1;
question = "Learn Skills";
code =
begin_shop_mode("Special Skills","", 123,1,1);
break;
text1 = "_These are the skills you can learn.";

begintalknode 12;
state = 5;
nextstate = -1;
question = "Purchase Armor";
code =
begin_shop_mode("Armor","",128,1,1);
break;
text1 = "_Here are the most recent works I've finished._";

begintalknode 13;
state = 6;
nextstate = -1;
question = "Purchase Weapons";
code =
begin_shop_mode("Weapons","",129,1,1);
break;
text1 = "_Here's what I got for ya._";

begintalknode 14;
state = 7;
nextstate = -1;
question = "Purchase Items";
code =
begin_shop_mode("Items",127,1,1);
break;
text1 = "_What would you like?_";
The problems: You had break after the entire script but forgot your breaks in the code = places.
Boy Im feeling very nice today. :D

[ Tuesday, July 13, 2004 06:33: Message edited by: GIFTSare2dumb ]
Posts: 249 | Registered: Saturday, July 26 2003 07:00
Off With Their Heads
Member # 4045
Profile Homepage #2
I believe this script will still fail if you try to run node 14, because you are missing the second string. That second string, by the way, is probably what you wanted when you wrote your text1's for each of these nodes. Just move the text1's into the second string of the begin_shop_mode and then write a new text1 for finishing shopping.

AND WHY ON EARTH ARE YOU MAKING A HLPM?! (Check link in sig!)

EDIT: You also need a scenario START_STATE. Not sure if it gives an error if you don't have it, but you should have it anyway. (Yes, this is different from the START_SCENARIO_STATE. Look at VoDT's scenario script if you want to know all the states that you should have.)

[ Tuesday, July 13, 2004 09:56: Message edited by: Just Call Me Kel ]

--------------------
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
Apprentice
Member # 4701
Profile #3
quote:
Originally written by Just Call Me Kel:

AND WHY ON EARTH ARE YOU MAKING A HLPM?! (Check link in sig!)
EDIT: You also need a scenario START_STATE. Not sure if it gives an error if you don't have it, but you should have it anyway. (Yes, this is different from the START_SCENARIO_STATE. Look at VoDT's scenario script if you want to know all the states that you should have.)

quote:
Originally written by Blank83:

really just to familiarize myself with the editor before I get started on a real scenario
I had never really planned on releasing it.

And thanks both of you. I did end up figuring out the START_STATE part on my own, though.

[ Tuesday, July 13, 2004 10:07: Message edited by: Blank83 ]
Posts: 4 | Registered: Monday, July 12 2004 07:00
Shake Before Using
Member # 75
Profile #4
Well, there were HLPMs before Drakey made his...
Posts: 3234 | Registered: Thursday, October 4 2001 07:00