Curious Artila Alex5 Posted March 30, 2009 Share Posted March 30, 2009 I need to learn scripting if I want to make a scenario, an extremely basic one, for the sake of learning to script. I know I have to put the script file in the scenario file, but then what do I do? And my scenario is called The 5 Swords, and the reason I'm not using the tutorial that comes with the blades of avernum editor is because it's too complex for me. I haven't even tried scripting before! Step-by-step, extremely simple help, please? Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Enraged Slith Posted March 30, 2009 Share Posted March 30, 2009 The first thing you need to know is that it looks a lot more intimidating than it really is. Once you get the basic concepts, most of it is actually fairly simple. To answer your first question, scenarios are comprised of a bunch of text files. I personally use Notepad (Windows) but it might be different for Mac users. Each of these text files (scripts) control a certain function in your scenario. You'll have a single script for each of your towns, outdoor sections, other-than-standard monster behaviors (advanced), and a datafile script (for custom objects), and a scenario script (controls everything else.) Each of these scripts is split up into a number of states which control a special encounter, specified in your editor file. For instance, in a town script, you might select that "state 10" displays a message whenever the party walks over the associated special encounter. To do this, open the town in the editor, lay a special encounter box over a couple spaces and set its value to 10. In the town script, under state 10, write something like this: Code: beginstate 10; message_dialog("Your text goes here.","More text can go here.");break; Each state is further organized into a series of calls. Every call you'll ever need is listed in the "BoA Appendix." A call essentially makes the script do something when you "call" it. Calls are run in order (i.e top to bottom) but can be manipulated with boolean statements. I know this probably sounds really complicated, but it's actually fairly simple. You just need to dive into it. Some people may link to some articles, but these might be difficult for you to understand. I would suggest a few different things: 1. Go through the tutorial, taking it step by step. It's confusing the first time through, I know, but it'll help a lot in the long run if you have some basis. Also make sure to read the "introduction to scripting" for the same reason. Don't worry if it doesn't make sense. 2. Open an existing scenario file and look at different parts to see how they work and how they're organized. The scenario "Settlers" was specifically made to help beginning designers, so I'd advise you to check that out. You can find it on the scenario database at www.nethergate.net 3. Make a scenario with "Warrior's Grove" in it and try manipulating different things in that town, like dialogue. Just focus on something and try to make it work. 4. Make your own scenario and fool around with scripts. Experiment with different things and try to see how they work together. Look at scripts from other scenarios to understand how different calls are utilized. For instance, I learned how to make cutscenes by reviewing another scenario. I know this is a lot of information at once, but it will start to click when you get into it. By no means do you have to follow this method, this is just what I did. Good luck and feel free to ask anything. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Dintiradan Posted March 30, 2009 Share Posted March 30, 2009 It may be that the tutorial is complicated because scripting itself is complicated. I'm sorry, but that's the way it is. There's no silver bullet, nor is there an Easy Button. Sooner or later, if you want to anything complicated, you'll have to read the docs. -- Still here? Very well. Many people learn better with examples, as opposed to getting the theory taught to them. There's a few different resources out there that may help you. If you read the header for this forum, you'll notice that Kelandon, a scenario designer, is hosting a Frequently Asked Questions page for designers. This FAQ is useful, and also links to a document entitled Basic Scripting For Complete Beginners. This article does exactly what it says on the tin. Another document that may be useful to you is a Cookbook by Erik Westra, which teaches you how to script the most common problems you'll encounter. Since Erik doesn't appear to be an active member anymore, Kelandon is hosting the Cookbook here. Thanks, Kel! By the way, have you checked the <title> tag on the cookbook page recently? ;-) EDIT: For reference, I wrote this before Enraged Slith made his excellent post. I'm a bit more RTFMy. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted April 4, 2009 Share Posted April 4, 2009 Originally Posted By: Dintiradan By the way, have you checked the <title> tag on the cookbook page recently? ;-) I wouldn't have had to check it *recently* to spot that error. I haven't changed that page since it was first put up. My website is due for an update (at least fixing the Links), so I'll deal with this now. EDIT: Okay, update done. Quote Link to comment Share on other sites More sharing options...
Curious Artila Alex5 Posted April 12, 2009 Author Share Posted April 12, 2009 Okay, sorry I haven't posted for so long. I think I found a bug, and it says the error number is 11. It ocurres when I try to save my scenario, and it will not save. Does anyone know what this is? Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted April 12, 2009 Share Posted April 12, 2009 Is the bas file write protected? Apart from that there should be no systematic problem. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Enraged Slith Posted April 12, 2009 Share Posted April 12, 2009 Are you using Windows Vista? Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted April 13, 2009 Share Posted April 13, 2009 What platform are you on, Windows or Mac? Exactly which editor are you using, official Spiderweb 2D or 3D? Also version number too. This is error 11 from the 3D Windows source file Bl A Fileio.cpp: if (NULL == (dummy_f = fopen(szFileName2, "wb"))) { oops_error(11); return; } Someone who knows more programming than I do may be able to figure it out. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted April 13, 2009 Share Posted April 13, 2009 Find the definition of oops_error and see if that helps. If not, the error is probably stored in a string table inside the executable itself. (Note: That's addressed more to Ishad than to Alex.) Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted April 13, 2009 Share Posted April 13, 2009 This seems to prove that Alex is using the Windows version, as the Mac version does not contain the code cited by Ishad Nha (marvelously, it will instead report an error 59 or 60 under the equivalent circumstances). Merely reading the code surrounding the call to oops_error() suggests that the failure occurs when the program attempts to open a temporary file for writing (the fopen(szFileName2, "wb") call). So, the problem is likely not that the existing scenario is write protected, but that the editor does not have privileges to create or write to files in that directory, I suspect. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted April 13, 2009 Share Posted April 13, 2009 So how in the heck do you fix that? Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted April 13, 2009 Share Posted April 13, 2009 It could be as simple as right-clicking the .bas file, and setting it so that it isn't write-protected. However... When I first started using Windows Vista, the "Program Files" folder (which is where BoA gets installed to by default) was set as write-protected to users. To fix it, you're going to have to right-click the BoA folder (you can't change the Program Files folder, to do this, but you can alter the BoA folder), and select "properties" from the drop-down list. You should then get a window with three tabs across the top. The third tab is titled "security", and you need to click that. Now, there should be a scroll down list of all the different user types on the computer. You want to make sure that Administrators, Users, and System all have permission to at least read, write, and modify files in that folder. You can do that by clicking on the user name (so, for example, "Administrators"), clicking the "edit" button, and checking the boxes. I'm not sure if you're going to need Administrator status to be able to do this, but I'm guessing you will. 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.