scripting workflow
|
Thistle Decatur
Registered User
Join date: 25 Aug 2006
Posts: 77
|
09-05-2006 00:10
What tools do you use to script, and how do you use them? I've been working on something all evening and the development environment is driving me crazy. Here's what I do:
Make a prim. Create a script or two. Test. Tweak the script. Test again. Tweak ... and so on
If I want to save the script, it seems like the easiest way is to save the whole prim by taking it or making a copy and taking that. Do this a few times and I get a ton of prims with the same name and no way to tell the difference between them without looking inside or poking them to see what they do. If I turn a script off and forget to turn it on again, the prim usually falls off the world, so I end up with a bunch more in lost and found with the same name.
Is there a nice way to tweak and test while backing up your work without creating a ton of copies and having to putting things into your inv just to save them?
I could use a separate editor, and probably will, just to make it easier to save, but having to cut and paste into the prim's script editor every few mins doesn't really appeal either.
|
Aakanaar LaSalle
Registered User
Join date: 1 Sep 2006
Posts: 132
|
09-05-2006 00:50
I use Crimson Editor.. simply cause I already have it and use it for my C, C++, PHP, Perl, HTML, and various other languages I play around with. Just my luck, someone created a syntax file for LSL for Crimson Editor.
But even without that, I would still perfer to use Notepad, cause it's easier.
When I decide I want to do something, I start by figguring out how I'm going to do it, look up the Wikki at what functions will allow me to do what I want, and scripting them in. If I find a function that I've not played with before and don't fully understand, I'll make a test script in game and play around with each of the values.. in an Attempt to figgure out what each does. Or at the very lease, re-create what I'm trying to do, so that I know what values to pass to the function in the final script.
Now, I should mention, I havn't done many scripts that make use of rotations, or object manipulations. Most scripts I've done... (ok, the only major script i've done..) are more logic, and require parsing and manipulation of strings or lists. This is an area in which I excel.
But when I do want to play around with vehicle code, or rotations, or animation.. then making test scripts to learn each part seperately is probably the best way to go.
|
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
|
09-05-2006 01:46
I use Ultra Edit ( not formatted for LSL tho ), even with the shortest of scripts as I find the script editor cant keep up with the typing half of the time. ( And I like to have a copy on Laptop so I can look at them when not connected )
And I normally sit down and scribble down my ideas ( yes on paper - even with little diagrams ) before I even look at a screen - then I get a rough idea of how I am going to split it up - what scripts/prims go where etc.
When I have the script I take it in world to iron out the typos and syntaxes ( then copy and save it back on my PC ).
I build the prims in no particular order ( before or after scripting ) and adjust them accordingly.
Bug fixes are normally handled in world ( small ones ) and copied back to PC.
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
09-05-2006 03:00
I tend to write mostly in world, sometimes that's into the editor window, editing a script in a prim, sometimes it's into a script I open from inventory. It *tends* to be tweaks from a prim, new scripts and bigger edits straight from inventory, but that's not hard and fast.
Unlike Adrianna I tend not to draw diagrams, but I do plot things through first, at least internally.
My starting and finishing point is "how does it interact?" That gives me a starting point for events, what bits of code go into which event etc. Then it's blocks of code into the events, test, tweak and so on...
The tweaking is always in world in a prim (or 10 or whatever, depending on what I'm doing) so I can see how it actually works and interacts.
|
Rhaegys Nyak
Blood of the Dragon
Join date: 7 Feb 2005
Posts: 43
|
09-05-2006 03:06
For small stuff I script in world, but when I'm on something bigger and I now what I want to do I do it off world. I use the Scite-ez editor that comes with the LSL script recognition and I configured the lslint program that checks the syntax before I upload the code into the world. The editor has another nice feature to copy the code to clipboard without having to select it all.
_____________________
Rhaegys Nyak Drakaris Enterprises
You can find my products also at SL Exchange
|
Velvet Tripp
Temptress
Join date: 4 May 2006
Posts: 51
|
09-05-2006 04:17
Small stuff: Work inside prims. No drawings, just plain LSL. Bigger Stuff: Draw algorithms and messages and how the objects communitcate - Think about the Idea behind it. Create a Project-Directory in your Inventory. Start working there until you got a corpus to play with. Copy the Scripts into the Prim. Test the prim, but tweak the Code in your Inventory. If you think you got a better verion to try out, delete everthing inside the prim and start over again by moving the new files into it. Repeat. If you got a working script-set, copy and start over with a new inventory-folder, keeping a backup of the old, working set. Takes time, but save and organized 
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
09-05-2006 05:08
I guess I'm really just more of a hands-on type of person.
I do almost all of my scripting in-world. I have had a certain project that really tested my ability at the time and caused me to take it to work and script in note-pad, but I still ended up doing most of it in-world.
Of course, I'm working with vehicles and extras to put into them, so I need to be able to quickly test a piece of code that I add so I can debug it and make sure it's working as intended prior to moving on to the next feature.
Really I think everyone is going to have a different style and method to the point that they just need to find what is the most comfortable for them. I don't mind just using the in-game tools since I'm using things that are modular to the point where several vehicles have the exact same features with maybe an added option here or there.
|
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
|
09-05-2006 07:53
From: Thistle Decatur If I want to save the script, it seems like the easiest way is to save the whole prim by taking it or making a copy and taking that. Do this a few times and I get a ton of prims with the same name and no way to tell the difference between them without looking inside or poking them to see what they do.
Use the General tab to add a version number to the name before you take it.
|
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
|
09-05-2006 07:54
From: Rhaegys Nyak For small stuff I script in world, but when I'm on something bigger and I now what I want to do I do it off world. I use the Scite-ez editor that comes with the LSL script recognition and I configured the lslint program that checks the syntax before I upload the code into the world. The editor has another nice feature to copy the code to clipboard without having to select it all. Could you ive references to the Scite-ez and lsLint, please.
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
09-05-2006 08:30
I wrote a plugin for Eclipse for LSL. It's not perfect, but it catches 95% of things and it's my preferred script editor. For those that use Eclipse you can find it here: http://www.simulacity.com:8080/secondlife/eclipseHope that's useful to others too. regs, /esc
_____________________
http://slurl.com/secondlife/Together
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
09-05-2006 10:35
UltraEdit with LSL syntax file (modified the one linked from Wiki a bit, as it's bit outdated and missing some constants etc)
once the bulk of code is made with it, then it's the usual '90% of time spent on fixing all the bugs you never expected to pop up' with the native editor >.<
|
Don Misfit
Registered User
Join date: 1 Jun 2006
Posts: 60
|
09-05-2006 10:55
Some may call me old-fashioned, but I write my LSL code by hand, on un-lined white paper; then scan it in, OCR it and copy/paste into the in-world script editor 
|
Elexia Yan
Registered User
Join date: 21 Aug 2006
Posts: 18
|
09-05-2006 11:06
get a tablet 
|
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
|
09-05-2006 11:18
From: Don Misfit Some may call me old-fashioned, but I write my LSL code by hand, on un-lined white paper; then scan it in, OCR it and copy/paste into the in-world script editor  Hope your handwriting is better than mine - last time I used OCR it took me longer to correct the mistakes than it would have to type it in manually in the first place.
|
Aakanaar LaSalle
Registered User
Join date: 1 Sep 2006
Posts: 132
|
09-05-2006 13:08
I have done diagrams for complex stuff in other languages.. such as a session handling segment in PHP, for which I drew a flow chart to figgure out what to do where.. Mostly though, I just figgure out.. well one project i'm trying to get myself started on.. I know that I need to get data from a notecard.. a random line which I'll have stored as: question*ans1*ans2*ans3*ans4 With a variable number of answers.. Knowing this, I don't need to worry about what event will triggure it yet, I just know I need a function that'll get a random number between 0 and Notecard_Lines - 1, fetch the line, parse it into a list, copy the first element into a variable and delete from the list.. If you can plan ahead and know what needs to be done, you can write functions to do a good chunk of it, then when you're ready to move onto events, all you have to do is call those functions. I recommend a Design Document, which starts off as an overall description of what the script is to do, then names of global variables you'll need, and funcitons you'll need with a description of what they do, what parameters they'll need, and what they will return (these are important to remember). This will make scripting complex scripts a lot easier. Edit: oh, and don't forget Forum Editor verson 3.4 (arbitrary number). That's where you post a random script to the forums and ask someone to re-write it to do what you want. 
|
Kage Seraph
I Dig Giant Mecha
Join date: 3 Nov 2004
Posts: 513
|
09-05-2006 19:09
From: Thistle Decatur If I want to save the script, it seems like the easiest way is to save the whole prim by taking it or making a copy and taking that. Do this a few times and I get a ton of prims with the same name and no way to tell the difference between them without looking inside or poking them to see what they do.
Another way to handle this problem is to put a simple little script in the object that stores a version number in the description of the object, then reads and updates it each time the object rezzes or you save the script, or whatever. I find this incredibly useful when needing to roll back changes.
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
SCite-ez and LSLint
09-06-2006 05:00
I'm With Rhaegys Nyak on this one, find it gets rid of most gross problems. Of course it doesn't stop me writing crap code though.... From: Lee Ponzu Could you ive references to the Scite-ez and lsLint, please. LinksSCite-Ez Thanks Jesse for the correctionLSLint
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
09-06-2006 13:36
Okay giving noob to scripting thoughts on workflow. Been years since any kind of code and it was just ladder logic so this is all new ball game.
Yellow pad and write ideas down. Notepad++ to start writing but now I might check out Scite. Then I go into world and fly up to 10,000 meters and put my busy sign up. Then I expand the script window to full screen and paste/check what I have.
Using a script editer like notepad++ and the full screen script windows help so much. Able to see parts in color and easier to track back and forth. I get lost in the code trying to read off the default size.
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
09-06-2006 14:30
WOOT! OMG Scite-EZ and lslint ROCK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Heehee watch out scripting world I am catching up to you! and that Scite link was wrong that is for the regular not the LSL version. Try here: http://sl.sdfjkl.org/secondlife/scite/
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
09-07-2006 04:57
From: Jesse Barnett WOOT! OMG Scite-EZ and lslint ROCK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Heehee watch out scripting world I am catching up to you! and that Scite link was wrong that is for the regular not the LSL version. Try here: http://sl.sdfjkl.org/secondlife/scite/My Apologies for the bad URL. I've corrected it. I notice a new NotePad++ thread on here , with a more upto date LSL file than Scite-Ez handles.
|
Thistle Decatur
Registered User
Join date: 25 Aug 2006
Posts: 77
|
09-07-2006 08:19
Thanks for all the feedback! I'm a pretty hands-on coder, as well. Like to tweak and test a lot. What makes this project difficult is that I'm making little creatures that swarm and have to eat or they die. So I was tweaking movement variables to try and get them to reach their food target before death. To make things hard for myself, I actually made them die while I was testing, rather than just putting them into a "dead state" where they stop moving. I wasn't breaking the code down enough for testing either. I've obviously become a bit slack in my coding habits. I think SL script will cure me of that. I'm also starting to think it'd be good to get a second monitor for the extra screen real estate and keeping the third party editor on there. It's really hard to keep the script windows open wide enough to see the patterns in the code as well as looking things up on the SLS wiki, watching the creatures do their thing, and making sure I don't accidentally close the prim edit window and let the current creature escape. From: Don Misfit Some may call me old-fashioned, but I write my LSL code by hand, on un-lined white paper; then scan it in, OCR it and copy/paste into the in-world script editor  Are you serious? That's pretty hard core.
|
Thistle Decatur
Registered User
Join date: 25 Aug 2006
Posts: 77
|
09-07-2006 08:22
From: Jesse Barnett Then I go into world and fly up to 10,000 meters and put my busy sign up. Then I expand the script window to full screen and paste/check what I have.
How do you stay at 10,000 meters? I always start sinking back down.
|
Thistle Decatur
Registered User
Join date: 25 Aug 2006
Posts: 77
|
09-07-2006 08:35
From: Kage Seraph Another way to handle this problem is to put a simple little script in the object that stores a version number in the description of the object, then reads and updates it each time the object rezzes or you save the script, or whatever. I find this incredibly useful when needing to roll back changes. Thank you! This is exactly the kind of thing I need.
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
09-07-2006 09:53
To get to and stay at 10,000 meters I had been using multi gadget but now the "Flight Assist" script just added to the scripting library works just as well. You go into hover mode when you stop flying and stay at elevation.
|