Howdy, Stranger!

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

Deducting a value from a $ in Harlowe 1.2.3

Hi, I'm new at this and I'm struggling with getting some code to work.

I have created a $ with a value set to it, and want to deduct a number for it, but it should not store it as the $ is random.

Something like this (set: $time to (either: "2", "3", "4")) which will produce a random number, but later in my story I want to call that number but deduct another number but not save it so made (print: $time -1) which I hoped would result in the random number stored in $time minus 1, but I just get an error instead.

So how do I go about taking that stored value and deduct a number?

Thank you in advance :)

Comments

  • It's a type issue. You're assigning a string, which happens to contain numeric digits, to $time, not a number.

    To actually assign a number to $time, try the following instead:
    (set: $time to (either: 2, 3, 4))
    
  • That is brilliant, thanks :)
Sign In or Register to comment.