Results 1 to 15 of 15

Thread: beginning with lscript (motion)

  1. #1

    beginning with lscript (motion)

    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

  2. #2
    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
    http://walen.se my plugins

  3. #3
    thank you wery much
    i knew mike greens website, but not the others, thanks very much, i got some reading ahead of me

  4. #4
    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.ph...1&postcount=19

  5. #5
    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)?

  6. #6
    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
    http://walen.se my plugins

  7. #7
    i can do that?

    Quote Originally Posted by walfridson View Post
    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:
    Code:
    	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

  8. #8
    the problem is with the minus sign..

    Code:
    if(d<(oldpos-0.05))
    it should read

    Code:
    if(d<(oldpos - 0.05))
    "The hardness of God is kinder than the softness of men, and His compulsion is our liberation." - C.S. Lewis


  9. #9
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    I absolutely hate that one!

  10. #10
    Registered User
    Join Date
    Jul 2009
    Location
    nospamthanks
    Posts
    6
    Quote Originally Posted by faulknermano View Post
    the problem is with the minus sign..
    it should read
    Code:
    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?
    Last edited by zreedee; 10-28-2009 at 05:19 AM.

  11. #11
    Banned OnlineRender's Avatar
    Join Date
    Dec 2008
    Location
    Glasgow , Scotland , UK
    Posts
    6,370
    Quote Originally Posted by faulknermano View Post
    the problem is with the minus sign..

    Code:
    if(d<(oldpos-0.05))
    it should read

    Code:
    if(d<(oldpos - 0.05))
    That's a nightmare !

  12. #12
    Worms no more! Free fun! Dodgy's Avatar
    Join Date
    Feb 2003
    Location
    Sydney
    Posts
    8,279
    Push the software, don't let it push YOU!
    My own plugins and work:www.mikegreen.name
    LaptopSetup:corei7 2.4GHz nvidia GT 650M 8Gig win8 64
    WorkSetup:core i7 3.4Ghz nvidia Quadro 2000 12Gig Ram Win7

  13. #13
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    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.
    Last edited by evenflcw; 12-23-2009 at 06:44 PM.

  14. #14
    Banned OnlineRender's Avatar
    Join Date
    Dec 2008
    Location
    Glasgow , Scotland , UK
    Posts
    6,370
    here's a question , will l-script become reduntant when core comes ! ie would it be more useful starting to learn Python

  15. #15
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •