The finishing touches on the Barbaripedia are comming along nicely. After enabling quoted text, I now also managed to make simpel stat blocks for creatures.
When you enter this:
Code:
{{creature|name=Test Creature|xp=99.999|size=very big|type=thingy|senses=all of them|speed=yes|sa=yes|str=10|dex=15|con=4|int=11|cha=7|skills=Coding +2}}
You get what
can currently be seen on the Template Test page.
And it's really quite nice work. If you specify {{creature|subtype=subtype name}}, Instead of
Size type you see
Size Type (substype). And the line
Special Attacks only appeared because there is actually something in
{{creature|sa=something}}. In fact, there is also a line
Special Qualities that would appear if you add sq=something.
However the ability scores and particularly their modifiers turned out to be quite a lot of work.
Each line of code for each ability score looks like this:
Code:
<b>Str</b> {{{str|10}}} ({{#ifexpr: {{{str|10}}} > 9 |+}}{{#expr: ({{{str|10}}} -10.1) /2 round0}})
- When you don't enter anything for str=something, then it will be 10 by default.
- You can't tell that thing to round down. By substracting 10.1, a 0.5 that would be rounded up becomes a 0.49 that is rounded down.
- Usually it does not give a number as +X, so I had to add the plus sign with
{{#ifexpr: {{{str|10}}} > 9 |+}} If
str=something is bigger than 9, then a plus sign is added. If it is not bigger than 9, nothing happens.
- I had to repeat that
|10 part that means "if
str=something does not exist, use 10" because of the order in which the software checks things. I think it checks what value
str= is, but does not find anything because the value for
str= will be defined later, then substitutes 10, finishes that part of code, then defines str=, goes back to the formula to replace 10 with the actual number, then finishes what will actually be shown.
The only problem that remains that
+0 is still shown as
+-0, because -0.1 rounded to a full number is still negative.
