Return to “Scripting & Modding”

Post

LTSL Sample Scripts

#1
To help the budding modders, can Josh also include sample scripts for elements that are not implemented in the release of LT?

I know a lot of scripts will come out with the Beta testers.
Also, people have talked about a central resource for containing all LTSL scripts.

This thread is not about this.
In essence, this is a gentle reminder to Josh.

I know when developing batch scripts in DOS, I comment-out old script functions with the view of possibly using them in the future.
(Or they follow a specific mind-track to achieve a result, that may or may not be elegant/useful in the present.)

What are people's thoughts on this suggestion?
YAY PYTHON \o/

In Josh We Trust
-=326.3827=-
Post

Re: LTSL Sample Scripts

#2
It would be enough to comment the shipped ltsl scrips to say what they're doing, since if a feature exists it exists because it was needed, so an example of it in action will exist by default.
Or more plainly: it's unlikely that features will exists that aren't examples by their use.
If you need an example of how to make a simple UI you just look at the script related to the simplest part of the UI you've seen in game, etc.
woops, my bad, everything & anything actually means specific and conformed
Post

Re: LTSL Sample Scripts

#3
Katawa wrote: If you need an example of how to make a simple UI you just look at the script related to the simplest part of the UI you've seen in game, etc.
I concur.
However, what if we want to think outside the box?
I for one would prefer not to run into parsing errors in the LTSL script.

Josh himself in a recent daily dev blog says how he's totally revamped the look and feel of the UI.
Will we have access to the LTSL scripts to show both before and after?
Mr Parnell, Aug 31st Dev Blog wrote: In with the new: push the idea straight out of my brain onto the old LTSL scratch pad, watch it play out in game, iterate and re-iterate all within the same minute. Ideas I would have never even given a second thought before the days of LTSL are now explorable in just moments. Sure, some of them are useless. Little UI widgets that emit nodal particles that respond to mouse movement, dancing across the UI. But some of them are more than worthwhile. Scriptable market interfaces. Scriptable dev tools. Scriptable AI.
Last edited by FormalMoss on Tue Sep 09, 2014 11:50 am, edited 1 time in total.
YAY PYTHON \o/

In Josh We Trust
-=326.3827=-
Post

Re: LTSL Sample Scripts

#4
I think modders thinking out of the box should be on the modder :3 Any shipped script is in working condition, that's your parsing rules.
I'm not sure what the goal is here, if you're just after syntax rules then I agree it's reasonable to have a syntax doc with the game.
woops, my bad, everything & anything actually means specific and conformed
Post

Re: LTSL Sample Scripts

#5
Here is an example:

Code: Select all

@echo off
cls
:: A sample script

:: ver 1 - check if a PC is online - simple PING response
:: This is a basic response, that requires one to then act on the response, as opposed to using it in a script
ping -n 1 192.168.1.1 | find /i "reply"

:: Ver 2 - check if a PC is online - Verify you can access root c share
:: invariably used with a goto command when a positive result is achieved
if exist \\192.168.1.1\c$ echo PC is online

:: Ver 3 - Check if a PC is online - Use Errorlevel - this is actually quicker than Ver 1
:: Also useful in a script, but easier to implement and quicker for the computer to query
set ERRORLEVEL=0
ping -n 1 192.168.1.1 | find /i "reply"
if /i "%ERRORLEVEL%" equ "1" echo PC is offline

There are multiple ways of performing an action, but when LT is released we will only know of one way to do it.
Josh has the answers to this question, and it is entirely under his remit whether to include these samples or not.

I am only asking if he has the time, to include samples of other ways to perform either the same or similar actions, as noted in the example above.
Syntax rules are one thing, but knowing how to use the code is another.
YAY PYTHON \o/

In Josh We Trust
-=326.3827=-

Online Now

Users browsing this forum: No registered users and 5 guests

cron