Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Adding values to JS datamaps in Harlowe

So I have a little Harlowe script that generates characters like so.
(set: $bob to (datamap:
    "Name", "Bob",
    "Description", "Some guy I met."
))

<!-- etc., and after a "pick character" thing, you get to something like: -->

(set: $char to $bob)

Now I have a whole bunch of characters to pick from, but I want to add one specific variable to them all regardless of what they are (specifically, whether they are awake or asleep). My attempt is as follows.
(set: $char's awake to false)

When I tried to run this through the debugger, it told me that there was a JavaScript error.
e is undefined

What is going wrong?

Comments

  • You want something like the following:
    (set: $char to it + (datamap: "Awake", false))
    
    Though that will not modify $bob, so if you need it updated as well, then you'll have to do it something like this:
    (set: $bob to it + (datamap: "Awake", false))
    (set: $char to it + (datamap: "Awake", false))
    
    Or this:
    (set: $bob to it + (datamap: "Awake", false))
    (set: $char to $bob)
    
  • edited September 2015
    Thanks. That's exactly what I was looking for.

    Um, consider this question answered, even though under the forum syntax, it's technically a discussion, not a question. :*|
Sign In or Register to comment.