i need to give the player the ability to write on an object. they should be able to write whatever they want and it should be bound to the object so it can be examined, compared, read-back later (if they write something specific then something else happens).
i have mucked around with this for a while but it is beyond my dialog parser capabilities.
i’ve played with this predicate along with a custom grammar token.
(interface (asking for free_text in $<Action))
(asking for free_text in $Action)
(now) (implicit action is $Action)
(now) (implicit action wants free_text)
have also thrown in variants of:
(understand [write | $Words] as [write $Words on $Object])
*(split $Words by [on] into $Left and $Right)
*(understand $Left as free_text $Free)
*(understand $Right as non-all object $Object)
but no luck. the dialog parser eludes me in many ways (so, so many ways…) so i’m cutting my losses and asking for help.
(understand [write | $Words] as [write $Left on $Object])
*(split $Words by [on] into $Left and $Right)
*(understand $Right as non-all object $Object)
Now you’ll end up with an action like [write [a b c] on #cube]. Lists of dictionary words generally don’t end up in actions, currently, so you may need to tweak the (describe action $) predicate to make sure they’re handled properly, but it shouldn’t be hard to then do something like:
(perform [write $Words on #cube])
You write (print words $Words) on the featureless cube. It is now the "(print words $Words)" cube.
(now) (cube label $Words)
(dict #cube)
(cube label $Words)
(print words $Words)
Ahh, okay, I think I see what’s going on here. (try-complex $) has special handling if it finds a list inside an action, and that’s going haywire here. Hmm. I’ll have to experiment with that.