Jump to content

Recommended Posts

Posted

Yes, I know I've already posted a topic asking for BoA scripting help. But I didn't want to necromance it, and I have a more specific question this time. All the scenario scripts I've seen have the scripts in one continous line until notepad switches to a new one. Is this the only way to do scripts for BoA scenarios? Or is it possible to start a new line each semicolon?

Posted
Quote:
All the scenario scripts I've seen have the scripts in one continous line until notepad switches to a new one.

What you are seeing is not a real effect, just a line ending issue. Windows convention (and that of various other, now less important operating systems) has historically been to insist on using both a carriage return character and a linefeed character at the end of each line, while Unix systems, including modern versions of Mac OS use only a linefeed. So when you view scripts written by tools using the Unix convention, Notepad doesn't recognize the newlines they contain. If this bothers you you'll need to either use a conversion tool or an editor with more brains than Notepad.

Quote:
Is this the only way to do scripts for BoA scenarios? Or is it possible to start a new line each semicolon?

As noted above, this isn't even what it appears to be, and no, it is not a required style. Indeed it is a style which should be avoided at all cost. Avernumscript should, to a reasonable degree, be whitespace agnostic such that you can put in as many newlines, spaces, and tabs as you want, pretty much anywhere you would be likely to want them.
Posted

You can start a new line for each semicolon. In fact, you can put line breaks in the middle of statements too. For example, this is valid:

Code:
message_dialog(    "First string.",    "Second string.");

 

The reason you see everything on one line is the different ways Windows and Macintosh handle line breaks (I'm guessing you're reading scenario scripts written by Mac users). Windows represents line breaks with two invisible characters (carriage return and line feed -- or CR and LF), while Macs only use one (old ones just use CR, and newer ones just use LF). Notepad is too simple a program to handle Mac line endings correctly -- if you want to read scripts written by Mac users, use Wordpad instead.

 

EDIT: Niemand is too fast for me.

Posted

The original editor comes with PDFs that explain how to use AvernumScript -- you can download the original editor here. If you need more help, Kelandon has a tutorial that might help you get started. There's also Erik Westra's cookbook, which tells you how to do the most common tasks. Erik isn't around nowadays, but Kelandon is hosting his cookbook here.

Posted

As far as I know, there is no way. (It appears that this is something I'll need to look into.) As long as you, like most people, are not using wandering monster groups, this shouldn't be an issue. If you are using them, you can just place all of the spawn points over again to move them to where you want. If you really want that spawn point gone, it can be done, but will at present require some low-level magic, unless there's some simple thing I've overlooked.

Posted

Well, I'm not planning on using wandering monsters... But I am planning on using goblins. Spruced-up ones, too. Not that I know how to edit monsters... Or script... Or do much with the BoA scenario editor... I wish there was a step-by-step, ultra-basic website that could teach me how to make a scenario...

 

Edit: Or someone willing to teach me, step-by-step. Is there anyone that tutors BoA scenario making?

 

Edit 2: Okay, I give up. I'd love to make scenarios, but I don't know anything about scripting. I don't even know where to type the scripts.

Posted
Originally Posted By: Roentgenium
How about Notepad++?

EDIT: Nevermind, it works with wordpad.
A better choice would be Crimson Editor. I even made a set of custom syntax files for Avernumscript to use with it, which I'm willing to share.
Originally Posted By: Roentgenium
Well, I'm not planning on using wandering monsters... But I am planning on using goblins. Spruced-up ones, too. Not that I know how to edit monsters...
Once upon a time, I started writing a script generator (in VB6) to help make custom creatures. It's nearly complete, and is written to be almost totally foolproof. I could always bring it out of mothballs and put the last few finishing touches on it.

I also wrote and released a script generator for custom items, and is hosted at w-dueck's site here.
Originally Posted By: Roentgenium
Edit 2: Okay, I give up. I'd love to make scenarios, but I don't know anything about scripting. I don't even know where to type the scripts.
The editor PDFs and especially the BoA cookbook (both of which are mentioned above) are a great resource for those who are new to scripting. You should at least skim them over, and take a few notes before trying to write script.

Also, there's nothing wrong with good old-fashioned trial and error; that's how I learned most of what I know (which, I'll admit, isn't much; I'm still fairly new myself).

It's discouraging at first, but with some practice, I know you'll get the hang of scripting. Just give it time.
Posted
Originally Posted By: The Mystic
Originally Posted By: Roentgenium
Edit 2: Okay, I give up. I'd love to make scenarios, but I don't know anything about scripting. I don't even know where to type the scripts.
The editor PDFs and especially the BoA cookbook (both of which are mentioned above) are a great resource for those who are new to scripting. You should at least skim them over, and take a few notes before trying to write script.

Also, there's nothing wrong with good old-fashioned trial and error; that's how I learned most of what I know (which, I'll admit, isn't much; I'm still fairly new myself).

It's discouraging at first, but with some practice, I know you'll get the hang of scripting. Just give it time.


Kelandon wrote a pretty decent introduction to scripting called "Basic Scripting for Complete Beginners". I think it's hosted of CalRef, though, so it's down for now...
Posted

Each script needs to be its own file. The scenario script should have the same name as the scenario file, but end with '.txt', instead of '.bas'. The scenario data script is that name again, but ending in 'data.txt'. Scripts for towns and outdoor sections also end in '.txt' and traditionally begin with 't' and 'o' respectively, but can have any names you want.

 

It may be a good idea to look at how the scripts for an existing scenario to get a feel for this.

Posted

The town script and town dialogue scripts need to be separate, yes. (Some towns may not have a dialogue, though.) The files are just plain ASCII text, which can be created and edited with Notepad, but also any other text editor you may prefer, so long as it can save without any formatting. It really isn't very complicated, it just groups the code for separate purposes into separate files.

Posted
Originally Posted By: The Mystic
It's discouraging at first, but with some practice, I know you'll get the hang of scripting. Just give it time.
I've always thought scripting is way harder than basic programming (in C/C++). Would you guys agree? Maybe it's just because I have books and classes for programming, but little more than disturbingly long documentation for avernumscript. Remembering all those calls and their formats is so hard for me.
Posted

It really isn't as hard (to my mind) mostly for the reason that there isn't much you can do. Two basic kinds of flow control, integer arithmetic, and various built-in functions you can call. I never remember the arguments for most of said built-in functions; I just look them up in the documentation.

 

In C and C++ you have to (or get to) worry about: floating point math, arrays, pointers, functions, passing arguments by value, pointer, or reference, memory management, typedefs, structs, classes, unions, constructors, destructors, inheritance, overloaded operators, the preprocessor, and templates. These are all good and useful things, but not having any of them in Avernumscript certainly makes things simple (if restrictive). It really only gets hard when you try to do something it isn't meant to do, which can really be avoided most of the time in normal scenario designing.

Posted

You're right, it's just easier to me because I have concrete, progressive ways to learn C/C++, and I study them much more consistently, hence building on my knowledge more and more. I need to spend more time scripting.

Posted
Originally Posted By: Fractal
I've always thought scripting is way harder than basic programming (in C/C++).
I approach Avernumscript as a programming language in its own right; that seems to help, despite its restrictive nature.
Quote:
Remembering all those calls and their formats is so hard for me.
I don't even try to remember them all. There's just so many of them, for one thing; and I always keep some editor documentation handy at all times.
Quote:
I need to spend more time scripting.
That's usually the best way to do it. I find that you truly haven't learned anything in Avernumscript unless you've gotten errors in BoA, or in my case, caused BoA to crash.
Posted
Originally Posted By: The Mystic
I don't even try to remember them all. There's just so many of them, for one thing; and I always keep some editor documentation handy at all times.

I have a few of them memorized, things like dialog box calls and character location calls, but I do tend to have the appendix open at all times.
Originally Posted By: The Mystic
I find that you truly haven't learned anything in Avernumscript unless you've gotten errors in BoA, or in my case, caused BoA to crash.

Been there, done that, over and over and over and over...
Posted
Originally Posted By: B.J.Earles
Originally Posted By: The Mystic
I don't even try to remember them all. There's just so many of them, for one thing; and I always keep some editor documentation handy at all times.
I have a few of them memorized, things like dialog box calls and character location calls, but I do tend to have the appendix open at all times.
I memorized a handful of calls too. I also printed out the entire editor documentation and made it into a booklet; it makes a handy reference in addition to the PDFs.
Originally Posted By: B.J.Earles
Originally Posted By: The Mystic
I find that you truly haven't learned anything in Avernumscript unless you've gotten errors in BoA, or in my case, caused BoA to crash.
Been there, done that, over and over and over and over...
But have you ever taken out the operating system with it?

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...