Difference between revisions of "User:Pangaea/Notes on infoboxes"

From RimWorld Wiki
Jump to navigation Jump to search
(Biome)
Line 75: Line 75:
 
</pre>
 
</pre>
  
== Infobox problems ==
+
== Biome ==
Hi, since you've worked on all aspects on the wiki for 4 years, figured I'd reach out to you and hope you see what the issue is. I'm working more on the animal template and trying to put in code similar to in the infobox main template, so there is a backup for mass_young and such, which relies on a formula. The code looks correct to my eyes, but something is wrong because I get an error on the actual page: ''Expression error: Unrecognized punctuation character "{".''
+
May need several child-tables to easier deal with querying on the data. Possibly relevant for:
 +
* diseases
 +
* wildplants
 +
* wildanimals
  
This is what the code in the template looks like:
+
<pre>name
<pre><nowiki>| mass_baby          = {{#vardefine: mass_baby | {{#if: {{{mass_baby|}}} | {{{mass_baby}}} |
+
image (example)
    {{#if: {{{mass_adult|}}} | {{#expr:{{{massadult}}}/5}} }} }} }} {{#var:mass_baby}}</nowiki></pre>
+
description
  
The idea is to use vars to be able to store the correct data in Cargo, but without having to use the same chained ifs and whatnot in the output display section as well.  
+
animaldensity 1.8
 +
plantdensity 0.24
 +
settlementselectionweight 0.95
 +
movementdifficulty 1
 +
forageability0.5
 +
foragedfood RawAgave
 +
wildplantregrowdays27
 +
diseasemtbdays65
 +
  diseases (list/new table)
  
The output looks like this, but I think the error is further up, in the above section:
+
terrainsbyfertility
<pre><nowiki>{{#if: {{#var:mass_baby}} | {{!}} <div>Mass baby test</div> {{!!}} {{#var:mass_baby}} kg }}</nowiki></pre>
+
  sand, min, max
 +
  soil, min, max etc
 +
 
 +
baseweathercommonalities
 +
  clear 18, fog 1, rain 2, etc
 +
 
 +
wildplants
 +
  plantgrass 7.0
 +
  plantdandelion 0.8 etc
 +
 
 +
wildanimals
 +
  rat 1.3
 +
  hare 1.3 etc
 +
 
 +
allowedpackanimals
 +
  muffalo, dromedary etc
 +
</pre>

Revision as of 11:42, 27 July 2019

Template:Tocright

Pawn/Race/Animal

  <!-- Intro -->
| name               = String
| image              = File
| description        = Text    <!-- Plain, from XML files -->
| description_markup = Wikitext   <!-- With markup, for use in the article intro -->
| type               = Page    <!-- Animal? Mech? -->
| subtype            = Page    <!-- Domesticated? -->
<!--   General   -->
| basebodysize       = Float
| basehealthscale    = Float
| basehungerrate     = Float
| comfytemp_max      = Integer
| comfytemp_min      = Integer
| foodtype/diet      = Page
| flammability       = Float
| has_gender         = Boolean
| marketvalue        = Integer
| movespeed          = Float
<!--   Combat   -->
| armorrating_blunt  = Float
| armorrating_heat   = Float
| armorrating_sharp  = Float
| combatpower        = Integer
<!-- Life phases -->
| life_expectancy    = Integer
| mass_adult         = Float
| mass_baby          = Float
| mass_juvenile      = Float
| maturity_age       = Float
| minage_adult       = Float
| minage_baby        = Float
| minage_juvenile    = Float
| gestation_period   = Integer
| offspring_low      = Integer
| offspring_high     = Integer
<!--   Taming/hunting   -->
| handleskill        = Integer
| manhunter_damage   = Float
| manhunter_tamefail = Float
| nameontamechance   = Float
| nuzzlehours        = Integer
| petness            = Float
| predator           = Boolean
| maxpreybodysize    = Float
| trainability       = String     <!-- or Page? -->
| train_haul         = Boolean
| train_obedience    = Boolean
| train_release      = Boolean
| train_rescue       = Boolean
| wildness           = Float
<!--   Product   -->
| egg_amountlow      = Integer
| egg_amounthigh     = Integer
| egg_type           = Integer
| egg_time           = Integer
| leather_amount     = Integer
| leather_type       = Page     <!-- or Page? -->
| meat_amount        = Integer
| meat_type          = Page
| milk_amount        = Integer
| milk_time          = Integer
| shear_time         = Integer
| wool_amount        = Integer
| wool_type          = Page     <!-- or Page? -->
<!--   Other      -->
| ecosystemweight    = Float
| recipes_operation  = List (,) of String
| tradetags          = List (,) of String
<!--| butcherproducts?? (mechs) = Integer-->

Attack data: In Attack table
Lives in data: In Biome table

Biome

May need several child-tables to easier deal with querying on the data. Possibly relevant for:

  • diseases
  • wildplants
  • wildanimals
name
image (example)
description

animaldensity 1.8
plantdensity 0.24
settlementselectionweight 0.95
movementdifficulty 1
forageability0.5
foragedfood RawAgave
wildplantregrowdays27
diseasemtbdays65
  diseases (list/new table)

terrainsbyfertility
  sand, min, max
  soil, min, max etc

baseweathercommonalities
  clear 18, fog 1, rain 2, etc

wildplants
  plantgrass 7.0
  plantdandelion 0.8 etc

wildanimals
  rat 1.3
  hare 1.3 etc

allowedpackanimals
  muffalo, dromedary etc