Viewing Zero

I've got the generator set up to label hexes with a prompted number, which defaults to 0101 (I bet you can see where this is going). Each rep adds 1 to the hex number (prompt + rep-1). I just realized if 0 doesn't display if it is the first digit, so the default displays as "101" instead of "0101".

This is what I've currently got.
Prompt: Hex #{} 0101

Table:Hex Encounters
Hex {$Prompt1+{rep}-1} has \n

<

ul>[!{1d2+1} HexFeatures]

Comments

  • Maybe:

    [when]{$rep}<1000[do]0[end]{$rep}
    

    I didn't test it though.

  • edited April 22

    Something like this might work:

    ;generate numbers with 1 to 3 digits
    table: main
    [@pad with {2d100}] 
    
    ; front pads a number to 3 digits
    table: pad
    [{'_0000' + $1} >> right 3] 
    ; the underscore above forces the expression to be treated like a string
    

    The idea is to stick several zeroes at the beginning of a string, and then use the right filter to take the right X most characters. You could adjust this as needed for your coordinates.

  • Thank you both

Leave a Comment