Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Internet Janitor

1,047
Posts
60
Topics
8,437
Followers
29
Following
A member registered Aug 02, 2018 · View creator page →

Creator of

Recent community posts

As a little refinement, instead of hardcoding the coordinates, consider making a button widget named (say) "target1", setting it to "show none", and then referencing the position of that widget when repositioning the canvas:

on click do
 mycanvas.pos:target1.pos
end

Using a "tangible" object to represent positions and sizes on a card will often make it easier to make changes.

Could you provide examples of the scripts you are trying to execute?

It is very difficult to guess what may be going wrong without seeing your code.

With those additional details I believe I've identified the problem; patched in the source repo and applied the fix to the web-decker examples on beyondloom.

Lil has three comparison operators: equal-to (=), greater-than (>), and less-than (<). The negation of these (the ! operator) is equivalent to not-equal-to, less-than-or-equal-to, and greater-than-or-equal-to, respectively:

 a = b  # a is equal to b
!a = b  # a is not equal to b
 a > b  # a is greater than b
!a > b  # a is less than or equal to b
 a < b  # a is less than b
!a < b  # a is greater than or equal to b

If you click on a button in interact mode, its script is evaluated and sent a "click[]" event, executing the code declared in "on click do ... end". Any code outside an "on ... end" event handler will execute any time ANY event is sent to that widget. Buttons normally only get click[] events, so technically you can give them a script like

go["Next"]

instead of

on click do
 go["Next"]
end

and it will behave the same in most cases, but the former version becomes a problem with other widget types, which are sent a wider variety of events in different situations.

If you mark any widget as "animated" it will be sent a "view[]" event 60 times per second. This offers one way of making widgets and contraptions that continuously update themselves or move around, if that's the sort of thing you're alluding to trying to accomplish.

Does that help at all?

You can make a contraption the size of a card, with a background image and/or common buttons and other UI/scripts, and then paste an instance of that contraption on every card where you want to share a "background".

Correct.

You can break the connection between a variable and the "strand" of an indexing expression by wrapping part of the prefix in parentheses, forcing it to be evaluated first, separately from the following parts of the strand. Consider these cases:

a:11,22,33
b:a
# these are 'simple' assignments;
# 'a' and 'b' both refer to (11,99,33)

a[1]:99
# evaluates to (11,99,33),
# 'a' now contains (11,99,33)
# 'b' still contains (11,22,33)

(b)[1]:88
# evaluates to (11,88,33),
# but the contents of 'b' is unchanged.
# equivalent to (11,22,33)[1]:88

And this wouldn't be syntactically valid at all, since it has neither a direct variable name at the "head" of the strand nor any indices at which to amend:

(b[1]):77

But we can do weird-looking things like this, amending the empty list at an index to create a singleton dictionary:

().foo:"bar"
# evaluates to {"foo":"bar"}
# equivalent to ()["foo"]:"bar"

It looks like your contraption has a button named "play". This will shadow (take precedence over) the definition of the built-in function "play[]". You also have a function play[] defined in the contraption-level script. If you clear up the first problem by e.g. renaming the play button to "_play" or "start_loop" or something else distinct then your listener logging prints, but as written it calls itself recursively instead of calling the built-in play[] function.

It is possible for a function which overrides a builtin to use "send" to invoke the "next-higher up definition", like so:

on play x do
 show["invoked wrapper!"]
 send play[x]
end

Sometimes this can be a handy way to bodge in extra behavior or logging without modifying existing scripts.

...but you can also sidestep this issue entirely by using distinct names for your widgets and functions.

Does that make sense?

(1 edit)

Interfaces are only "aware of" direct attribute reads and writes.

# read:
field1.data
# write
field1.data:expr

When you read field1.data, the result is an immutable value- in your example a list of lists. Deeper indexing can "amend" that value, but it's no longer connected to the interface. Conceptually these lines are all equivalent:

field1.data[0][1]:5
(field1.data)[0][1]:5
((list 1,2),(list 3,4))[0][1]:5

An indexed amendment produces a modified copy of the original immutable value. If the root of the expression is a variable, its contents is updated. In some cases this may look like a mutation, but anything that referred to the original value will still see the unmodified copy:

foo:11,22,33
bar:foo
bar[1]:99

foo # (11,22,33)
bar # (11,99,33)

Does that help clarify?

If what you want to store is specifically a 2d array of numbers, use a canvas; you can index into it with a pair of (x,y) coordinates:

# read a pixel:
myCanvas[0,1]

# write a pixel:
myCanvas[0,1]:12
(1 edit)

You're always welcome to make any changes you deem necessary to a local copy of Decker.

I'll give some thought to generalizing button.shortcut to support all DeckRoman lowercase letters in the future; it's trivial in Web-Decker, but much more complex to handle portably in Native-Decker.

(1 edit)

The zazz.scrol[] function is a thin wrapper around image.translate[], which updates every pixel of an image in-place.

Given a large source canvas/image that you want to scroll and a comparatively small window that you want to be visible at any given time, it is much less work to leave the source canvas static and copy out a window from a varying position than it is to scroll every pixel of the entire source canvas and then have Decker's compositor implicitly clip off the parts that are outside the card. See the example below.

You are very welcome to publish anything you've created with WigglyPaint and/or Decker as you see fit. Feel free to share a link to your creations!

Well done, Screwtapello!

The presentation is slick and the explanations are clear; you've done an excellent job motivating the intuition for how and why the DFT works.

FYI: caught a last-minute bug with the interaction between deck.esize and transition animation; if you've already downloaded 1.72 please update again. Sorry for the inconvenience!

Decker 1.72's new "esize" setting alters Decker's editor window size, which offers another way to avoid the problem of the main menu obscuring part of the card. If this works well in practice, I may change the default setting in a future release.

In Lil, the "+" operator is exclusively for addition. The "," operator joins strings into lists, and writing to the ".text" attribute of a field implicitly concatenates together the elements of a list. In a string literal, a backslash followed by the letter "n" is an escaped newline.

Putting this all together, you could write that fragment as:

on run do
 if (me.text = "hello") | (me.text = "Hello")
  log.text:log.text,"\nHello to you as well!"
 else
  log.text:log.text"\nI do not understand."
 end
 me.value:""
end

You could further simplify the conditional by factoring out the common parts of each subexpression:

on run do
 log.text:log.text,"\n",
 if (me.text = "hello") | (me.text = "Hello")
  "Hello to you as well!"
 else
  "I do not understand."
 end
 me.value:""
end

To make the initial comparison case-insensitive, you could use the "%l" formatting pattern to convert the input to lowercase:

on run do
 log.text:log.text,"\n",
 if "hello" = "%l" format me.text
  "Hello to you as well!"
 else
  "I do not understand."
 end
 me.value:""
end

Does that help?

This is a neat concept; very intuitive for creating color ramps.

The "Sheet" editor I described above is a bit too cramped for working with full DeckRoman fonts at 36x36, but that's just the font editor; there's no intrinsic problem with fonts of that size in Decker.

October 19th marks four years since Decker's public release. I've compiled another annual summary of developments in Decker, Lil, and the Decker user community:

http://beyondloom.com/blog/fouryearsdecker.html

I'd like to once again express my thanks to everyone who has contributed to the community here; you all are the reason Decker is worth building.

Lil's parser will currently tolerate source code ending without the full number of closing braces and/or parentheses; they're just implied.  This design is a potential foot-gun, but mildly handy when using the Listener like a calculator:


I was able to reproduce the crash you describe, but it's not specific to those script typos; it's a deeper race condition in Native Decker that just happens to become easier to reproduce when you have the toolbars open and custom brushes installed. Will fix.

Let's say we have a wide canvas with graphics in it, "source", a smaller display canvas of the same height, "target", and a field for keeping track of how far we've scrolled, "offset". In this example "target" is marked as "volatile"- since we'll be redrawing it on each frame- and "animated"- so that it gets a view[] event for redrawing itself each frame:


We can nearly achieve a horizontal scroll effect by filling in target's view[] event handler to increment the number in "offset", wrap it based on the size of "source" using the modulus operator "%" (note that this operator takes its arguments in the opposite order of modulus/remainder in many non-Lil programming languages!) and pastes a chunk copied from "source" onto "target" based on this horizontal offset:

on view do
 offset.data:offset.data+2
 x:source.size[0]%offset.data
 target.paste[source.copy[x,0 target.size]]
end

It looks like this:


When our offset reaches the edge of "source", we're missing a screenful of graphics on the right edge. Here's one way to patch it up:

on view do
 offset.data:offset.data+2
 x:source.size[0]%offset.data
 target.paste[source.copy[x,0 target.size]]
 w:source.size[0]-target.size[0]
 if x>w
  x2:target.size[0]-x-w
  target.paste[source.copy[0,0 target.size] x2,0]
 end
end


Here's the whole card as an example you can copy and paste:

%%CRD0{"c":{"name":"home","widgets":{"source":{"type":"canvas","size":[460,100],"pos":[26,46],"image":"%%IMG3AcwAZAKEj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r4YG+/w8YuDdIGOVXiJi4FZAhqPgIicOIETgZeYnZYjnxl+n5ybIp0QdaamoiCpF6ytpKabHqKjvbEOtgS5ubi7vAq/vL6psgDFz8SXyAbLz8qAzgzBxN6AwtbX1Hfa2Nmb3tTVXd0f2td0hnHgpLXp48RxquUQ2/LiY6v2h5r75PL0eqoO9Kqn8p5PXzdyvgFFsKVb062IZgQjQSexVsBFFNRVUNlRDbGGKeso4j0GWsAI9kEZC3UG0w2YuljX8qpckc9eXmxJIeBh7SKcPeSZziavIAypFn0U7JjIqzOLQlCKQeO1KlcPWCUw4MozIwmnVIWE5KRWx9+eCsq7NjfbBVWVOtVmFyTdVtmwMvLKtmd4z0+kyT3hgwL37gq2NcxsEv6z4l3FChY04GV1KswdhApciYDzPdKyml5ck9Mk+9t+qz1humhzmSOlMf6Xjt6h0VnTBr69MnNquesXv26tpghGOtHOG3a7e7jTQPDERoTiFh5fkW+/xHds3aY3Yx3ggZ+NjjURSe6ha2wPLhk5s5j0Q5Cfbe09J3uQToffJHALnYj4B4AKLnxE0D8qcdfOmwBs12MCiYRFcRORgehcMBN5iFKhzIG1RuyLcChMBBFhmHyZkYEkAo+gViSCJ2FsqLlKyoIhev4VFJTzJKcppvdwWhIWDH7dhUkCVwFltpNHrlY45NiERkiLM1aaSQdeDGnJVapojSkk1tCSZXWPXnZZh2ERVfj1WaqYgvZe5UIZtD4fJmUqDJyWR9UOiGp5VOgkNXn4JWIdOagx4qmIeILrrnjYw+Cmmkkk5KaaWWXopppppuymmnnn4Kaqiijkpqqaaeimqqqq7KaquuvgprrLLOSmuttt6Ka6667sprr77+Cmywwg5LLDAFAA==","scale":1},"target":{"type":"canvas","size":[100,100],"pos":[26,196],"locked":1,"animated":1,"volatile":1,"script":"on view do\n offset.data:offset.data+2\n \n x:source.size[0]%offset.data\n target.paste[source.copy[x,0 target.size]]\n \n w:source.size[0]-target.size[0]\n if x>w\n  x2:target.size[0]-x-w\n  target.paste[source.copy[0,0 target.size] x2,0]\n end\nend","scale":1},"offset":{"type":"field","size":[100,20],"pos":[265,196]}}},"d":{}}

Alternatively, you could make the graphics in "source" include an extra duplicate screenful at the end, and adjust where you wrap the "x" coordinate. Then there's no need for the "fixup" part of the script, but preparing the graphics in the "source" canvas might be more annoying and it'll take up a bit more space in the file.

To be able to scroll both left and right, you'd need to similarly handle a fixup on the left edge of the display, and so on.

Does that make sense?

(1 edit)

We were just having a discussion about improvements to general image compositing performance that may positively impact your use-case once v1.72 comes out.

You may also find performance is much better if you copy[] out a screen-sized chunk of a large canvas and paste[] it to a smaller canvas or card background image using coordinates that change over time instead of scrolling the large canvas (which necessarily updates every pixel) in-place. I'd be happy to work up an example if you need more detail.

The maximum size for widgets is currently 4096x4096 pixels, but I'd expect performance to be abysmal if a deck contained widgets that were close to that big on both axes!

(2 edits)

Woodring definitely deserves credit here. I took a somewhat different approach in my patches and added a few additional ideas of my own after some careful benchmarking, but Woodring's post made me realize I'd left significant low-hanging fruit in image.copy[] and image.paste[] (as well as a variety of places throughout Decker which rely on the same internal routines.) I think v1.72 will offer a significant boost to many existing projects.

Thanks to both of you for pushing the limits of the platform!

If Decker itself doesn't have APIs for doing something, and you're willing to constrain an application to only work in web-decker, calling internal functions via danger.js[] may be the only way to make it happen; I just reserve the right to change those internal functions in the future.

I'm a bit puzzled by the specific example you're raising, though. Clicking a button widget to fire a script takes place while in "interact" mode, whereas the internal "undo()" function in web-decker is part of the apparatus used in "widget" and drawing tool modes. Can you provide some broader context for what you're trying to do?

I'm very glad to have you in the Decker community, Missooni. :)

Excellent; Looking forward to seeing what you're cooking up!

The idea of explicitly storing the state of contraptions (and, more broadly, the state of applications built as decks) in widgets is an unusual feature of Decker that many beginners trip over, and I'm still trying to improve the way I explain it in the docs and tutorial materials.

I call it an "embodied data model": everything important about the state of a program in Decker has a "physical" storage location somewhere in the deck. Different widget types are designed to store different types of data: booleans in checkboxes, text in fields, etc. The ".data" attribute of fields is a sort of catchall for complex structured data, and contraptions make it possible to build custom "containers" for new kinds of data, like how all the contraptions in WigglyKit are designed to store animations. Every time Decker is finished processing an event- whether it's a change[] event triggered by a user typing in a field or a view[] event generated by Decker itself- the deck can be treated as a complete "save-state" for everything that's going on.

This model means that if you edit a script, modify the structure of a deck, or even edit a prototype definition, there's a very clear and straightforward way of understanding what information will be retained: widgets on a card retain their contents unless they're edited or removed, and the primitive widgets inside a contraption retain their "value" attributes (.value, .scroll, .row, .col, and the image on a canvas) if they've ever been modified since the contraption was created, and everything else is "inherited" from the prototype.

If there were true mutable global variables or hidden backing storage for contraption attributes, the lifespan of that information would be less clear over the course of editing, and might behave differently when loading a deck into a fresh session versus working with a deck that has been built up and edited live over the course of a session, which would be very error-prone. Everything about the design of Decker is sort of coiled around the concerns of maintaining a coherent view of the world while you build and reshape things.

Hopefully that makes some amount of sense. :)

(1 edit)

You're sort of on the right track here. I'll see if I can explain it better.

Inside a contraption, any settings we want to remember will need to be stored in widgets inside the contraption. These widgets will often be invisible; just for internal use by scripts.

An ordinary widget has "attributes", like the "text" attribute of a field which can be read from or written to by scripts; I'm sure you've done this many times:

myField.text:"welp"   # write to the text attribute of the field widget myField
myField.text          # read the text attribute of the field widget myField

In contraptions, we need to tell Decker what should happen when an attribute is read from or written to by defining appropriately-named event handlers.

If you wanted to be able to manipulate a contraption from an external script like this:

myThing.textColor:23 # write to the textColor attribute of the contraption myThing
myThing.textColor    # read from the textColor attribute of the contraption myThing

Inside the contraption you'd need to have a widget to keep track of that text color setting. Let's say the internal "storage" widget for the textColor attribute  is a slider widget named "gringus" set up to store an integer between 0 and 255. The contraption prototype's script would then need to include something like the following to wire up the attribute to the storage:

# handle reading from the .textColor attribute, retrieving the value from gringus:
on get_textColor do
 gringus.value
end
 
# handle writing to the .textColor attribute, storing the new value (x) in gringus:
on set_textColor x do
 gringus.value:x
end

The "get_textColor[]" event handler is called on a read, and the "set_textColor[]" event handler is called on a write. If only a "get_textColor[]" handler is written, the attribute is read-only. If only a "set_textColor[]" event handler is written, the attribute is write-only (which is a bit unusual). In your example it looks like you have the naming convention backwards; for example you have "bCol_set" instead of "set_bCol".

To actually do something with that "textColor" attribute aside from storing it, you'd also probably have a view[] event handler in that contraption prototype script along the lines of your example. You can freely choose between retrieving the text color setting directly from "gringus" or by calling "get_textColor[]":

on view do
 canvas1.clear[]
 canvas1.pattern:gringus.value    # this works
 canvas1.pattern:get_textColor[]  # equivalent to the above
 # etc...
end

In some cases you may want writing to a contraption attribute to have a "side-effect" in addition to storing the new setting. For example, after recording the new textColor we could call the view[] event handler to immediately update the appearance of the contraption to reflect the change:

on set_textColor x do
 gringus.value:x
 view[]
end

(There's a bit of subtlety here for complex contraptions, as the scripts triggered by a get_ or set_ have to finish quickly; I'd be happy to expand on this later if needed, and there's some general advice in the reference manual. For simple contraptions this approach is fine.)

The "Prototype Attributes" panel is how you tell Decker that certain attributes are meant to be manually-editable in the properties pane of each instance of the contraption, and how they should look. These will only work properly if there are underlying get_ and set_ event handlers in the prototype script corresponding to the "name" of each attribute in this list.

In the Decker Reference Manual, the example describes building a prototype which externally exposes an attribute named "value", accessed like "counter1.value", which is stored in an internal field named "val", and wired up with internal event handlers named "get_value" (which reads from the "val" field) and "set_value" (which writes to the "val" field). I can see how the similarity in these names might get a little confusing; I'll consider rewriting some sections of that tutorial.

Is this explanation any clearer?

Looks to me from those screenshots like you're using one of the many knockoffs of WigglyPaint instead of the actual program on this page. Please read the description!

You might also enjoy some of the decks Crowspace has released.

(Your prototypes and doodles are all very creative; it'll be interesting to see what other works they inspire! I especially like the drawings for "scan".)

(2 edits)

I'm very glad you had a positive experience trying Decker. I enjoyed reading about the making of your game. For whatever it's worth I thought the lighting effects at the end of the tunnel were quite effective!

If you're interested, there are a few ways you can simplify the script in this post for future projects. Widgets have a ".toggle[]" function that serves as a shortcut for toggling their visibility between solid/transparent and none. It takes the "shown" style as a first argument and a true/false condition as its second argument. Since .toggle[] shows things when the condition is true, it's the reverse of your conditional, so I have to add a ! (not) operator:

on view do
 distractions.widgets.button5.toggle["solid" !distract.widgets.points.value<4]
end

In this case I think you could also write the condition as:

on view do
 distractions.widgets.button5.toggle["solid" distract.widgets.points.value>3]
end

Another trick for making scripts more readable is to define local "shorthands" for widgets- a name followed by a colon followed by the path to a part of the deck lets you use that short name instead of the whole path; especially handy if you need to refer to the same widget several times in the same script:

on view do
 button: distractions.widgets.button5
 points: distract.widgets.points
 button.toggle["solid" !points.value<4]
end

If you haven't seen it before, Phinxel's Phield Notes has a lot of very useful simple scripting examples and other Decker tips.

Sorry for the long comment, and best of luck on your future projects!

(1 edit)

Do you have a widget on the active card named "place2" where you want your dialog box centered?

On the example on the documentation card for the ".pos" setting that is the name of a button widget set to "show none".

(2 edits)

Decker is open-source, so nothing is impossible if someone is sufficiently motivated to tinker with wild ideas in their own fork.

That said, I don't think porting Decker to the 3DS would be at all easy. Decker's user interface is designed with a minimum resolution of 512x342 pixels, while the 3DS screens are functionally 400x240 and 320x240 pixels. Decker is designed to be usable with a stylus and no extra buttons, but only the lower screen of a 3DS can respond to touch, and you'd probably need that entire touchscreen to serve as a keyboard whenever you want to edit a script, rename a widget, or generally interact with a field. The 3DS has very little RAM and a very slow CPU compared to most of the computers people typically use Decker on, so you'd need to do some careful optimization and possibly remove  or otherwise constrain some features entirely, like the unlimited undo history or the ability to have hundreds of cards in a deck.

Performance aside, I think you'd need to completely overhaul Decker's UI to suit such a device, and it would be difficult to run the decks and interactive docs people have already made for Decker's normal resolution (or bigger). It might be more technically feasible to make some kind of a stripped-down "Decker-player" for handheld consoles that exclusively runs premade decks designed with a lower screen resolution and lighter specs in general in mind, but it would be kind of a shame not to have the editing tools or the existing library of decks...

If you apply it to a single number, the "mag" primitive gives the absolute value:

mag -23    # 23
mag 5      # 5

In the more general case, "mag" gives the magnitude of a vector of numbers, also known as the Euclidean distance:

mag 3,4    # 5
mag 3,7    # 7.615773

If you want the absolute value of each element in a list, you can "push" mag down to each number with @:

mag @ -3,4,-5   # (3,4,5)

Base64 encoding as used in %%IMG datablocks in Decker uses digits, upper- and lower-case letters, and the symbols +, /, and =.

URL encoding leaves digits and letters unchanged, but reads + as a space and / is technically reserved. If I open web-decker with a URL like:

http://beyondloom.com/decker/tour.html?i=a1+/b2

app.params comes out as

{"i":"a1 /b2"}

If I instead encode that + and / with the appropriate percent-codes:

http://beyondloom.com/decker/tour.html?i=a1%2b%2fb2

I get the intended payload:

{"i":"a1+/b2"}

I think this explains the behavior you're seeing; your image-string is getting scrambled before you try to decode it.

Here's one way to encode those special characters- and other reserved chars, too- if you're using a Lil script to assemble the URL:

on url_escape x do
 a:"" split " !#$&'()*+,/:;=?@[]"
 b:3 window "%20%21%23%24%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D"
 rtext.string[rtext.replace[x a b]]
end

If you're exclusively pasting Decker image strings into URL parameters I guess it might also work to translate spaces back into + before decoding?

How's that?

Declaring deck-level "shortcuts" to widgets and helper functions are definitely useful techniques!

For a simple key-value store, one alternative to using a grid widget is using the ".data" attribute of a field widget, which can directly represent numbers, strings, lists, or dictionaries, among other things.

Here are some equivalents to your grid-based helper functions:

on get x k do x.data[k] end
on set x k v do x.data:x.data[k]:v end

Used like so:

set[field1 "alpha" 5]
set[field1 "beta" 2]
get[field1 "alpha"]  # 5

For the specialized case of games that just need to keep track of a bunch of global boolean "game flags", you could make something like this:

flags:somecard.widgets.some_storage_field
on get   k do 0+flags.data[k] end
on set   k do flags.data:flags.data[k]:1 end
on clear k do flags.data:k drop flags.data end

Since these functions only take a single string argument, we can use an extra-concise syntax for calling them:

set["beta"]  # this works
set.alpha    # this also works!
get.alpha    # 1
clear.alpha
get.alpha    # 0

Thanks for helping share what you've learned, Missooni!

(5 edits)

Decker users are constantly cooking up useful goodies to share with their fellow creators. In this thread I'll attempt to maintain an index so we can all find what we need.

For everything that isn't a contraption in the Bazaar, feel free to post links to new resources here and I'll add them to the index. If you have your own webpage with information about Decker, we'd love to see it!

Fonts for Decker:

Lil Modules:

Tools for Decker:

Deck Templates:

Guides and Tutorials:

Don't forget all the resources, tools, and tutorials included in the "examples" folder when you downloaded Decker. You can also find them all on the main Decker page on my website!

Take a look at All About Color. There are also some great user-made palette editing tools on the community forum!

For the benefit of other readers, the relevant script in the linked deck is

b:bar.value
if     b=1|b=7          exit.text:1 #( ,1, , , , , ,7)
elseif b=0|b=3|b=4|b=6  exit.text:2 #(0, , ,3,4, ,6, )
elseif b=2|b=5          exit.text:3 #( , ,2, , ,5, , )
else        exit.text:"none" end    #Fail

All operators in Lil have uniform right-to-left precedence unless overridden by parentheses.

An expression like

b=0|b=3|b=4|b=6

Is understood by Lil as equivalent to

b=(0|(b=(3|(b=(4|(b=6))))))

In this case, you'd probably get something closer to your intent by writing

(b=0)|(b=3)|(b=4)|(b=6)

Note that you could also write these kinds of test with the "in" operator:

b:bar.value
if     b in 1,7      exit.text:1
elseif b in 0,3,4,6  exit.text:2
elseif b in 2,5      exit.text:3
else                 exit.text:"none"
end

The "if ... elseif ... else ... end" structure evaluates to the last expression of each clause, so you could also lift out that assignment like so:

b:bar.value
exit.text:
if     b in 1,7      1
elseif b in 0,3,4,6  2
elseif b in 2,5      3
else                 "none"
end

Another alternative would be to use a "lookup table" instead of conditionals:

exit.text: (2,1,3,2,2,3,2,1)[bar.value]

To handle a default case for an invalid key- which will index out "nil"- we can use the "unless" operator:

exit.text: "none" unless (2,1,3,2,2,3,2,1)[bar.value]

If the keys for the lookup table aren't sequential integers, you could use the same approach with a dictionary instead of a list.

Does any of that help?

Anyone can lock a deck to hide the menu bar and suppress Decker's editing tools. I've deliberately left them enabled in WigglyPaint to make it easier to customize.

Everything in the top menu is part of Decker, the tool WigglyPaint is built in.