User:Kernelmethod/Sandbox

From Caves of Qud Wiki
Jump to navigation Jump to search

Tutorial: Mage Towers (static and dynamic encounters)

Potential ideas for an encounters tutorial:

  • Static/dynamic locations
  • Adding secrets during worldgen
  • Zone builders

Some potential references:

Other:

Static encounters section can be done with just XML; dynamic encounters section will require some C# experience.

Adding static encounters

  • Editing cell definition in Worlds.xml
  • Add a new population table to a cell.
  • Create a map template with the map editor.
<?xml version="1.0" encoding="utf-8" ?>
<objects>
  <!--
    Due to an outstanding bug in the way the Hills zonebuilder works, your
    terrain object *must* have the word "Hills" somewhere in its name.

    https://bitbucket.org/bbucklew/cavesofqud-public-issue-tracker/issues/10902
  -->
  <object Name="Pyovya_SnapjawMage_TerrainMageHills" Inherits="TerrainHills">
    <part Name="Render" DisplayName="mage's tower" RenderString="227" ColorString="&amp;K" DetailColor="m" Tile="Pyovya_SnapjawMage/mage_tower.png" />
    <part Name="Description" Short="The secluded abode of an accomplished magician lays against the rolling hillscape. At night, one can hear their lonely howls emanating from the ruined tower." />
    <!--
      Remove the RandomTile part inherited from TerrainHills so that our tile doesn't
      get replaced with a random hills tile.
    -->
    <removepart Name="RandomTile" />
    <!--
      We modify grammatical usage of the terrain's name so that when we pass it by
      on the world map, it says that we pass by "a mage's tower" rather than "some
      mage's tower" or "a set of mage's tower".
    -->
    <xtagGrammar Proper="false" massNoun="false" />
    <tag Name="Gender" Value="*delete" />
  </object>
</objects>
<?xml version="1.0" encoding="utf-8" ?>
<worlds>
  <world Name="JoppaWorld" Load="Merge">
    <cell Name="Pyovya_SnapjawMage_MageTower" Inherits="Hills" ApplyTo="Pyovya_SnapjawMage_TerrainMageHills" Mutable="false">
      <!-- New zone containing the mage's tower -->
      <zone Level="10" x="1" y="1" IndefiniteArticle="a" Name="mage's tower" HasWeather="true" WindSpeed="0-60" WindDirections="N,NW,NW,W,W,SW,S,SE" WindDuration="50-3000">
      </zone>
    </cell>
  </world>
</worlds>
<?xml version="1.0" encoding="utf-8"?>
<Map Width="80" Height="25">
  <cell X="19" Y="23">
    <object Name="Pyovya_SnapjawMage_TerrainMageHills"></object>
  </cell>
</Map>

Your first dynamic encounter

World generation

  • Locate zone to place tower
  • Place creature

Zone builders

  • Place walls and items
  • Add map template.