
Your test code stays out of the live game
You can now mark any piece of ShotScript code as studio code, and it runs in Studio's playtests while the live game never runs it. Your debug prints and test values sit right beside the real code, and nothing needs pulling out before players arrive.
That was Tuesday's biggest change. Further down you'll find a Styles panel for your code's colours, types that travel with their system, tabs that come back after a sudden restart, and lakes in Stroke Engine that mirror the sky the way real ones do. Well over a hundred smaller changes to ShotScript and Stroke Engine went live too, and New in ShotScript and New in Stroke Engine list every one.
Test code that stays in Studio
Every game carries a little code that only makes sense while you test it. A print that lists what's on the shop's shelves. A Speed of 10, so you can cross the map before your tea goes cold. On Monday, dev and ship took care of that, and on Tuesday four words took over from them. Code can run in the live game, in Studio's playtests and on the Command Line, and studio, nostudio, tool and notool keep a piece of code to some of those places.
Put studio do ... end around that print and it runs only where studio code runs. An else half runs everywhere else, and the words stack, so studio notool do runs only in Studio's playtests. A value can even take one half for each place, right on its own line.
studio Speed : number = 10 nostudio 5Speed is 10 where studio code runs and 5 live. You cross the map twice as fast, and your players don't.
Whole members can stay behind too. Here a Shop gets a Trace method that exists only where studio code runs, and the Classes page has its nostudio extends twin.
studio extends Shop {
public Trace()
print(self.Items)
end
}A whole script works the same way. Select it, and ShotScript Editor's Properties shows its StudioMode and ToolMode under Behavior. A single item can carry the word as well. studio module Cheats stays studio code even in a script that runs everywhere, and if code that also runs live uses Cheats, the error names the word and its line, and a fix drops it.
To see the game the way your players will, click Live on the Shot tab of Studio's ribbon. Studio plays it as it runs live, with studio code off. Click Live again to play with studio code back on.
The Command Line gets the same care. tool SetTile(tile : Vector2) gives a class a SetTile that exists only where tool code runs, and it's public with no public written. When tool code uses a system the Command Line never loads, the error says so and offers a fix such as Make Storage Mixed, which sets Storage's ToolMode to Mixed in one undo.
Monday's dev and ship still work, as studio and nostudio, with a warning whose fix writes the new word. Server and client has every pair of modes and where each one runs.
Your code, in your colours
You read your code all day, so it should look the way you like it. The new Styles panel, opened from ShotScript Settings, holds the colours your ShotScript tabs draw in.
It opens on the editor's own look, with a row of 18 named colours and all 23 groups a chip can move to. Add a group with + New group, pick a swatch, or give a style a weight. The weight picker lists all 17 Shot Mono weights, one every 50, so a style set to 550 draws between 500 and 600.
Drag a chip over a group that won't take it and the reason shows right by the pointer, which beats guessing. In a floating Styles panel, Ctrl+Z and Ctrl+Y undo and redo chip moves and colour picks.
Letters in ShotScript tabs now draw with grey smoothing, so no red or blue edges show around them at 11 or 13 px. If you prefer ClearType, Grey text in the More menu switches between the two, with nothing to reopen.
The code samples on this site now paint in the editor's current colours too, the four new words included. The Docks page has the whole panel.
Types that travel with their system
Say your shapes live in a system called ShapeHub. A script that uses ShapeHub now reads every type ShapeHub's export gives, so it can name one as ShapeHub.Shape or just Shape, and a wrong value is an error right there. Change one of those types and every script that uses ShapeHub checks again.
A system's export line can name any type its script sees, so one use line brings the types along with the system.
Folders full of the same thing are easier to describe now. A shop shelf is a folder of items, and one type in its braces now covers every child.
layout ItemLayout = MeshPart {
@Tile : Vector2
}
layout ShelfLayout = Folder {
Items : Folder { ItemLayout }
}Every child of Items is checked against ItemLayout, and Items:GetChildren() reads as an array of ItemLayout, so a loop over the shelf knows each item's Tile. Layouts and sets has more.
Tabs that come back after a sudden restart
Studio doesn't always get to close politely. When it ends suddenly, a PC restart for instance, your ShotScript tabs now come back at the zoom you left them on.
When the editor's Studio plugin updates itself, your open script and Docs tabs stay, in the same order, with the same tab in front. A script you only previewed comes back as the italic preview tab after the editor restarts, and a floating Docs window returns with its Find words still lit, without taking the keys from your script.
While you're arranging things, drop one ShotScript dock on the middle of another. They join as one tab group, the way Studio's panels do, and they stay joined after a restart.
Lakes that mirror the sky
In Stroke Engine, a new Sky Polarization setting darkens the red in clear sky reflected on water, the way polarised skylight looks on a real lake.
Twenty more objects, before and after
The Objects page grew a lot too. Twenty more objects, from Part and MeshPart to Explosion and Cloud, now each have a lit before and after pair, there and on a page of their own. Here is Atmosphere over a row of granite pillars, with Density 0.55 and Offset 0.5.
Clear airAtmosphere
