User talk:Dr. Strangelove

Jump to navigation Jump to search

About this board

Not editable

Dr. Strangelove (talkcontribs)

The way it looks at the moment is glorious chaos.

  • can styling be decoupled in any way (or at least made to look better)?
  • separate them into subtypes
  • having parameter names for the template follow the naming of XML elements would simplify ineraction with the parser
  • should work automagically but have the option of overwriting a property
  • simplest solution for automatic retrieval might be to just make a Lua function retrieve the property that is passed as a param (same name would be ideal) - unsure about performance costs of function calls for every property
syntax might look like this:
{{#invoke:Parser|get|manhunterOnDamageChance}}
Dr. Strangelove (talkcontribs)
Dr. Strangelove (talkcontribs)

Datamining the Defs for Infoboxes and Integration with MediaWiki

3
Dr. Strangelove (talkcontribs)
Dr. Strangelove (talkcontribs)

XML Definition files related to pawns:

  • Humans: /Defs/Races_Humanlike.xml
  • Animals: /Defs/Races_Animal_*.xml
  • Mechanoids: /Defs/Races_Mechanoid.xml
  • Insectoids: /Defs/Races_Animal_Insect.xml

All of the above inherit from: /Defs/Races_Animal_Base.xml

Dr. Strangelove (talkcontribs)

Thoughts:


Current idea is to use an external parser to convert xml based data to a Lua table.

Manual for now.

The root element of a logical unit would be based on <defName> and all inherited values would be merged into its subtree. If inherited values are merged for a (let's use Pawns as an example) Pawn, that would duplicate some data but would be more human readable.

No merging. Just use Lua to check the parent.

For now, another idea is to filter data that might be deemed unnecessary. This adds a layer of complexity of having to maintain a table for this, but seeing as it would need to be done once (for each "category" - if split into them) or very, very rarely... not that big of an issue.

Yes.

Another way of doing it could be to remove the need for an external parser, upload the relevant defs and do transforms with Lua. While doable... more work would have to be done with Lua. (Not liking it at the moment.)

Hard no.

Infobox Parameter Names

3
Summary by Dr. Strangelove

I'll use XML tag names as params for Module invocations. It looks like the "transformations" will be done in Infobox code anyway. Problem circumvented.

Dr. Strangelove (talkcontribs)

If the current naming scheme for infobox parameters is to remain in effect - a list for translating them to XML names will have to be made.

<defName>                   |name = Hare
                            |image = Hare.png
<description>               |description = "This small, solitary herbivore can swiftly hop away from danger."
                            |type = Animals
                            |type2 = Wild
<baseBodySize>              |bodysize = 0.2
<baseHealthScale>           |healthscale = 0.4
                            |movespeed = 6.0
                            |attack1dmg = 3
                            |attack1type = bite
                            |attack1part = teeth
                            |attack1cool = 100
<leatherDef>                |leathername = lightleather
{calculated}                |leatheryield = 15
<manhunterOnTameFailChance>
<manhunterOnDamageChance>   |manhunter = 0.0125
<baseHungerRate>            |hungerrate = 0.23
<foodType>                  |diet = herbivorous
                            |trainable = none
<wildness>                  |wildness = 0.75
<gestationPeriodDays>       |gestation = 13
Dr. Strangelove (talkcontribs)

Looks like the same problem would apply to the values passed in as parameters for templates:

["foodType"] = "VegetarianRoughAnimal" |diet = herbivorous
Dr. Strangelove (talkcontribs)

The Curious Case of Names

A single piece of data is referred to by three names:

  1. original tag name in XML files
  2. property name used by Semantic
  3. name used by template parameter

So, example: manhunterOnDamageChance (XML tag) becomes Turn Manhunter Chance When Attacked (SMW property) which is set in a template by a parameter manhunter.

This is the way it is done, via an infobox template:

{{#if: {{{manhunter|}}}|{{#set:Turn Manhunter Chance When Attacked = {{{manhunter|}}} }}
;{{H:title|link=no|Chance of this animal turning manhunter when attacked.|Manhunter Chance}}

This would suggest that there is yet another piece of data associated with each name - tooltip. (Ignore those - very rare - not worth the effort.)

There seems to be no central "list" connecting all these together?

Guidelines for Style

1
Summary by Dr. Strangelove

Style Guide is up.

RimWorld_Wiki:Style_guide

Dr. Strangelove (talkcontribs)
  • Properties and stats should use title case. Items and stuff don't and shouldn't even be linked as capitalized, e.g. heart, liver.
  • links in headings... nono
There are no older topics