Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26

Thread: LS script and LSC question (newbie)

  1. #16
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    The currenttime can be gotten from the Scene Object agent... most information can be gotten from one object agent or another. Check the Reference Manual for all object agents and what methods and members they provides you with. Once you've gotten through the User Manual and all the basic syntax stuff, you'll mainly be using the Reference Manual (and other sources completing it; if you can't remember it all).

    To get the current time then. "Request" a scene object agent.

    scene = Scene();

    Then just call any method or read a member. Use it directly or assign it to a variable.

    time = scene.currenttime;

    or short version

    time = Scene().currenttime;

    (Compare this to how you got the light information)

  2. #17
    Fórum áss clówn Hopper's Avatar
    Join Date
    Jan 2005
    Location
    Austin
    Posts
    3,393
    Quote Originally Posted by Matt View Post
    Not the official documentation, but MUCH better:
    http://www.mikegreen.name/Lscript/Lscript%20Index.html
    Oh dude... wtf ... where did this come from? Oh MAN that would have helped about a month ago. Someone needs to sticky the hell out of that and put it in the LScript forum. (uhh.. or is it already .. I was too lazy to look).

    But seriously... thanks Matt! That's an awesome resource.
    Playing guitar is an endless process of running out of fingers.

  3. #18
    Registered User
    Join Date
    Mar 2006
    Location
    Germany
    Posts
    21

    little step by step :)

    dear dan, hopper, matt :-) good morning! Coming back from work and have found a script with scene-obj-agent, thank you for this important advice.

    Now I can imagine what the script needs...

    Work in Progress, must laugh, I see a light at the horizont and make the script in the next days so it will run

    found this one and think it's ok for the script:

    scene = Scene();
    cur_time = scene.currenttime;
    cur_frame = cur_time * scene.fps;

    and the request:

    reqbegin("Frankys Light Editor");
    reqsize(375,115);

    c0 = ctlpercent("Light Intensity",1);
    ctlposition(c0,10,10);

    c1 = ctlrgb("Light Color", <0, 0, 0>);
    ctlposition(c1,10,35);

    after building that structures for my lighst I will ask here somebody again, if I have problems with the script language and the syntax...

    btw: the "Context" script editor is GREAT ! :-))) and I have downloaded the syntax highlightings from here :

    http://www.mikegreen.name/Files/CL.zip

    perhaps you can use it too if you don't know it !

    so long, nice day for you and day by day I see more knowledge about lscripts and I will manage it to build the script, I am sure...

    ciao, best regards, FrankyGTH
    ps: the lightwave script editor isn't so bad, but needs to get updated, why newtek didn't make it??? or perhaps some lightwave developer can do that???

  4. #19
    Valiant NewTeKnight Matt's Avatar
    Join Date
    Feb 2003
    Location
    San Antonio, Texas, USA
    Posts
    13,056
    My version of the Context Highlighters for .ls and .lws
    Attached Files Attached Files
    UI / UX Designer @ NewTek
    __________________________________________________
    www.pixsim.co.uk : LightWave Video Tutorials & Tools


  5. #20
    Registered User adamredwoods's Avatar
    Join Date
    Jul 2006
    Location
    San Francisco, CA
    Posts
    2,030
    I thought LSC was bytecode for the lscript, and therefore would run faster. maybe a test would help.
    Anyone have a stopwatch, preferably one with a second hand?
    // To draw is to think and discover.

  6. #21
    Registered User
    Join Date
    Mar 2006
    Location
    Germany
    Posts
    21
    hi again

    little question again how to handle or use the "ctl" commands...

    I have tried to changed / add some ctl... into (see the last line) ... for eg ctlpolygon, but with "context" script editor this one doesn't show a blue text type (so I can think it's not ok..) but it run's with the three lines before ... so I would like to know what commands are possible with "ctl"... ??? perhaps this question isn't quite new here...

    does any list existing how to use this commands??? Sorry, but I haven't found anything...
    I am learning the best way to study lw scripts with changing existing (running!!!) scripts and making experiments...

    ...code part--------
    c[1] = ctlsurface("Break Surface",set[gsurf]);
    c[2] = ctlinteger("Iterations",set[giter]);
    c[3] = ctlcheckbox("Distribute",set[gdist]);
    c[4] = ctlchoice("Break Type",set[gtype],@"Curved","Straight"@);
    c[5] = ctlpolygon("Polygonal",set[gpoly]);
    ...code part end --------

    best regards, I have to learn a lot with a programming language at the moment (school) and after it I can write some lw scripts, so god will must laugh...

    ciao and servus, FrankyGTH - good evening all
    Last edited by FrankyGTH; 04-07-2009 at 02:11 PM.

  7. #22
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    ctlpolygon()? Never heard of. All the available controls (and what their functions names are and what arguments they take) can be found in the LScript docs. You can download the docs from the developer section of Lightwaves homepage.

    You can't just paste "ctl" infront of any word you like!?

  8. #23
    Registered User
    Join Date
    Mar 2006
    Location
    Germany
    Posts
    21
    yes, thank you... dan !

    you are right: "All the available controls (and what their functions names are and what arguments they take) can be found in the LScript docs..."

    I have found it again, deleted the docs on my old machine and have had a newly look at the docs, but for me it's a general problem to found special help theme or command I know it from programming script editors they help for example with a "F1" button you click on the coloured command word and press "F1" to get a closer information about the "controls" of the application... would be a nice gift for lightwave programming guys/girls here, isn't it???

    "ctlpolygon()" doesn't exist, don't worry... it was just an example to test the context editor and clear my thoughts about the control commands...

    one pity more is that the most script example of ls script documentation doesn't run at all... for a lw script beginner not very useful ... that's my personal opinion...

    have a nice day, thank you, more will come, when I am ready with my first script

    ciao, FrankyGTH

    ps: show you one example of the lightwave script documentation...

    -----------------------------
    generic
    {
    reqbegin("Testing Idle");
    c1 = ctlnumber("Number",1.0);
    reqpost("idleTest"); // called at 500-millisecond
    // intervals.
    reqend();
    }
    color = <0,255 * .5,255 * .75>;
    idleTest
    {
    drawline(color,0,2,100,2);

    color.x += 5;
    color.y += 5;
    color.z += 5;
    if(color.x > 255) color.x = 0;
    if(color.y > 255) color.y = 0;
    if(color.z > 255) color.z = 0;
    }
    ----------------------------------
    it doesn't work... so I need to ask here ... sorry...
    Last edited by FrankyGTH; 04-08-2009 at 01:47 AM.

  9. #24
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    Works for me.

    I copied it from your post verbatim. Except that I added some headers. I guess maybe you should Use the LScript Editor for starters. It has templates for all the different script types and the Check Syntax command.

    (Thats a Layout script btw)
    Attached Files Attached Files

  10. #25
    Registered User
    Join Date
    Mar 2006
    Location
    Germany
    Posts
    21
    Hi dan

    thank you, your layout script example I have needed ! good to see it works!

    ...and my script works fine now... and I have built a new little one, you can see... changed things, I am proud of it, it's just a little thing but "mine"... So I have an entry to this world and have understood three, four things to build a panel script layout! more to come, I promise it... see my attachment ... the colour lines and the little box in my script is changing without any input - by the way: how can I set the "thickness" of a line???

    best regards, FrankyGTH
    "welcome to the pleasuredome"
    Attached Files Attached Files
    Last edited by FrankyGTH; 04-08-2009 at 01:15 PM.

  11. #26
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    I haven't ever drawn within panels. Unless you are building some very nifty interfaces there is seldom need to. I usually try to get away with as few controls as possible.

    If you don't know if there is a function or know for a fact there isn't then obviously you need to make do with what you got/know. Drawing thicker lines can be done by drawing the same line multiple times, each time with a slight offset or by dotting out tiny squares or circles at a regular offset along a distance. Create your own function for that if you need it.

    Keep at it.

Page 2 of 2 FirstFirst 12

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
  •