Civilization Wiki
Advertisement

OK guys, try as I might I couldn't discover how to edit the Tech Web templates for the individual technologies..... Could please someone help me? Soltan Gris 13:42, November 16, 2014 (UTC)

Hey, sorry, it is true that it isn't easy to find the way to edit the templates or their data. I've commented on this issue before on another talk page. —ZeroOne (talk) 21:41, November 16, 2014 (UTC)
Right... So you guys are working with central Lua templates. But how do you customize the template with the info about each different item, for example the table for a technology? Sorry, I'm not very clear with how exactly you're using Lua, I have some programming experience, but it's with Python, and probably not aplicable at all... Soltan Gris 01:05, November 21, 2014 (UTC)
The layout for the technology infoboxes is embedded into the Module:Data/CivBE module. In my opinion that's a suboptimal solution, I'd rather see it so that the layout lived in, say, Template:Tech (CivBE) and it called individual functions from that module to populate the infobox. In fact, I already started converting the tech infobox part of the module so that it would have smaller functions that could be called independently, instead of the big one that creates the entire infobox.
The data is a more complicated matter. With CivRev2 and some other games we've created some Lua modules manually, so they can have any data structure we like. With Beyond Earth the game's own XML files have been converted into Lua modules and uploaded into the wiki, you may have seen Becer's blog post about it a while back. So while this gives us very accurate data, we're also at the mercy of the game developers and how they designed the data structures, which is not always very easy to follow. For example, there's no info like "This technology unlocks these buildings", but rather you must look up the tech from an array, take its "key", take the array of buildings and then find all the buildings whose "PrereqTech" matches the tech's key.
And don't worry about not having any previous experience with Lua. Any programming experience applies, and Python is actually quite close to Lua. :)
ZeroOne (talk) 21:33, November 22, 2014 (UTC)
Advertisement