Howdy, Stranger!

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

Harlowe: Stats with two definitions

So let's say I want to track a character's various stats, and I want to represent one of them as a number that I can manipulate, and I also want to describe that one using a word, so that I can print something like:

Shirley's charisma is 2 (awkward).

And then later, when Shirley has completed four terms at charm school:

Shirley's charisma is 6 (likable).

What's the simplest/tidiest way to do this? I have been poking at datamaps and things and I cannot get my head around it.

Comments

  • edited July 2015
    This may not help, but I know sometimes most of us can overlook the simplest ways to do things. Also, I may have read your question wrong, but it seems to me that you'r trying to get single a variable to hold two pieces of different information. I'd suggest either just making two variables or using a conditional branch. Here's an example of a conditional branch using a datamap like the one you described:
    (set: $Shirley to 
    	(datamap:
        		"intelligence", 6,
        		"appearance", 4,
        		"charisma", 6
    	)
    )
    
    Shirley's charisma is (print: $Shirley's charisma) (if: $Shirley's charisma >= 5)[(likeable)](else:)[(awkward)].
    

    If you put that in a passage and test it, I think it will do what you're asking.
  • Yeeeeah, it does work, just I have rather more descriptors than just two, and that gets clunky fast. I was sort of hoping there was a way to make the one variable depend on the other so I didn't have to have long conditionals all over the place, but if there is I can't wrap my head around it.
  • guinevak wrote: »
    Yeeeeah, it does work, just I have rather more descriptors than just two, and that gets clunky fast. I was sort of hoping there was a way to make the one variable depend on the other so I didn't have to have long conditionals all over the place, but if there is I can't wrap my head around it.
    Okay, then, yeah, set two variables. I don't believe there is a simpler solution, but I very well could be wrong.
  • Rats. Okay, thanks!
  • What about nesting an (either:) inside of that if @Sharpe ?
  • Hmmm. Maybe I should try that.
  • edited July 2015
    AAAAAH. I think I did it -- the new Harlowe release and/or a night's sleep saved me.
    (set: $chaScale to 
    	(datamap: 
        	    1, "creepy", 
                2, "awkward", 
                3, "shy", 
                4, "presentable", 
                5, "pleasant", 
                6, "likable")
        )
    
    (set: $Shirley to 
    	(datamap:
        		"intelligence", 6,
        		"appearance", 4,
        		"charisma", 6
    	)
    )
    
    Shirley's charisma is (print: $Shirley's charisma) ((print: $chaScale's ($Shirley's charisma)))
    
  • Hey, that's a pretty good idea! :-)
Sign In or Register to comment.