If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

In your Lightwave folder, there is the SDK Folder. There should be an lscript archive, that should contain the original documentation. The first exercise is replacing the weld tool, which use to have an annoying popup at the end you had to click through.

lScript is very C like. Every line ends in a ";". Scripts differ between modeler and layout. However, you'll probably only deal with modeler scripts (main {...} ) and layout generic (generic {...} ).

Above all, ASK Questions. And look through the scripting forum. And keep in mind that the documentation for lscript is in a poor state, having been ill maintained for many years. You may have to work out your own solutions.

Where to start :
1) Have an idea. To start with, a simple task that is clearly defined.
2) What steps do you need to do to accomplish 1)? Write them down, in sequence.
3) Begin looking at commands that will accomplish each step in 2).
4) Begin debugging. The most common mistake in lscript is a missing ; at the end of the line. The debug(); statement is your friend. Repeat 4) until there are no more errors, and script functions as intended.

The first program most people write in school is "Hello World!".

1) Print "Hello, World!" On the screen.
2) this task is so simple, it does not need steps.
3) Looking through Mr. Green's lscript reference, we find the info command under messages.

So, our code for modeler would look something like this:

Code:

main{
info("Hello, World!");
}

For layout, the code is slightly different:

Code:

generic{
info("Hello, World!");
}

And there you go, your first script.

I would also reccomend that you learn Python. If you can't get it done in lscript, you can probably get it done in Python, which wraps the LW SDK.