Jump to content

Code reuse within a Project - Sublime Text


Erwin Solo
 Share

You are about to reply to a thread that has been inactive for 1379 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Background

Greetings, I like to think of myself as an intermediate scripter, though clearly not as advanced as several who hang out here. My experience is STEM (science, technology, engineering, and math), though only a small fraction of my career involves working as a coder, and then only on analytical/mathematical routines that professional coders can wrap GUIs around.  

I'm starting a project on a series of Second Life vehicles that will look and behave much differently, but as most will appreciate, will be built of mostly the same stuff.

First of all, I want to control everything through a hud.  User will touch the Hud to rez the vehicle in front of them.  The Hud will transfer initial parameters to the vehicle (via llSay(), llRegionSay()), as appropriate, using a dynamic channel for most things and fixed channels where gesture keybindings are necessary. 

The Hud will have performance profiles that user selects (a mixture of llDialog() menus and llDetectedTouchST() touchpoints) that the Hud will then transfer to the vehicle.  

The Hud will have cosmetic profiles of textures that the user selects, and the Hud will then transfer the corresponding parameters (UUIDs, etc.) to the vehicle.

The user will drive the vehicle with either keyboard-only or keyboard and mouselook, depending on the vehicle.

Obviously, there will be a lot of code reuse between vehicles.  I tend to use a lot of LsL User-Defined Functions to keep things tidy.  Also, I tend to keep variable names the same in the Hud and the inworld-target-vehicle, for my own readability.

Question.

I'm using SubLime Text as an LsL editor.  What is the best way to organize my LsL User-Defined Functions and variable declaration lists?

I'd like to keep my LsL User-Defined Functions and certain variable declarations lists as separate files on my computer, and somehow #Include them into my scripts by reference.  That way, if I update an LsL User-Defined Function or variable declaration list, it will be updated next time I re-compile my target scripts.

I am doing this now by cut-and-paste, but it seems like there should be a more automated method within Sublime Text.  I just don't know the Sublime Text vocabulary well enough to find it in the help files

Edited by Erwin Solo
verb tense
  • Like 1
Link to comment
Share on other sites

Totally off topic, but ....

5 hours ago, Erwin Solo said:

My experience is STEM (science, technology, engineering, and math), though only a small fraction of my career involves working as a coder, and then only on analytical/mathematical routines that professional coders can wrap GUIs around.  

welcome to the (small) crowd.  That's my own background.  I started messing with programming as an undergrad when it was all done with punch cards and sense switches.  As a major in the sciences, programming seemed like a natural tool to have in my repertoire, but I never considered becoming a computer scientist.  Instead, I spent almost 40 years teaching myself how to tell computers to handle problems that I would otherwise have had to deal with analytically (and laboriously) by hand.  It was only as I retired and discovered SL that I finally succumbed to the temptation to learn how to to it right.  So, now I'm proud to call myself a scripter -- with all the experience of having used computers and STEM skills to study real world questions.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1379 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...