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.

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).

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.

Tags:

Comments


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.