Well-Actually War Trall BainIhrno Posted December 15, 2011 Share Posted December 15, 2011 begintownscript; variables; body; set_name(1,"Lacey") beginstate INIT_STATE; break; beginstate EXIT_STATE; break; beginstate START_STATE; break; This is my town script so far. It's not much, but I want to be on the right track before I write anything else. I don't see anything wrong with my script, but I get an "invalid symbol in line 1" message. Thanks. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Dintiradan Posted December 15, 2011 Share Posted December 15, 2011 Haven't done BoA scripting in a long while, but I think the set_name call needs to be inside INIT_STATE. Also, you need a semicolon at the end as well. Quote Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody BJ Back From the Beyond Posted December 15, 2011 Share Posted December 15, 2011 Yeah, Dintiradan's right. It should look something like this: Quote: begintownscript; variables; body; beginstate INIT_STATE; set_name(1,"Lacey"); break; beginstate EXIT_STATE; break; beginstate START_STATE; break; Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall BainIhrno Posted December 19, 2011 Author Share Posted December 19, 2011 Thanks, but I've fixed it now and still have that same error message. Here is my dialogue script (so far). begintalkscript; variables; begintalknode 1; state = 1; personality = 1; nextstate = 2; question = "Lacey"; text1 = "You see a mage pacing around the room. She looks up at you."; begintalknode 2; state = 1; personality = 1; nextstate = 3; question = "What do you do?"; text1 = "_I am the town sage and library keeper. I can teach you spells as well as identify your items._"; begintalknode 3; state = 1; personality = 1; nextstate = 4; question = "What do you know about the building on the island?" text1 = "_I have attempted to scry it, but someone inside blocked the spell. That is why we need you to investigate._"; begintalknode 4; state = 1 personality = 1 nextstate = -1 question = "Can you identify my items?" action = ID 10; begintalknode 5; state = 1; personality - 1; nextstate = 7; question = "Can I purchase some mage spells?"; begin_shop_mode("Lacey's Magicks", "There are many useful spells that Lacey can teach you but they aren't cheap.", 1, 3, -1); Quote Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody BJ Back From the Beyond Posted December 19, 2011 Share Posted December 19, 2011 There are several mistakes there, but they're easily fixed. First off, you're missing a semicolon in talk node 3, the line with the question in it, and four more semicolons are missing in talk node 4, the state, personality, nextstate, and question lines. In talk node 5, the personality line has a "-" instead of a "=". Also in talk node 5, you need to put "code =" in front of the "begin_shop_mode" call and then add a "break;" after it, just like you were making a state in any other type of script. Talk node 4 needs at least one text line, even if you don't put anything in the string at this time. Finally, the state in talk node 1 needs to equal -1, since it's the first node in the conversation, and the nextstate needs to be 1. Below is the script with the mistakes I found fixed. I might have missed one, so don't take me on my word that it will work yet. Click to reveal.. begintalkscript; variables; begintalknode 1; state = -1; personality = 1; nextstate = 1; question = "Lacey"; text1 = "You see a mage pacing around the room. She looks up at you."; begintalknode 2; state = 1; personality = 1; nextstate = 3; question = "What do you do?"; text1 = "_I am the town sage and library keeper. I can teach you spells as well as identify your items._"; begintalknode 3; state = 1; personality = 1; nextstate = 4; question = "What do you know about the building on the island?"; text1 = "_I have attempted to scry it, but someone inside blocked the spell. That is why we need you to investigate._"; begintalknode 4; state = 1; personality = 1; nextstate = -1; question = "Can you identify my items?"; text1 = ""; action = ID 10; begintalknode 5; state = 1; personality = 1; nextstate = 7; question = "Can I purchase some mage spells?"; code = begin_shop_mode("Lacey's Magicks", "There are many useful spells that Lacey can teach you but they aren't cheap.", 1, 3, -1); break; Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall BainIhrno Posted December 19, 2011 Author Share Posted December 19, 2011 Thanks for your help! Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted December 20, 2011 Share Posted December 20, 2011 Alint has idiosyncracies but it does usually work, one good topic about it is: Alint Error Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall BainIhrno Posted December 23, 2011 Author Share Posted December 23, 2011 Okay, new question. Here is my townscript for my first town. begintownscript; variables; body; beginstate INIT_STATE; set_name(1,"Captain Tillos"); break; beginstate EXIT_STATE; break; beginstate START_STATE; break; beginstate 10; if (get_flag(2,1) > 0); end(); else if (get_flag(2,0) > 0); activate_hidden_group(1); add_dialog_str(0,"As you exit the captain's office, you hear a spell. You look around and notice lots of new people in the fort. They have impressive looking armor and deadly weapons. They stand in silence for a few moments, and then one of the bladesmen yells, "ATTACK!",0); add_dialog_str(1, "You also hear a growl behind you. It is a large six-legged dog. You're not sure what it is, but it's about to kill the Captain.",1); add_dialog_str(2, "You thought you would be fighting Nephilim, but it looks like you will face a more deadly threat. Time to see what's going on.",2); end(); Here is the Alint report: Checking file 't2FortMcCone.txt': Error line 1: No script type header Error line 2: Syntax error [statement] Error line 3: Syntax error [statement] Error line 8: Syntax error [statement] Error line 10: Syntax error [statement] Error line 12: Syntax error [statement] Error line 14: Syntax error [statement] Error line 15: Syntax error [statement] Error line 16: Syntax error [statement] Error line 18: Syntax error [statement] Error line 19: Syntax error [statement] Error line 21: Syntax error [statement] Error line 22: Syntax error [statement] Error line 24: Syntax error [statement] Error line 25: Syntax error [statement] Error line 26: Syntax error [statement] Error line 27: Syntax error [statement] Error line 28: Syntax error [statement] Error line 29: String not terminated Error line 30: Syntax error [statement] Error line 31: Syntax error [statement] Error line 32: Syntax error [statement] The "No script type header" confuses me. Isn't that "begintownscript"? Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Dintiradan Posted December 23, 2011 Share Posted December 23, 2011 Haven't tried to run this, but the error is probably here: Code: add_dialog_str(0,"As you exit the captain's office, you hear a spell. You look around and notice lots of new people in the fort. They have impressive looking armor and deadly weapons. They stand in silence for a few moments, and then one of the bladesmen yells, "ATTACK!",0); Strings in AvernumScript (and other languages) start and end whenever a double quotation mark is read. So the string starts with "As you exit... and ends with ...bladesmen yells, ". And then the parser has no idea what to do with ATTACK! sitting in the middle of your program. The way you display double quotation marks in the game is by putting underscores ('_') in your strings. Also, Code: if (get_flag(2,1) > 0);end();else if (get_flag(2,0) > 0);activate_hidden_group(1); You have if statements that have a semicolon after the conditional. If statements take the form Code: if (some condition is true) do some action; Just one semicolon. So what your code is actually doing is this: Code: if (get_flag(2,1) > 0) (do nothing);end();else if (get_flag(2,0) > 0) (do nothing);activate_hidden_group(1); You've got two options. You can take out the semicolon after the conditional: Code: if (get_flag(2,1) > 0) end();else if (get_flag(2,0) > 0) activate_hidden_group(1); Or, to be more explicit about what's included in your if statements (and to avoid accidentally inserting spurious semicolons), I recommend using braces: Code: if (get_flag(2,1) > 0) { end();} else if (get_flag(2,0) > 0) { activate_hidden_group(1);} (Hey, I can spot bugs a lot easier after TAing introductory computing courses. Youpi!) Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Enraged Slith Posted December 23, 2011 Share Posted December 23, 2011 I think you also need a reset_dialog(); before your dialog_str calls and a <variable> = run_dialog(); afterwards. Quote Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody BJ Back From the Beyond Posted December 23, 2011 Share Posted December 23, 2011 Dintiradan and ES are both right. When creating a dialog box (except when using the message_dialog call) you'll need a reset_dialog(); at the beginning and a run_dialog(x); at the end (the x there can be either 1 or 0, depending on if you want the player to be able to record the encounter in their journal or not). run_dialog will also return a value equal to the dialog choice the player chooses. Also, it doesn't look like you need that second end(); And always end a state with a break; Below is the code with the changes mentioned so far. Click to reveal.. beginstate 10; if (get_flag(2,1) > 0) { end(); } else { if (get_flag(2,0) > 0) { activate_hidden_group(1); reset_dialog(); add_dialog_str(0,"As you exit the captain's office, you hear a spell. You look around and notice lots of new people in the fort. They have impressive looking armor and deadly weapons. They stand in silence for a few moments, and then one of the bladesmen yells, _ATTACK!_",0); add_dialog_str(1, "You also hear a growl behind you. It is a large six-legged dog. You're not sure what it is, but it's about to kill the Captain.",1); add_dialog_str(2, "You thought you would be fighting Nephilim, but it looks like you will face a more deadly threat. Time to see what's going on.",2); run_dialog(0); } } break; Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall BainIhrno Posted December 23, 2011 Author Share Posted December 23, 2011 Thanks everyone! I identified another problem using a demo of BBEdit. I'm not going to have it forever ($50 is pretty expensive!), but when I looked at the code of my script there, this is what I got: (Note this is a different town, I fixed the first one, I'm just showing what the problem is). Click to reveal.. {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fmodern\fcharset0 Courier;} {\colortbl;\red255\green255\blue255;\red38\green38\blue38;} \margl1440\margr1440\vieww9000\viewh8400\viewkind0 \deftab720 \pard\pardeftab720\ql\qnatural \f0\fs26 \cf2 \ begintownscript;\ \ variables;\ \ body;\ \ beginstate INIT_STATE;\ set_name(1,"Lacey");\ set_name(2,"Chloe");\ set_name(3,"D'Khar");\ set_name(4,"Jeff");\ set_name(5,"Tim");\ set_name(6,"Luis");\ break;\ \ beginstate EXIT_STATE;\ break;\ \ beginstate START_STATE;\ break;} Obviously, there's gibberish in some of the script that doesn't show up in the text file. I'm not sure how it got there. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted December 23, 2011 Share Posted December 23, 2011 The clue is where it says 'rtf': Your data is in the form of formatted, 'rich' text (with font and size information, and so on) but the game only knows how to deal with unformatted, ASCII text (which is the same as UTF-8 encoded unicode, as long as you avoid any fancy characters). So, make sure that whichever text editor you use is set to save your file as 'Plain Text', or the nearest equivalent option. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted December 23, 2011 Share Posted December 23, 2011 Crimson Editor, or the Mac equivalent, is a good idea for scripting. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall BainIhrno Posted December 24, 2011 Author Share Posted December 24, 2011 Thanks for your help everyone! I've got the first node in my BoA scenario working! I'm currently trying to figure out how to call a town state when a creature is killed. Is that possible in BoA? Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted December 24, 2011 Share Posted December 24, 2011 Yes, use run_town_script(). Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted December 24, 2011 Share Posted December 24, 2011 As I recall, I set up specdeath (in any of my various scenarios) to do this with memory cells. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall BainIhrno Posted December 24, 2011 Author Share Posted December 24, 2011 Kel, I took a look at specdeath in Bahssikava and I think that makes it easiest, is it okay if I just use your specdeath script, provided I give you credit in the readme? Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted December 25, 2011 Share Posted December 25, 2011 Yeah, use whatever you want from whatever. I tried to make some really simple but versatile scripts, particularly in Exodus; use whatever you want. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall BainIhrno Posted December 26, 2011 Author Share Posted December 26, 2011 Thanks. New question, I've started playing through my first town. Is there any way I can change the monsters summoned with spells? If Vampires can be summoned with Arcane Summon, they just keep summoning themselves. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Enraged Slith Posted December 26, 2011 Share Posted December 26, 2011 You have to edit the scenario data script. I don't know if you can simply edit their summon class or if you have to completely overwrite them. You can add monsters to default summoning spells via the summon class. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted December 26, 2011 Share Posted December 26, 2011 You can overwrite the vampire in your scenario data script something like this: Code: begindefinecreature 255; import = <id of vampire>;begindefinecreature <id of vampire>; cr_summon_class = 0; etc I forget if 255 actually is the max creature ID though. (This is from memory, so details may be incorrect.) Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted December 27, 2011 Share Posted December 27, 2011 Yes it is correct. Here is the chapter and verse on cr_summon_class: "cr_summon_class (Defaults to -1) Determines whether a creature can be summoned by summoning spells. If left at -1, no. Otherwise, the higher the number, the more powerful a spell it takes to summon it (5 and above means it is very, very difficult to summon)." Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.