Hi,
I am currently busy creating a Character Sheet for a RPG.
The display part is in a $:/tags/Global tagged file, so I can reuse the code.
The Statistics data is currently in a Character Tiddler, in the fields, to test it. I may later switch to data tiddlers for that.
Now the problem is that I want a procedure or something to display the modifier, based on the field value.
For example:
0 or 1 should return a modifier of -3.
2 to 4 would be -2
5 to 9 would be -1, etc.
Now if I write another global procedure for this, using the compare operator, the currentTiddler is different for the first global procedure I think?
Also, it is a bit awkward to make a longish <% if %> chain.
So I was wondering is there an easier way to find the right value to display, given that all the data is known before hand?
The table below is the first global procedure.
The modifiers should appear in the third block.
<div style= "overflow-x: auto;">
<table>
<tr>
<th></th>
<th>Might</th>
<th>Talent</th>
<th>Speed</th>
<th>Health</th>
<th>Power</th>
<th>Spirit</th>
<th>Aura</th>
<th>Fp</th>
<th>Hp</th>
<th>Mp</th>
<th>Wp</th>
</tr>
<tr>
<td>Statistics</td>
<td>{{!!000Might}}</td>
<td>{{!!001Talent}}</td>
<td>{{!!002Speed}}</td>
<td>{{!!003Health}}</td>
<td>{{!!004Power}}</td>
<td>{{!!005Spirit}}</td>
<td>{{!!006Aura}}</td>
<td>{{!!007Fp}}</td>
<td>{{!!008Hp}}</td>
<td>{{!!009Mp}}</td>
<td>{{!!010Wp}}</td>
</tr>
<tr>
<td>Modifiers</td>
<td>{{!!000Might}}</td>
<td>{{!!001Talent}}</td>
<td>{{!!002Speed}}</td>
<td>{{!!003Health}}</td>
<td>{{!!004Power}}</td>
<td>{{!!005Spirit}}</td>
<td>{{!!006Aura}}</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
Thanks in advance for any help.