Arcen Games

Other => Website Support => Topic started by: Pumpkin on July 05, 2016, 02:03:20 pm

Title: AI War Wiki - unit stats template table
Post by: Pumpkin on July 05, 2016, 02:03:20 pm
I have a question about the AI War wiki's innards.

All units have their own page with a table containing all their stats. These tables are inserted by using a template of the form:
{{AIWarTableXXX}}
I believe these tables are automatically generated to be up to date, however there is several units without tables (or with tables I can't find). The Zenith Hydra sounds like a good example. Can I (a mundane wiki editor) create these? If yes, how? If no, who?

Thanks in advance.
Title: Re: AI War Wiki - unit stats template table
Post by: Dominus Arbitrationis on July 05, 2016, 08:02:06 pm
In order to make templates, all you should have to do is be signed in and search for the page named Template:AIWarTableXXX with everything after the Template part being the name of the template. Then create the page. As for doing the actual template creation, you'll want to probably copy and paste a template for your first try to learn how it all works -- it is very complicated.
Title: Re: AI War Wiki - unit stats template table
Post by: Draco18s on July 05, 2016, 09:16:10 pm
Templates can get super complicated because the syntax has two major "problems"

1) Whitespace is important (you can't do carriage returns and tabbed alignment for readability, because that actually alters the result)
2) Its syntax is subject to Wiki syntax. {x} means something already, so does {{x}} which is why if statements look like this:

Code: [Select]
{{#if:{{{Input-link|}}}|{{{Input-link}}}|{{{Input}}}}}
Yes, that's actually an if-then-else statement.
Specifically, if the variable "Input-link" is not blank, then write it, else use the variable "Input" as the link destination.
Title: Re: AI War Wiki - unit stats template table
Post by: Pumpkin on July 06, 2016, 07:07:13 am
Okay, so units' stat tables need to be manually updated when the game change. Ouch.

Well, thanks for the answer. I'll try that soon.
Title: Re: AI War Wiki - unit stats template table
Post by: Dominus Arbitrationis on July 06, 2016, 09:15:09 am
In theory,  someone could design a bot that updates ship stats for us.  Though that might be difficult to say the least. If anyone knows python,  they could probably do it though.
Title: Re: AI War Wiki - unit stats template table
Post by: Pumpkin on July 07, 2016, 08:08:18 am
I hope it will be more easily done with the next AIW's engine. If all ship's definitions are in xml files, a basic script would be able to automatically create the wiki's tables.