Twine 2
I’m going to use very basic language because I am very new to this, so please respond in kind, I won’t be offended. explain like I’m 5 if you have to.
I’m trying to set up a system for “equipping” different classes of weapons, and weapons having their own damage multipliers that interact with a pc’s “stats”. I’m also wanting to implement an element of randomness to it, affecting the damage output by -20% to +20%.
I set up a datamap within a datamap for a “simple sword” and its stats.
(set: $equip to (dm:"A",(dm:"strm",0.40,"agm",0.60,"1sword",(dm:"wdmg",0.5,"name","simple sword","inv",true))))
So in variable group A, there is the variable group 1sword, and that has the variables wdmg (weapon damage), name, and inv (inventory).
And for the damage output, I got this working, using a surrogate variable “numvar”.
(set:$dmg to ((((random:-2,2)*0.1))*$numvar)+$numvar)
My issue is I can’t figure out how to reference the actual variable “wdmg”, because it’s in two nested datamaps. I know how to reference a variable in ONE datamap, but I don’t know how to do it when it’s A’s 1sword’s variable, not just A’s variable. I can’t find any information and whatever I try returns an error because it’s not reading the variable.