[DIY] Treasure!

Post here your released mods

[DIY] Treasure!

Postby caprontos » Sun Jun 24, 2012 4:06 am

Well with the help of Jontis_00 and burningpet I was able to mostly complete this. These are made for .47b

Image


This mod is made mostly for normal maps.. though I am sure you could use it for others..
This mod adds chests to the game that give random loot. (the chests are mobs that will never move and die quickly.. mostly..)

There are 1-2 spawned in the jungle on normal maps so you will have a reason to kill those froggies... Then pre-set amounts for every floor - more chests per floor as you dig deeper, and better chests that drop better items the deeper you go.

But just free loot is no fun .. so some chests are also mimics .. these give no item when killed but should give decent exp to a hero... also some chests are trapped and will poison you... usually.


Due to my lack of experience with these things I am sure this can be improved.. so if you can improve it go for it.

Anyways.. I am not gonna compile this or upload anything .. - to lazy for now.. maybe later I will do that.. or if someone else would like to.. you may.


Anyways how to add this.. I'll just post what to add to each .xml to add this.

First
livingentities.xml
Add this at the end but above the line </livingentities>

Code: Select all
<lowchest>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>0</level>

      <name esES="Cofre">Chest</name>
      <attack>1</attack>
      <attackSpeed>1</attackSpeed>
      <defense>1</defense>
      <healthPoints>1</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>1</damage>

      <LOS>1</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>

      <effects>fakechesteffect</effects>

      <drop>
         <item>RANDOM</item>
         <PCT>100</PCT>
         <levelMin>1</levelMin>
         <levelMax>10</levelMax>
      </drop>
   </lowchest>

   <midchest>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>0</level>

      <name esES="Cofre">Green Chest</name>
      <attack>1</attack>
      <attackSpeed>1</attackSpeed>
      <defense>0</defense>
      <healthPoints>1</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>1</damage>

      <LOS>0</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>

      <effects>fakechesteffect</effects>

      <drop>
         <item>RANDOM</item>
         <PCT>100</PCT>
         <levelMin>11</levelMin>
         <levelMax>20</levelMax>
      </drop>
   </midchest>

   <highchest>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>0</level>

      <name esES="Oro Cofre">Gold Chest</name>
      <attack>1</attack>
      <attackSpeed>1</attackSpeed>
      <defense>0</defense>
      <healthPoints>1</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>1</damage>

      <LOS>0</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>

      <effects>fakechesteffect</effects>

      <drop>
         <item>RANDOM</item>
         <PCT>100</PCT>
         <levelMin>21</levelMin>
         <levelMax>30</levelMax>
      </drop>
   </highchest>


   <junchest>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>0</level>

      <name esES="Froggy Cofre">Froggy Chest</name>
      <habitat>jungle</habitat>
      <attack>1</attack>
      <attackSpeed>1</attackSpeed>
      <defense>1</defense>
      <healthPoints>1</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>1</damage>

      <LOS>1</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>

      <drop>
         <item>RANDOM</item>
         <PCT>100</PCT>
         <levelMin>2</levelMin>
         <levelMax>10</levelMax>
      </drop>
   </junchest>

   <lowmimic>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>10</level>

      <name esES="Cofre">Chest</name>
      <attack>1500</attack>
      <attackSpeed>4</attackSpeed>
      <defense>1500</defense>
      <healthPoints>1500</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>300</damage>

      <LOS>1</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>

      <effects>fakechesteffect</effects>

   </lowmimic>

   <midmimic>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>15</level>

      <name esES="Verde Cofre">Green Chest</name>
      <attack>2000</attack>
      <attackSpeed>4</attackSpeed>
      <defense>2000</defense>
      <healthPoints>2500</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>800</damage>

      <LOS>1</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>

      <effects>fakechesteffect</effects>

   </midmimic>

   <highmimic>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>20</level>

      <name esES="Oro Cofre">Gold Chest</name>
      <attack>5000</attack>
      <attackSpeed>4</attackSpeed>
      <defense>4000</defense>
      <healthPoints>5000</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>1500</damage>

      <LOS>1</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>
      <effects>fakechesteffect</effects>


   </highmimic>


   <lowtrapchest>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>0</level>

      <name esES="Cofre">Chest</name>
      <attack>5000</attack>
      <attackSpeed>5</attackSpeed>
      <defense>1</defense>
      <healthPoints>1000</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>0</damage>

      <LOS>1</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>

      <effects>chestpoison</effects>

      <drop>
         <item>RANDOM</item>
         <PCT>100</PCT>
         <levelMin>1</levelMin>
         <levelMax>10</levelMax>
      </drop>
   </lowtrapchest>

   <midtrapchest>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>0</level>

      <name esES="Verde Cofre">Green Chest</name>
      <attack>5000</attack>
      <attackSpeed>5</attackSpeed>
      <defense>1</defense>
      <healthPoints>1500</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>0</damage>

      <LOS>1</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>

      <effects>chestpoison</effects>

      <drop>
         <item>RANDOM</item>
         <PCT>100</PCT>
         <levelMin>11</levelMin>
         <levelMax>20</levelMax>
      </drop>
   </midtrapchest>

   <hightrapchest>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>0</level>

      <name esES="Oro Cofre">Gold Chest</name>
      <attack>5000</attack>
      <attackSpeed>5</attackSpeed>
      <defense>1</defense>
      <healthPoints>2500</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>0</damage>

      <LOS>1</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>

      <effects>chestpoison</effects>

      <drop>
         <item>RANDOM</item>
         <PCT>100</PCT>
         <levelMin>21</levelMin>
         <levelMax>30</levelMax>
      </drop>
   </hightrapchest>



Next in
effects.xml - again above the last </effects>.

Code: Select all
   <effect>
      <id>chestpoison</id>
      <onHitPCT>100</onHitPCT>
      <onHitEffects>dotpoison200</onHitEffects>
   </effect>

   <effect>
      <id>fakechesteffect</id>
   </effect>




Next in
gen_livingentities add above the </gen_livingentities> at the end:

Code: Select all
   <add>
      <entity>junchest</entity>
      <qtty>1d2</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>0</level>
   </add>


Next in
Graphics.ini
Add this first:

items.png to the TILESET_EXTRAS = at the top so it looks like:
Code: Select all
TILESET_EXTRAS =
walls.png,living2.png,citizenmale.png,citizenfemale.png,military.png,terrainslopes.png,
terrainslopes2.png,buildings.png,heroes.png,heroes2.png,heroes3.png,items2.png,walls2.png,items.png


Do not copy and paste that bit, as I had to add enters to make it work on the forums.. just add items.png to the end like it isthere

Then at the bottom add:
Code: Select all
[lowchest]TILE_X = 4
[lowchest]TILE_Y = 6
[lowchest]TEXTURE_FILE = items.png

[midchest]TILE_X = 4
[midchest]TILE_Y = 6
[midchest]COLOR = 169,231,190
[midchest]TEXTURE_FILE = items.png

[highchest]TILE_X = 4
[highchest]TILE_Y = 6
[highchest]COLOR = 248,149,16
[highchest]TEXTURE_FILE = items.png

[junchest]TILE_X = 4
[junchest]TILE_Y = 6
[junchest]TEXTURE_FILE = items.png

[lowmimic]TILE_X = 4
[lowmimic]TILE_Y = 6
[lowmimic]TEXTURE_FILE = items.png

[midmimic]TILE_X = 4
[midmimic]TILE_Y = 6
[midmimic]COLOR = 169,231,190
[midmimic]TEXTURE_FILE = items.png

[highmimic]TILE_X = 4
[highmimic]TILE_Y = 6
[highmimic]COLOR = 248,149,16
[highmimic]TEXTURE_FILE = items.png

[lowtrapchest]TILE_X = 4
[lowtrapchest]TILE_Y = 6
[lowtrapchest]TEXTURE_FILE = items.png

[midtrapchest]TILE_X = 4
[midtrapchest]TILE_Y = 6
[midtrapchest]COLOR = 169,231,190
[midtrapchest]TEXTURE_FILE = items.png

[hightrapchest]TILE_X = 4
[hightrapchest]TILE_Y = 6
[hightrapchest]COLOR = 248,149,16
[hightrapchest]TEXTURE_FILE = items.png



and lastly...

gen_dungeons you need to delete the entire content of the file then paste in this (I assume that will work.. I don't know where to even upload it quickly due to never uploading anything to share..)

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<gen_dungeons>
   <dungeon>
      <level>2</level>
      <type>__CAVE__</type>

      <monster>
         <id>__RANDOM__</id>
         <number>800</number>
         <levelMin>1</levelMin>
         <levelMax>1</levelMax>
      </monster>
      <monster>
         <id>spiderqueen</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>lowmimic</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowtrapchest</id>
         <number>1</number>
      </monster>
      <monster>
         <id>highchest</id>
         <number>1d10-9</number>
      </monster>
      <monster>
         <id>midchest</id>
         <number>1d10-5</number>
      </monster>
   </dungeon>

   <dungeon>
      <level>3</level>
      <type>__ROOMS__</type>
      <monster>
         <id>__RANDOM__</id>
         <number>800</number>
         <levelMin>1</levelMin>
         <levelMax>2</levelMax>
      </monster>
      <monster>
         <id>nusepthegoblinking</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowchest</id>
         <number>9</number>
      </monster>
      <monster>
         <id>lowmimic</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowtrapchest</id>
         <number>2</number>
      </monster>
      <monster>
         <id>midchest</id>
         <number>1d10-4</number>
      </monster>
      <monster>
         <id>highchest</id>
         <number>1d10-8</number>
      </monster>
   </dungeon>

   <dungeon>
      <level>4</level>
      <type>__ROOMS__</type>

      <monster>
         <id>__RANDOM__</id>
         <number>800</number>
         <levelMin>2</levelMin>
         <levelMax>3</levelMax>
      </monster>

      <monster>
         <id>draukthehobgoblinking</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowchest</id>
         <number>5</number>
      </monster>

      <monster>
         <id>midchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>midmimic</id>
         <number>1</number>
      </monster>
      <monster>
         <id>midtrapchest</id>
         <number>1</number>
      </monster>
      <monster>
         <id>highchest</id>
         <number>1d10-7</number>
      </monster>
   </dungeon>

   <dungeon>
      <level>5</level>
      <type>__CAVE__</type>

      <monster>
         <id>__RANDOM__</id>
         <number>800</number>
         <levelMin>1</levelMin>
         <levelMax>4</levelMax>
      </monster>
      <monster>
         <id>sikuthewolf</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>midchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>midmimic</id>
         <number>1</number>
      </monster>
      <monster>
         <id>midtrapchest</id>
         <number>2</number>
      </monster>
      <monster>
         <id>highchest</id>
         <number>1d10-6</number>
      </monster>
   </dungeon>

   <dungeon>
      <level>6</level>
      <type>__RANDOM__</type>
      <monster>
         <id>__RANDOM__</id>
         <number>800</number>
         <levelMin>2</levelMin>
         <levelMax>5</levelMax>
      </monster>
      <monster>
         <id>nexythesnickeredge</id>
         <number>1</number>
      </monster>
      <monster>
         <id>cavetroll</id>
         <number>2d2</number>
      </monster>
      <monster>
         <id>lowchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>lowmimic</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowtrapchest</id>
         <number>1</number>
      </monster>
      <monster>
         <id>midchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>midmimic</id>
         <number>2</number>
      </monster>
      <monster>
         <id>midtrapchest</id>
         <number>2</number>
      </monster>
      <monster>
         <id>highchest</id>
         <number>1d10-5</number>
      </monster>
   </dungeon>

   <dungeon>
      <level>7</level>
      <type>__ROOMS__</type>

      <monster>
         <id>__RANDOM__</id>
         <number>800</number>
         <levelMin>3</levelMin>
         <levelMax>6</levelMax>
      </monster>
      <monster>
         <id>toponovichthezombie</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>lowmimic</id>
         <number>2</number>
      </monster>
      <monster>
         <id>lowtrapchest</id>
         <number>2</number>
      </monster>
      <monster>
         <id>midchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>midmimic</id>
         <number>2</number>
      </monster>
      <monster>
         <id>midtrapchest</id>
         <number>3</number>
      </monster>
      <monster>
         <id>highchest</id>
         <number>1d10-4</number>
      </monster>
   </dungeon>

   <dungeon>
      <level>8</level>
      <type>__ROOMS__</type>
      <monster>
         <id>__RANDOM__</id>
         <number>800</number>
         <levelMin>2</levelMin>
         <levelMax>8</levelMax>
      </monster>
      <monster>
         <id>gaskonetheghoul</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowchest</id>
         <number>5</number>
      </monster>
      <monster>
         <id>lowmimic</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowtrapchest</id>
         <number>1</number>
      </monster>
      <monster>
         <id>midchest</id>
         <number>5</number>
      </monster>
      <monster>
         <id>midmimic</id>
         <number>1</number>
      </monster>
      <monster>
         <id>midtrapchest</id>
         <number>1</number>
      </monster>
      <monster>
         <id>highchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>highmimic</id>
         <number>1</number>
      </monster>
      <monster>
         <id>hightrapchest</id>
         <number>1</number>
      </monster>
   </dungeon>

   <dungeon>
      <level>9</level>
      <type>__RANDOM__</type>
      <monster>
         <id>__RANDOM__</id>
         <number>800</number>
         <levelMin>3</levelMin>
         <levelMax>9</levelMax>
      </monster>
      <monster>
         <id>humethealmightyogre</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>lowmimic</id>
         <number>2</number>
      </monster>
      <monster>
         <id>lowtrapchest</id>
         <number>2</number>
      </monster>
      <monster>
         <id>midchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>midmimic</id>
         <number>2</number>
      </monster>
      <monster>
         <id>midtrapchest</id>
         <number>2</number>
      </monster>
      <monster>
         <id>highchest</id>
         <number>8</number>
      </monster>
      <monster>
         <id>highmimic</id>
         <number>1</number>
      </monster>
      <monster>
         <id>hightrapchest</id>
         <number>2</number>
      </monster>
   </dungeon>

   <dungeon>
      <level>10</level>
      <type>__ROOMS__</type>
      <monster>
         <id>irongolem</id>
         <number>2</number>
      </monster>
      <monster>
         <id>sneakyghoul</id>
         <number>1d30+100</number>
      </monster>
      <monster>
         <id>ogre</id>
         <number>1d20+10</number>
      </monster>
      <monster>
         <id>lustyogre</id>
         <number>1d20+10</number>
      </monster>
      <monster>
         <id>toponovichthezombie</id>
         <number>1</number>
      </monster>
      <monster>
         <id>gaskonetheghoul</id>
         <number>1</number>
      </monster>
      <monster>
         <id>nexythesnickeredge</id>
         <number>1</number>
      </monster>
      <monster>
         <id>theburningpet</id>
         <number>1</number>
      </monster>
      <monster>
         <id>lowchest</id>
         <number>10</number>
      </monster>
      <monster>
         <id>lowmimic</id>
         <number>5</number>
      </monster>
      <monster>
         <id>lowtrapchest</id>
         <number>5</number>
      </monster>
      <monster>
         <id>midchest</id>
         <number>10</number>
      </monster>
      <monster>
         <id>midmimic</id>
         <number>5</number>
      </monster>
      <monster>
         <id>midtrapchest</id>
         <number>5</number>
      </monster>
      <monster>
         <id>highchest</id>
         <number>10</number>
      </monster>
      <monster>
         <id>highmimic</id>
         <number>5</number>
      </monster>
      <monster>
         <id>hightrapchest</id>
         <number>5</number>
      </monster>
   </dungeon>
</gen_dungeons>



Anyways.. If that all works out for you and I didn't somehow forget something (I'm pretty sure that's everything that needs added) - I hope you enjoy actualy finding some treasure.


This mod is not balanced really... I tested it - it works for me. Feel free to edit the number of chests or suggest a balance.. and again if anyone wants to compile this and make it modloader compatible - or just downloadable - be my guest, I may eventually but... not to night haha...
Image
Cha Cha Cha!
User avatar
caprontos
 
Posts: 3355
Joined: Wed Apr 04, 2012 3:18 am

Re: Treasure!

Postby EnvizionRev » Sun Jun 24, 2012 4:19 am

And this moment shall be known as the day Towns Dungeoneering REALLY began.
-- Envizion Revelations, Towns Moderator
User avatar
EnvizionRev
 
Posts: 791
Joined: Thu Mar 29, 2012 2:51 am

Re: Treasure!

Postby YetiChow » Sun Jun 24, 2012 5:47 am

Whoa, that's totally awesome (and I though the bear thing was good :shock:) I tried to do something similar a while ago, but couldn't even get decorative chests to generate randomly (as a test - I hadn't even begun to work making them drop loot, although I'd figured out how to do that) so I gave up. The fact that you've presented the actual code is a nice change - I know that most people want a link they can click to dowload a mod, but If I dowload any mods they'll be in this format for now so I can see how they work and easily fit them together with any existing mods I have. One question - do you think that it would be possible to write an action which causes townies to go out and open the chests? Your method of using mobs is infinitely better, but it would be nice to know that my idea might have worked (I was going to have chests which were actually a kind of bush or tree with no max age which could be "cleared" by townies and would drop random loot instead of wood).
What's that you're eating? A nice, juicy apple? You weren't supposed to eat that you fool, you were supposed to make it into a pie! - last words recorded words of Francis D'Avre before he went looking for snowcherries, but found a hungry Yeti instead.
YetiChow
 
Posts: 2174
Joined: Wed Apr 25, 2012 9:26 am
Location: Cramped between a Yeti's small intestine and its stomach... trying not to dissolve!

Re: Treasure!

Postby caprontos » Sun Jun 24, 2012 5:55 am

YetiChow wrote:Whoa, that's totally awesome (and I though the bear thing was good :shock:) I tried to do something similar a while ago, but couldn't even get decorative chests to generate randomly (as a test - I hadn't even begun to work making them drop loot, although I'd figured out how to do that) so I gave up. The fact that you've presented the actual code is a nice change - I know that most people want a link they can click to dowload a mod, but If I dowload any mods they'll be in this format for now so I can see how they work and easily fit them together with any existing mods I have. One question - do you think that it would be possible to write an action which causes townies to go out and open the chests? Your method of using mobs is infinitely better, but it would be nice to know that my idea might have worked (I was going to have chests which were actually a kind of bush or tree with no max age which could be "cleared" by townies and would drop random loot instead of wood).


I have no idea haha.. possibly -I have yet to try to edit the actions xml really (when I did I failed to :D)... BlueSteelAUS or Jontis_00 might be able to say for sure.

That maybe possible though - though I wanted heroes to open them mostly.. since it is a hero activity not really a town activity...

I tried to do it with traps first but that wasn't possible..


Though your idea - if it works.. would be good for maybe random loot barrels with materials.. or special townie-only chests mixed in.. I'll try to look tomorrow.. if neither of them comes around to say :P
Image
Cha Cha Cha!
User avatar
caprontos
 
Posts: 3355
Joined: Wed Apr 04, 2012 3:18 am

Re: Treasure!

Postby Jontis_00 » Sun Jun 24, 2012 9:35 am

YetiChow wrote:One question - do you think that it would be possible to write an action which causes townies to go out and open the chests? Your method of using mobs is infinitely better, but it would be nice to know that my idea might have worked (I was going to have chests which were actually a kind of bush or tree with no max age which could be "cleared" by townies and would drop random loot instead of wood).


Yes this is very possible :)
My Mods: 12 000+ downloads!

-list of mods removed-

I do no longer make mods for Towns sadly, if you want to continue or update any of my outdated mods, feel free to contact me!
User avatar
Jontis_00
 
Posts: 736
Joined: Sun Feb 12, 2012 4:49 pm

Re: Treasure!

Postby Jon_jon13 » Sun Jun 24, 2012 12:40 pm

Devs. Must. See. This.
This device requires watergineers, m'lord!
User avatar
Jon_jon13
 
Posts: 1362
Joined: Fri May 04, 2012 11:19 am

Re: Treasure!

Postby caprontos » Sun Jun 24, 2012 3:34 pm

YetiChow wrote:.One question - do you think that it would be possible to write an action which causes townies to go out and open the chests?



Yes this is separate from the above..

add to action.xml:
Code: Select all
<action>
      <id>qopen</id>
      <name esES="Open">Open</name>

      <priorityID>terrainchange</priorityID>
      <queue>
         <move useSource="true">yetichest</move>
         <wait>10</wait>
         <destroyCellItem />
         <createFriendly>yetichestdummy</createFriendly>
      </queue>
   </action>


add to items.xml:
Code: Select all
   <yetichest>
      <name esES="Chest">Chest</name>
      <action>qopen</action>
      <locked>true</locked>
   </yetichest>


add to livingentities.xml:
Code: Select all
<yetichestdummy>
      <type>ENEMY</type>
      <hate>CITIZEN,HERO</hate>
      <level>0</level>

      <name esES="Cofre">Chest</name>
      <attack>1</attack>
      <attackSpeed>1</attackSpeed>
      <defense>1</defense>
      <healthPoints>1</healthPoints>
      <attackVerb esES="ataca">crush</attackVerb>
      <attackVerbInfinitive esES="atacar">crush</attackVerbInfinitive>
      <damage>1</damage>

      <LOS>1</LOS>
      <movePCT>0</movePCT>
      <walkSpeed>0</walkSpeed>
      <grouping>true</grouping>

      <drop>
         <item>RANDOM</item>
         <PCT>100</PCT>
         <levelMin>1</levelMin>
         <levelMax>10</levelMax>
      </drop>
   </yetichestdummy>


and to graphics.ini:
Code: Select all
[yetichest]TILE_X = 4
[yetichest]TILE_Y = 6
[yetichest]TEXTURE_FILE = items.png


[yetichestdummy]TILE_X = 4
[yetichestdummy]TILE_Y = 6
[yetichestdummy]TEXTURE_FILE = items.png


And should work...

Rightclick-open on a chest.


Townie gose over to open it, then the mobchest is created.. they kill this - and it drops random item.

- only way I could find to do it with jontis's help again :P

To apply this to the above mod I made... you need to make 10 new items .. all with their own set graphics. and actions

Then link all the actions to my 10 chest types - then when they open a chest it will spawn the correct mob. Should be easy to do..

You do also need to set up all the spawning in the gen_items. I assume you can.


The difference would be... do you want this an automated hero activity.. or a manual player activity?
Image
Cha Cha Cha!
User avatar
caprontos
 
Posts: 3355
Joined: Wed Apr 04, 2012 3:18 am

Re: Treasure! [DIY]

Postby wizardjian » Mon Jun 25, 2012 4:37 am

lolz am i the only one that looks at the coding and my head falls off? xD
Emotions are a hiderance...
Life is just a illusion...
Toughts are usless...
Sanity is a lie...

Froggie's Diary-http://townsgame.com/forums/viewtopic.php?f=12&t=3544
Moving Forwards Into The Future-http://tinyurl.com/c9gulrk
User avatar
wizardjian
 
Posts: 426
Joined: Sat May 05, 2012 11:20 pm

Re: Treasure! [DIY]

Postby caprontos » Mon Jun 25, 2012 4:47 am

wizardjian wrote:lolz am i the only one that looks at the coding and my head falls off? xD


Well it isn't so bad once you start to understand some basics .. I still don't get a lot of it.. but it really doesn't seem that hard to learn..
Image
Cha Cha Cha!
User avatar
caprontos
 
Posts: 3355
Joined: Wed Apr 04, 2012 3:18 am

Re: Treasure! [DIY]

Postby Jon_jon13 » Mon Jun 25, 2012 7:57 am

Yup, I figured up most of it myself, the basic things like "maxage" "spawn" "spawnturns" etc. are easy to understand (at least for me)
This device requires watergineers, m'lord!
User avatar
Jon_jon13
 
Posts: 1362
Joined: Fri May 04, 2012 11:19 am

Next

Return to Released mods

Who is online

Users browsing this forum: Google [Bot] and 1 guest