Hi there,
While there isn’t one tutorial to help you make a D&D-like game with Twine, there are a bunch of resources here that you might find helpful to start with Twine (and one of its formats) or to customise your project.
Note: some of the text formatting will resemble Markdown, but each format has its own coding structure, with different formatting.
My advice is to look through the documentations/guides and see what formatting works best for you, maybe test it with a short story (4-5 passages, some variable creation/change, a few conditional statements) - since technically, all formats can make D&D-style stories (essentially: choice list, roll dice, some stat tracking).
Variable tracking.
It can be simple as having a bunch of clearly named singular variables ($thisIsAVariable
) or have more complex (but maybe more organised) variables like array and objects ($npc.health
or $options = ["this one", "that one"]
).
So keeping a list of variables created, what it tracks, whether it changes, when it is unset, and so on…