0 votes
by (190 points)


I'm a ameatur in twine and I am trying to make a stats system for a game. I thought the best way was to use a datamap, But I think it is long and probably not the simplist way to do it all. I need the stats in the header of my story and it won't be straight away, it'll be half way into the story. 

I know this is probably super simple, but how would I make a story which shows:

  1. The battery life of a watch
  2. The XP of 2 different NPC's
  3. Your knowledge / XP 
  4. How many times you've used a gadget 
that can easily be referenced with the (display:) or (print:) macro whenever needed?
Below is my code. I've looked at the rather vague referencing on the Harlowe site as well as look online and in my twine book.  I feel this is my only hope,  Please help!
(set: $timeWatch to it + (datamap: "Power", "100"))
(set: $partner to it + (datamap: "Experience", (random: 50, 65)))
(set: $newRecruit to it + (datamap: "Experience", (random: 10,16), "Engagement", (random: 20,32)))
(set: $player to it +(datamap: "Knowledge", "0"))
(set: $gadget to it +(datamap: "Usage", "0"))




1 Answer

0 votes
by (6.2k points)

i don't understand your problem. the code looks fine. if you want the variables' values displayed just do this:


no macros. the value will just show up.

furthermore, NPCs doesn't need an apostrophe

by (690 points)
I use my datamaps as (dm:), less typing means more work in the same amount of time
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.