How to deal with large numbers in Squiffy?

–2 votes
73 views
asked Apr 12 in Authoring by Natas (17 points)
retagged Apr 12 by Alex

The follow code did not work.

function addPoints(addNum,addOn) {
    if (addOn = selfHP)
        return selfLus + addNum
    else: 
        return null 

I am trying to use some outside of @dec selfHP five times. I tried to create a function however nothing at all happened. Do anyone know how to make something like this work?

commented Apr 12 by Alex (486 points)
This question is unclear. What are you trying to do?
commented Apr 12 by Natas (17 points)
Instead of having to do.

@inc someVar
@inc someVar
@inc someVar

To increase someVar by three, I am looking for a way that will take one line of code. Imagine if I was trying to do this in javascript.
var someVar =+3

1 Answer

+1 vote
answered Apr 12 by Alex (486 points)
selected Apr 12 by Natas
 
Best answer

Use this JavaScript to increase an attribute called "valiue" by 10:

set ("value", get("value") + 10);

Live example: http://docs.textadventures.co.uk/squiffy/scratchpad/?gistid=8d1bb347653333e5daa4&filename=number.squiffy

This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...