Retrieving Field name based on Maths

I have a Tiddler, that has fields with names (which can be tweaked) of level-0 through to level-5. In those fields I have numbers. (This gets rendered as a table in that tiddler.)

I have a different tiddler that is supposed to give an example of how to do something in the game, the example used to all be hard coded and we ended up with a load of mistakes before because no one updated the examples so I wanted to try and make it dynamic.

In the example, I need to combine two numbers, use that number to get the field from the table, then, do something else with that number after I get it.

I was able to do the combination of the two numbers in several different ways, but I failed turning that number into a fetch/get/transclusion of the next step.

https://starkingdoms.eaglesroost.org/#Operation%20Example%201

I’m not sure you need the maths. Maybe you do for other parts of your wiki. But this problem doesn’t need it.

You did have one place where you omitted the !! before a field name. Also, a place where you needed to set a variable to follow a reference (because the field value was coming through just as a text value, not evaluating through to the desired result).

One solution is to use a <$set> widget to set up the value that you’re trying to put into your “level modifier” field…

See if this helps:

1 Like

Thankyou, that DID help. though I ended up needing a LOT more set’s that I expected, I am sure it could be done in less, but thats a tomorrow problem. what I was missing was the ability to use the variable in the set as the field so I could get the field called “2” (or Desired Result) from the other tiddler (so I could then divide that by something and round it up.

1 Like