[DIY] [0.60] 3 More flower colours (purple, orange & green)

Post here your released mods

[DIY] [0.60] 3 More flower colours (purple, orange & green)

Postby Effix » Wed Sep 19, 2012 7:10 pm

Image

This will be more of an instruction than a tutorial, check my sheep tutorial if things are going too fast.

1: Resources
Needed resources:
- extraflowers.png

(Original graphics by burningpet)

Put the above file in Towns\data\graphics.

2: Graphics

Add the following bit to the bottom of the file:
Code: Select all
[purpleflowerseed]TILE_X = 0
[purpleflowerseed]TILE_Y = 0
[purpleflowerseed]TEXTURE_FILE = items.png

[gardenpurple]TILE_X = 0
[gardenpurple]TILE_Y = 4
[gardenpurple]TILE_WIDTH = 64
[gardenpurple]TILE_HEIGHT = 64
[gardenpurple]TEXTURE_FILE = extraflowers.png

[purpleflowerhedge]TILE_X = 0
[purpleflowerhedge]TILE_Y = 1
[purpleflowerhedge]TILE_HEIGHT = 64
[purpleflowerhedge]TEXTURE_FILE = extraflowers.png

[purpleflower]TILE_X = 0
[purpleflower]TILE_Y = 0
[purpleflower]TEXTURE_FILE = extraflowers.png

[plantedpurpleflower]TILE_X = 0
[plantedpurpleflower]TILE_Y = 0
[plantedpurpleflower]TEXTURE_FILE = extraflowers.png

[gatheredpurpleflower]TILE_X = 0
[gatheredpurpleflower]TILE_Y = 3
[gatheredpurpleflower]TEXTURE_FILE = extraflowers.png

[orangeflowerseed]TILE_X = 0
[orangeflowerseed]TILE_Y = 0
[orangeflowerseed]TEXTURE_FILE = items.png

[gardenorange]TILE_X = 1
[gardenorange]TILE_Y = 4
[gardenorange]TILE_WIDTH = 64
[gardenorange]TILE_HEIGHT = 64
[gardenorange]TEXTURE_FILE = extraflowers.png

[orangeflowerhedge]TILE_X = 1
[orangeflowerhedge]TILE_Y = 1
[orangeflowerhedge]TILE_HEIGHT = 64
[orangeflowerhedge]TEXTURE_FILE = extraflowers.png

[orangeflower]TILE_X = 1
[orangeflower]TILE_Y = 0
[orangeflower]TEXTURE_FILE = extraflowers.png

[plantedorangeflower]TILE_X = 1
[plantedorangeflower]TILE_Y = 0
[plantedorangeflower]TEXTURE_FILE = extraflowers.png

[gatheredorangeflower]TILE_X = 1
[gatheredorangeflower]TILE_Y = 3
[gatheredorangeflower]TEXTURE_FILE = extraflowers.png

[greenflowerseed]TILE_X = 0
[greenflowerseed]TILE_Y = 0
[greenflowerseed]TEXTURE_FILE = items.png

[gardengreen]TILE_X = 2
[gardengreen]TILE_Y = 4
[gardengreen]TILE_WIDTH = 64
[gardengreen]TILE_HEIGHT = 64
[gardengreen]TEXTURE_FILE = extraflowers.png

[greenflowerhedge]TILE_X = 2
[greenflowerhedge]TILE_Y = 1
[greenflowerhedge]TILE_HEIGHT = 64
[greenflowerhedge]TEXTURE_FILE = extraflowers.png

[greenflower]TILE_X = 2
[greenflower]TILE_Y = 0
[greenflower]TEXTURE_FILE = extraflowers.png

[plantedgreenflower]TILE_X = 2
[plantedgreenflower]TILE_Y = 0
[plantedgreenflower]TEXTURE_FILE = extraflowers.png

[gatheredgreenflower]TILE_X = 2
[gatheredgreenflower]TILE_Y = 3
[gatheredgreenflower]TEXTURE_FILE = extraflowers.png

[ui_purpleflower]TILE_X = 0
[ui_purpleflower]TILE_Y = 6
[ui_purpleflower]TILE_WIDTH = 64
[ui_purpleflower]TILE_HEIGHT = 64
[ui_purpleflower]TEXTURE_FILE = extraflowers.png

[ui_orangeflower]TILE_X = 1
[ui_orangeflower]TILE_Y = 6
[ui_orangeflower]TILE_WIDTH = 64
[ui_orangeflower]TILE_HEIGHT = 64
[ui_orangeflower]TEXTURE_FILE = extraflowers.png

[ui_greenflower]TILE_X = 2
[ui_greenflower]TILE_Y = 6
[ui_greenflower]TILE_WIDTH = 64
[ui_greenflower]TILE_HEIGHT = 64
[ui_greenflower]TEXTURE_FILE = extraflowers.png



3: Items
Add the following bit to Towns\data\items.xml:
Code: Select all
   <!-- Extra Flowers //-->
   <orangeflowerhedge>
      <name esES="Seto de flores naranja">Orange flower hedge</name>
      <wall>true</wall>
      <canBeBuiltOnHoles>true</canBeBuiltOnHoles>
      <glue>true</glue>
      <base>true</base>
      <alwaysOperative>false</alwaysOperative>
      <value>50</value>
   </orangeflowerhedge>
   <purpleflowerhedge>
      <name esES="Seto de flores púrpura">Purple flower hedge</name>
      <wall>true</wall>
      <canBeBuiltOnHoles>true</canBeBuiltOnHoles>
      <glue>true</glue>
      <base>true</base>
      <alwaysOperative>false</alwaysOperative>
      <value>50</value>
   </purpleflowerhedge>   
   <greenflowerhedge>
      <name esES="Seto de flores verde">Green flower hedge</name>
      <wall>true</wall>
      <canBeBuiltOnHoles>true</canBeBuiltOnHoles>
      <glue>true</glue>
      <base>true</base>
      <alwaysOperative>false</alwaysOperative>
      <value>50</value>
   </greenflowerhedge>
   <orangeflower>
      <name esES="Flores naranja">Orange flowers</name>
      <habitat>grassnoflower</habitat>
      <action>qcut</action>
      <action>qgatherorangeflower</action>
   </orangeflower>
   <orangeflowerseed>
      <name esES="Semilla de flor naranja">Orange flower seedling</name>
      <habitat>humus</habitat>
      <type>rawfood</type>
      <maxAge>1d720+720</maxAge>
      <maxAgeItem>plantedorangeflower</maxAgeItem>
      <action>qcut</action>
      <value>35</value>
   </orangeflowerseed>
   <plantedorangeflower>
      <name esES="Flores naranja">Orange flowers</name>
      <habitat>humus</habitat>
      <action>qcut</action>
      <action>qgatherplantedorangeflower</action>
   </plantedorangeflower>
   <purpleflower>
      <name esES="Flores púrpura">Purple flowers</name>
      <habitat>grassnoflower1</habitat>
      <action>qcut</action>
      <action>qgatherpurpleflower</action>
   </purpleflower>
   <purpleflowerseed>
      <name esES="Semilla de flor púrpura">Purple flower seedling</name>
      <habitat>humus</habitat>
      <type>rawfood</type>
      <maxAge>1d720+720</maxAge>
      <maxAgeItem>plantedpurpleflower</maxAgeItem>
      <action>qcut</action>
      <value>35</value>
   </purpleflowerseed>
   <plantedpurpleflower>
      <name esES="Flores púrpura">Purple flowers</name>
      <habitat>humus</habitat>
      <action>qcut</action>
      <action>qgatherplantedpurpleflower</action>
   </plantedpurpleflower>
   <greenflower>
      <name esES="Flores verde">Green flowers</name>
      <habitat>grassnoflower2</habitat>
      <action>qcut</action>
      <action>qgathergreenflower</action>
   </greenflower>
   <greenflowerseed>
      <name esES="Semilla de flor verde">Green flower seedling</name>
      <habitat>humus</habitat>
      <type>rawfood</type>
      <maxAge>1d720+720</maxAge>
      <maxAgeItem>plantedgreenflower</maxAgeItem>
      <action>qcut</action>
      <value>35</value>
   </greenflowerseed>
   <plantedgreenflower>
      <name esES="Flores verde">Green flowers</name>
      <habitat>humus</habitat>
      <action>qcut</action>
      <action>qgatherplantedgreenflower</action>
   </plantedgreenflower>
   <gatheredorangeflower>
      <name esES="Flores naranja">Orange flowers</name>
      <type>rawmaterials.colors</type>
      <stackable>true</stackable>
      <stackableSize>1</stackableSize>
      <value>38</value>
   </gatheredorangeflower>
   <gatheredpurpleflower>
      <name esES="Flores púrpura">Purple flowers</name>
      <type>rawmaterials.colors</type>
      <stackable>true</stackable>
      <stackableSize>1</stackableSize>
      <value>38</value>
   </gatheredpurpleflower>
   <gatheredgreenflower>
      <name esES="Flores verde">Green flowers</name>
      <type>rawmaterials.colors</type>
      <stackable>true</stackable>
      <stackableSize>1</stackableSize>
      <value>38</value>
   </gatheredgreenflower>
   <gardenorange>
      <name esES="Jardín de flores naranja">Orange flowers garden</name>
      <description esES="Jardín en miniatura">Miniature garden</description>
      <type>decorative.outdoor</type>
      <alwaysOperative>false</alwaysOperative>
      <happiness>2</happiness>
      <stackable>true</stackable>
      <stackableSize>1</stackableSize>
      <value>102</value>
   </gardenorange>
   <gardenpurple>
      <name esES="Jardín de flores púrpura">Purple flowers garden</name>
      <description esES="Jardín en miniatura">Miniature garden</description>
      <type>decorative.outdoor</type>
      <alwaysOperative>false</alwaysOperative>
      <happiness>2</happiness>
      <stackable>true</stackable>
      <stackableSize>1</stackableSize>
      <value>102</value>
   </gardenpurple>
   <gardengreen>
      <name esES="Jardín de flores verde">Green flowers garden</name>
      <description esES="Jardín en miniatura">Miniature garden</description>
      <type>decorative.outdoor</type>
      <alwaysOperative>false</alwaysOperative>
      <happiness>2</happiness>
      <stackable>true</stackable>
      <stackableSize>1</stackableSize>
      <value>102</value>
   </gardengreen>   
   <!-- End Extra Flowers -->



4: Actions
Add the following bit to Towns\data\actions.xml:
Code: Select all
   <!-- Extra Flowers //-->
   <action>
      <id>qgatherorangeflower</id>
      <name esES="Recolectar">Gather</name>
      <generatedItem>gatheredorangeflower</generatedItem>
      <priorityID>gatheringharvesting</priorityID>
      <queue>
         <move useSource="true">orangeflower</move>
         <wait>30</wait>
         <destroyCellItem />
         <createItem>gatheredorangeflower</createItem>
      </queue>
   </action>
   <action>
      <id>qorangeflowerseed</id>
      <name esES="Plantar flor naranja">Plant orange flower</name>
      <priorityID>gatheringharvesting</priorityID>
      <queue>
         <pick>gatheredorangeflower,orangeflower</pick>
         <wait>20</wait>
         <destroyItem />
         <createItem>orangeflowerseed</createItem>
      </queue>
   </action>
   <action>
      <id>qgatherplantedorangeflower</id>
      <name esES="Recolectar">Gather</name>
      <generatedItem>gatheredorangeflower</generatedItem>
      <priorityID>gatheringharvesting</priorityID>
      <queue>
         <move useSource="true">plantedorangeflower</move>
         <wait>36</wait>
         <replaceCellItem>orangeflowerseed</replaceCellItem>
         <createItem>gatheredorangeflower</createItem>
      </queue>
   </action>
   <action>
      <id>qgatherpurpleflower</id>
      <name esES="Recolectar">Gather</name>

      <generatedItem>gatheredpurpleflower</generatedItem>
      <priorityID>gatheringharvesting</priorityID>
      <queue>
         <move useSource="true">purpleflower</move>
         <wait>30</wait>
         <destroyCellItem />
         <createItem>gatheredpurpleflower</createItem>
      </queue>
   </action>
   <action>
      <id>qpurpleflowerseed</id>
      <name esES="Plantar flor púrpura">Plant purple flower</name>
      <priorityID>gatheringharvesting</priorityID>
      <queue>
         <pick>gatheredpurpleflower,purpleflower</pick>
         <wait>20</wait>
         <destroyItem />
         <createItem>purpleflowerseed</createItem>
      </queue>
   </action>
   <action>
      <id>qgatherplantedpurpleflower</id>
      <name esES="Recolectar">Gather</name>
      <generatedItem>gatheredpurpleflower</generatedItem>
      <priorityID>gatheringharvesting</priorityID>
      <queue>
         <move useSource="true">plantedpurpleflower</move>
         <wait>36</wait>
         <replaceCellItem>purpleflowerseed</replaceCellItem>
         <createItem>gatheredpurpleflower</createItem>
      </queue>
   </action>
   <action>
      <id>qgathergreenflower</id>
      <name esES="Recolectar">Gather</name>
      <generatedItem>gatheredgreenflower</generatedItem>
      <priorityID>gatheringharvesting</priorityID>
      <queue>
         <move useSource="true">greenflower</move>
         <wait>30</wait>
         <destroyCellItem />
         <createItem>gatheredgreenflower</createItem>
      </queue>
   </action>
   <action>
      <id>qgreenflowerseed</id>
      <name esES="Plantar flor verde">Plant green flower</name>
      <priorityID>gatheringharvesting</priorityID>
      <queue>
         <pick>gatheredgreenflower,greenflower</pick>
         <wait>20</wait>
         <destroyItem />
         <createItem>greenflowerseed</createItem>
      </queue>
   </action>
   <action>
      <id>qgatherplantedgreenflower</id>
      <name esES="Recolectar">Gather</name>
      <generatedItem>gatheredgreenflower</generatedItem>
      <priorityID>gatheringharvesting</priorityID>
      <queue>
         <move useSource="true">plantedgreenflower</move>
         <wait>36</wait>
         <replaceCellItem>greenflowerseed</replaceCellItem>
         <createItem>gatheredgreenflower</createItem>
      </queue>
   </action>
   <action>
      <id>qgardenpurple</id>
      <priorityID>itemconstruction</priorityID>
      <queue>
         <pick>gatheredpurpleflower</pick>
         <wait>32</wait>
         <destroyItem />
         <pick>rmmud</pick>
         <wait>32</wait>
         <destroyItem />
         <pick>rmstone</pick>
         <wait>32</wait>
         <destroyItem />
         <createItem>gardenpurple</createItem>
      </queue>
   </action>
   <action>
      <id>qgardenorange</id>
      <priorityID>itemconstruction</priorityID>
      <queue>
         <pick>gatheredorangeflower</pick>
         <wait>32</wait>
         <destroyItem />
         <pick>rmmud</pick>
         <wait>32</wait>
         <destroyItem />
         <pick>rmstone</pick>
         <wait>32</wait>
         <destroyItem />
         <createItem>gardenorange</createItem>
      </queue>
   </action>
   <action>
      <id>qgardengreen</id>
      <priorityID>itemconstruction</priorityID>
      <queue>
         <pick>gatheredgreenflower</pick>
         <wait>32</wait>
         <destroyItem />
         <pick>rmmud</pick>
         <wait>32</wait>
         <destroyItem />
         <pick>rmstone</pick>
         <wait>32</wait>
         <destroyItem />
         <createItem>gardengreen</createItem>
      </queue>
   </action>
   <action>
      <id>qpurplehedge</id>
      <priorityID>wallconstruction</priorityID>
      <queue>
         <pick>gatheredpurpleflower</pick>
         <wait>25</wait>
         <destroyItem />
         <pick>bush,bush2,bush3</pick>
         <wait>25</wait>
         <destroyItem />
         <createItem>purpleflowerhedge</createItem>
      </queue>
   </action>
   <action>
      <id>qorangehedge</id>
      <priorityID>wallconstruction</priorityID>
      <queue>
         <pick>gatheredorangeflower</pick>
         <wait>25</wait>
         <destroyItem />
         <pick>bush,bush2,bush3</pick>
         <wait>25</wait>
         <destroyItem />
         <createItem>orangeflowerhedge</createItem>
      </queue>
   </action>
   <action>
      <id>qgreenhedge</id>
      <priorityID>wallconstruction</priorityID>
      <queue>
         <pick>gatheredgreenflower</pick>
         <wait>25</wait>
         <destroyItem />
         <pick>bush,bush2,bush3</pick>
         <wait>25</wait>
         <destroyItem />
         <createItem>greenflowerhedge</createItem>
      </queue>
   </action>   
   <!-- End Extra Flowers -->


5: Bottom Menu
(This step is possibly not compatible with mods that add things you can harvest)
Open Towns\data\menu.xml and replace the line with "Harvest" in it with:
Code: Select all
   <item name="Harvest" esES="Recolectar" code="CUSTOMACTION" parameter="qharvestapple,qharvestpear,qharvestwheat,qharvestplanttrap,qharvestwildwheat,qharvestblueradish,qharvestsnowcherry,qharvestbanana,qpickmushroom,qpickcavemushroom,qharvestcactus,qgatherredflower,qgatherplantedredflower,qgatherblueflower,qgatherplantedblueflower,qgatheryellowflower,qgatherpurpleflower,qgatherorangeflower,qgathergreenflower,qgatherplantedyellowflower,qgatherplantedpurpleflower,qgatherplantedorangeflower,qgatherplantedgreenflower,qharvestppear,qharvestpapple,qharvestpbanana,qharvestpblueradish,qharvestpcactus,qharvestpsnowcherry,qpickpcavemushroom,qpickpmushroom" icon="ui_harvest" />


6: Right Menu
Open Towns\data\right_menu.xml, look for the "Planting" group and within it look for the 3 existing flowers. Add the following bit after the line with qyellowflowerseed:
Code: Select all
      <item code="QUEUEANDPLACEROW" parameter="qpurpleflowerseed" icon="ui_purpleflower" />
      <item code="QUEUEANDPLACEROW" parameter="qorangeflowerseed" icon="ui_orangeflower" />
      <item code="QUEUEANDPLACEROW" parameter="qgreenflowerseed" icon="ui_greenflower" />


7: Making the new flowers spawn on new maps
The last step is to add some lines in all the gen_items.xml files in almost all the folders you find in Towns\data\campaigns\c1. (Path may be different if you purchased the game through Desura)
For example open Towns\data\campaigns\c1\normal\gen_items.xml and add the following entries:
Code: Select all
   <add>
      <item>orangeflower</item>
      <qtty>30</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <add>
      <item>purpleflower</item>
      <qtty>30</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <add>
      <item>greenflower</item>
      <qtty>30</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>

I'm using quantity 30 here, else the flowers get a bit dominant. I suggest lowering the <qtty> values for the standard red, blue and yellow flowers to that same amount. You can stick to the original 55 if you want to see 2 times more flowers on a map.
- You can skip the desert folder, no flowers spawn there by default because of all the sand.
- You can use quantity 10 for all flowers on the snow map, again to keep it a bit balanced.

That's it, have fun!

Note: We're not touching the colour making system, you still need red and blue to make purple colour. The reason is a bit technical, comes down to that you would have to throw out the option to mix colours if you want to use these new flowers to make the colours instead. I rather like that mixing system.

p.s. you are all free to use these graphics for whatever you like, no need to give me credits, I only changed some colours...


Updated to 0.60
What's new & relevant?
- Items have values, for buying/selling at the caravan
- UI icons can now be in your custom image
- All entries in graphics.ini need to have a texture file reference (no more TILESET_EXTRAS value)
User avatar
Effix
 
Posts: 178
Joined: Mon Jun 18, 2012 11:18 am
Location: The Netherlands

Re: [DIY] [0.60] 3 More flower colours (purple, orange & gre

Postby Effix » Fri Oct 05, 2012 8:19 am

Bonus: Auto-production

Open Towns\data\menu_production.xml and find qharvestpcactus under Food->Gathering->Trees and plants, add the following bit after the qharvestpcactus line:

Code: Select all
            <item code="QUEUE" parameter="qgatherplantedredflower" />
            <item code="QUEUE" parameter="qgatherplantedblueflower" />
            <item code="QUEUE" parameter="qgatherplantedyellowflower" />

            <item code="QUEUE" parameter="qgatherplantedpurpleflower" />
            <item code="QUEUE" parameter="qgatherplantedorangeflower" />
            <item code="QUEUE" parameter="qgatherplantedgreenflower" />


That's all 8-)

(Leave out the last 3 lines if you only came here for auto gathering of the 3 standard flowers)
User avatar
Effix
 
Posts: 178
Joined: Mon Jun 18, 2012 11:18 am
Location: The Netherlands


Return to Released mods

Who is online

Users browsing this forum: No registered users and 1 guest