Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

Paradise

Paradise is an interactive fiction playground. · By Rekka & Devine

WildcardLISP field journal by Blue Teapot [Tutorial]

A topic by ddann created Feb 13, 2020 Views: 51 Replies: 1
Viewing posts 1 to 2

Feb 10

The typewriter doesn't work anymore. Created a quill to append any text to the parent vessel's note. The recipe goes like this:

create quill
enter quill
trigger scribe You scribed @(query)
program note @(vessel parent 'note') @(query)
leave
scribe Probe Probe.

Many wildcards can be placed in a single program. @(query) is the remainder of the trigger command, "Probe Probe." now.
@(vessel parent 'note') gives access to the parent data fields, 'name', 'attr', 'note', 'parent', 'owner', 'trigger', 'reaction', 'program', see the saved JSON for details. Both single and double quotes work.
A more complicated, but insightful way to do the same, using a single wildcard and a @concats function:

program note @(concats ...((vessel parent 'note') " " (query))) 

Three points indicate a list of an arbitrary length. There are three elements in this list, the parent note, a single space in quotes, and the query.

Feb 11

Here is a very round ball that rolls into a random neighbouring vessel upon touching:

create a round ball
enter round ball
trigger touch
program move the round ball into @(vessel (random(siblings 3)) 'name')
leave
touch

Now go find it (or "warp to round ball" and wonder).

It's a bit more complex.
@vessel is a function accepting vessel ID and data field (type "learn about @vessel"). In LISP it's written not like @vessel(ID, field), but like @(vessel ID field).
So (random(siblings 3)) is actually the ID. Not quite intuitively, (siblings 3) is parenthesized not because it's an arguments list, but because it's a single entity.
In turn, "3" is the argument to "siblings" function, which evaluates to a list of siblings' (i.e. neighbours') IDs. "random" takes the list as an argument and chooses one element.
Finally, the whole wildcard evaluates to a sibling's name, by reading from the 'name' field.

You may want to try it as a direct command

move the round ball into @(vessel (random(siblings 3)) 'name')

and fail. That is because direct commands mostly don't evaluate wildcards. Only note and echo actions, programs, and trigger reactions do.

Feb 12

How could I ever pass wildcards through casting? Tried, for example

create bubble spell
enter bubble spell
program create @(random("small" "average" "large" "huge")) bubble
leave
use bubble spell // it works, making a bubble of random size
take bubble spell
cast bubble spell on zapper // the zapper did create something, but definitely not a bubble
create @(random("small" "average" "large" "huge")) bubble // and now I've created some freakiness too, as actions don't evaluate

Late at night

Trigger commands, unlike actions, do evaluate! You cannot, for example,

create @(vessel self 'name')

without producing rubbish, but

create maker
enter maker
trigger make
program create @(query)
leave
make @(vessel self 'name')

The remainder of the make trigger is the @(query), which is evaluated. So,

create randombubble spell
enter randombubble spell
program make @(random("small" "average" "large" "huge")) bubble
leave
take randombubble spell

This requires the maker, and now I can cast randombubble spell to make any vessel create a random-sized bubble (and be its 'owner') instead of me. That's because the target passes the wildcard to maker program as a query rather than executes a direct action.

A side note: I can place a spell into a magic wand (with the cast action in its program) and cast using its trigger. This saves time and allows further automation. Strangely, the programmed vessel casts from its own inventory rather than mine (in fact from anywhere, so make sure you haven't lost or warped any spells across the world!).

TO BE CONTINUED...

Developer

Hey Ddann :)

We've been half-secretly rewriting the whole wildcard implementation, we have a working prototype here: https://hundredrabbits.github.io/Paradise/

You can find some docs on the new LISP here: https://github.com/hundredrabbits/paradise#scripting

And a list of all available functions here: https://github.com/hundredrabbits/Paradise/blob/master/web/scripts/lain.library....

This version will superseed the current itch build as soon as we've done some further testing :) Let us know what you think, I think you'll like it a whole lot more.