Jump to content

Major help needed


Alex5

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...