2018-03-19 Adding Faces

I’ve plugged my Face Generator into Hex Describe. Here is the output of a settlement governed by a bunch of humans, with faces.

Face Generator

Hex Describe

Showing faces

The setup depends on the implementation details, sadly.

The default table has the following entry:

;human
1,[man]<img src="[[redirect https://campaignwiki.org/face/redirect/alex/man]]" />
1,[woman]<img src="[[redirect https://campaignwiki.org/face/redirect/alex/woman]]" />

As HTML gets passed through, this already adds the images to the output. Getting them to float in an acceptable manner took a bit more work. There is a post-processing step which rearranges the HTML: It moves all the images in a paragraph to the very beginning and into a *span* element with a class I can refer to in the CSS. With that, I can then size the faces using CSS, and float the images to the left.

What do you think?

The construct `[[redirect URL]]` should work for any web service that redirects to its result. Instead of following the redirect and retrieving the image, the construct just inserts the new location into the output. This makes sure that you can save the description to a file, reload it in the future, and you’ll still get the same faces.

In practice I think this will be hard for services not hosted on the same domain since campaignwiki.org is secured by HTTPS and I think most browsers will then refuse to load resources such as images from services that aren’t hosted on the same domain (same-origin policy).

same-origin policy

I guess *Hex Describe* could proxy the resources. But perhaps that opens me up to abuse? I don’t know. We’ll see when somebody asks me to support something specific.

The human names are taken from my Halberds & Helmets Character Generator, by the way. Those were taken from the Zurich birth registers in 2012. Sadly, the original data is no longer available.

Halberds & Helmets Character Generator

​#RPG ​#Hex Describe