PDA

View Full Version : beginning with lscript (motion)



dnch
04-29-2009, 07:24 AM
hi, i want to learn some lscript stuff, but i didnt find any tutorials, only some reference, but there is no easy way to start (at least for me:)

i have some experience in programming (php, actionscript , expressions (ae), and recently relativity in lw)

lets say i want to begin with something realy easy

i have object A with some movement animation
and i want to have object B folowing objects A y position..
with motion modifier lscript
..
i know thers many ways to do this but thats not the point,
i want to know some basic script to study how to write them:)

walfridson
04-29-2009, 07:46 AM
Go to http://www.newtek.com/lightwave/developers.php and download the lscript pdf's

Get the lscript help archive http://www.clandestine.com.au/LScriptHelp.htm

Join the lscript mailing list and download the whole history postings as a txt file http://lists.newtek.com/mailman/listinfo/lscript

study NewTek\LightWave 3D 9.6\Plugins\lscripts\animate

Mike Green's lscript docs http://www.mikegreen.name/Lscript/Lscript%20Index.html
You should study his excellent scripts http://www.mikegreen.name/

Have fun :)

dnch
04-29-2009, 07:53 AM
thank you wery much:)
i knew mike greens website, but not the others, thanks very much, i got some reading ahead of me:)

dnch
04-29-2009, 04:36 PM
first success:) i managed to write my own script and implemented effectedby()
also slightly edited some downloaded lscript
result here
http://newtek.com/forums/showpost.php?p=878401&postcount=19

dnch
05-04-2009, 07:05 AM
have another question.. i didnt want to start another thread..
how can i manage which script goes first?
lets say i have some lscript on one object to move and rotate it , and i want to parent some null to this object and apply another lscript which reacts to movement of parent object (after lscript)?

walfridson
05-04-2009, 08:11 AM
One thing that comes to mind is comring, send message to second script after the first one is done.
But maybe there's a lw-way :)

dnch
05-04-2009, 02:32 PM
i can do that?


One thing that comes to mind is comring, send message to second script after the first one is done.
But maybe there's a lw-way :)

anyway, another problem i have.. i am trying to do gravity / inertia thing..
i got one null folowing the ground or whatever and the other one i want to be always above it, but when the master null makes fast position change in "y" i want the other to jump.. or just have some maximum -y vector speed.. so when the master fast moves down, the follower is not stick to it but follows it with some delay.. if it makes sense:)

i tried to get previous follower position to check/set maximum -y speed
but when i tried ma.get(POSITION,time) .. it always crashes layout

then i tried it with store / recall
just simple recall works but when i try to calculate with it .. somethink like this:


oldpos=recall("op",0);
...
if(d<(oldpos-0.05)){
d=oldpos-0.05;
}
...
store("op",d);


it again crashes layout :(
so how can i do that inertia/gravity/collision simple thing?
in actionscript (flash) it was very easy and i can easily play with the gravity, bounce and so on without any "easing" scripts

thanks for your patience:)

faulknermano
05-21-2009, 10:02 PM
the problem is with the minus sign..



if(d<(oldpos-0.05))


it should read



if(d<(oldpos - 0.05))

evenflcw
05-22-2009, 12:28 AM
I absolutely hate that one!

zreedee
10-28-2009, 05:16 AM
the problem is with the minus sign..
it should read


if(d<(oldpos - 0.05))


WTF...????
I'll forget I read that or I will get very angry, and I'll never manage to learn LScript.

Well, I tried this link but seems to be broken:http://www.clandestine.com.au/LScriptHelp.htm

Moved elsewhere?

OnlineRender
12-23-2009, 09:57 AM
the problem is with the minus sign..



if(d<(oldpos-0.05))


it should read



if(d<(oldpos - 0.05))


That's a nightmare !

Dodgy
12-23-2009, 04:39 PM
http://www.mikegreen.name/Lscripts.html#Lscript

evenflcw
12-23-2009, 06:40 PM
An alternative way of dealing with the misinterpreted negative-should-be-positive number is to surround the number itself with parenthesis to steer the so called operator precedence right. Ie force the lscript interpreter to evaluate the (what-should-be-a-positive) number first, leaving the minus sign unused and left to do the arithmetic operation. I would think this is the more proper way to do it as it isn't dependent on whitespace. I used the whitespace hack myself up until recently, until I had a rare moment of thinking straight.

OnlineRender
04-04-2010, 06:29 AM
here's a question , will l-script become reduntant when core comes ! ie would it be more useful starting to learn Python

evenflcw
04-04-2010, 07:53 AM
Lscript will still work in LWHC. But not in Core. Whether or when that makes it redundant or not is relative to yourself and what you are going to be using. It's still good to know lscript today.