View Full Version : How can something like this, KILL, Layout???

09-23-2003, 11:04 AM
Okay, i'm at a loss here...

I've tried everything by now (including setting spaces everywhere, etc, ect...)

Apperantly something as simple as defining a vector is enough to kill my Layout...

i type this:

var p1 = (0,0,0);

i run it, Layout crashes...

I have no idea why (it does it with other plugins aswell (i tried Eki's RestOn to test this))

Any help would be welcome...

ps.. i run LW 7.5 (build 572 04-april-2002), i didn't update because i use Macs aswell and the 7.5c update was nothing but trouble...

09-23-2003, 04:24 PM
I think you need to define it like this

var p1 = <0,0,0>;
I.e. angular brackets, not rounded.

I must admit to occasionally getting a bit annoyed with the parser for LScript. It seems that it can't handle subtraction very well. I've got crashes for something as simple as:

and the only way to fix it is to do

As much as I generally enjoy programming LScript, I think it's got too much quirky and unnecessary syntax. I don't think it's parser is particularly well implemented either. I wish they'd have just done something similar to MaxScript which is extremely robust (as much as I hate 3DSMax!).

09-23-2003, 09:21 PM
Ya, I hate the subtraction issues! Just enclosing a variable in brackets works aswell, like so:

a= b-(c);

Imo it's better than b+(-c) atleast, but makes the issues look all the more silly :D

09-24-2003, 03:28 AM
thanx, i'll give it a go...

09-24-2003, 12:07 PM
As far as I'm aware you just need to ensure that you leave a space after the subtraction sign otherwise it takes the subtraction sign as belonging to the following item i.e. '-c'.

Therefore it sees 'a-c' the same as it would see '-ca' which is incalcuable. Whereas a - c means subtract c from a.

Does that make sense to anyone other than me? :)

09-24-2003, 12:11 PM
On my computer, the substract problem gets solved simply espacing both arguments such as:

b = a - c;

However I have also had a great amount of sintaxis problems while programming. For this and for speed purposes I'm trying to understant LIghtwave SDK now!

09-24-2003, 12:38 PM
Yep I understand. It's the old parser problem of differentiating between a subtract operator and a unary minus. But to be honest, you'd have thought they'd have got it sorted by now. If the parser and tokeniser are written properly then it should automatically differentiate between the two simply from the context that it is used. I'm ever so tempted to try and write an alternative to LScript myself, gotta feeling that it'd probably take a while tho!

I know I've whinged a fair bit about LScript over the past month or so, but I've got to say that all complaints aside, I love using it. It just makes knocking up tools incredibly easy. I've half started writing a C++ wrapper for the SDK - something that'll do something similar to Borland C++ Builder with events being generated for controls etc. and I'm hoping that'll make developing for the SDK equally easy.