Howdy, Stranger!

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

counter tecnique

I'm using Harlowe 2.00. I've tried to set a variable to 100 and then count backwards: (set: $SunCollission to it - 1) The problem is that this does not count backwards. What is a better counting method?

Thanks.

Comments

  • Just to be clear,
    (set: $SunCollision to 100)
    (set: $SunCollision to it - 1)
    
    Is not working for you?
  • Yes, that's it.
  • echolm wrote: »
    I've tried to set a variable to 100 and then count backwards: (set: $SunCollission to it - 1)
    Could you supply an example of the code that is not working so that we can debug it for you. Please use the code tag when posting your example - it's the C on the editor bar.
  • On the first Passage,
    (set: $shiplocation to "CarvorSun")(set: $EnginesOn to 0)(set: $SunCollission to 100)
    

    On subsequent passages, I use
    (display: "CarvorSunCountdown")
    

    On CarvorSunCountdown passage:
    (if: $shipslocation is "CarvorSun")[(set: $SunCollission to it - 1)](if: $SunCollission < 1)[ (go-to:ShipDiesinSun)](print:$SunCollission)
    ​
    
  • I remember I had to add the quoted for the display macro when I changed to 2.00
  • edited February 2017
    You have one variable that reads $shiplocation and another that reads $shipslocation. It's also part of the if statement that decrements $SunCollission, so it's never getting changed.

    I can't test it now, so that might not be the only problem, but I suspect that's all there is to it.
  • OH! Thanks.
  • That's it! Working!
  • edited February 2017
    Also as shown in the (go-to:) macro's documentation there should be quotes around the String containing the Passage Name being passed to the macro.
    (go-to: "ShipDiesinSun")
    
Sign In or Register to comment.