Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [47.X] Pet Shop : Buy pets with gold coins !  (Read 1390 times)

KassaK

  • Bay Watcher
    • View Profile
[47.X] Pet Shop : Buy pets with gold coins !
« on: May 09, 2020, 06:07:01 pm »

Pet Shop simply add to the game a new Workshop : The Pet Shop. (Inspired by the mod Cultural Exchange by Meph http://www.bay12forums.com/smf/index.php?topic=174601.0)

DOWNLOAD LINK : http://dffd.bay12games.com/file.php?id=15064

The Pet Shop allow yo to buy pets with Gold Coins : https://dwarffortresswiki.org/index.php/DF2014:Currency

1 Gold Bar = 500 Gold Coins and you need to have your coins in a Coin Stockpile

The mod is pre-installed with 7 buyable pets (vanilla) :
INSTALLATION

- You need DFHACK for this mod

- Copy building_petshop.txt and reaction_petshop.txt into the folder \raw\objects

- Add these lines into your \raw\objects\entity_default.txt (or your custom entity file), for example under [ENTITY:MOUNTAIN] for dwarfs :

Quote
[PERMITTED_BUILDING:PET_SHOP]
[PERMITTED_REACTION:BUY_PET_CAVE_DRAGON]
[PERMITTED_REACTION:BUY_PET_DRAGON]
[PERMITTED_REACTION:BUY_PET_HYDRA]
[PERMITTED_REACTION:BUY_PET_ROC]
[PERMITTED_REACTION:BUY_PET_GIANT_CAVE_SPIDER]
[PERMITTED_REACTION:BUY_PET_GIANT_DESERT_SCORPION]
[PERMITTED_REACTION:BUY_PET_UNICORN]

- Copy the file OnLoad.init into the folder \raw or add these lines into your own :

Quote
modtools/reaction-trigger -reactionName BUY_PET_CAVE_DRAGON -command [ modtools/create-unit -race CAVE_DRAGON -domesticate -setUnitToFort -location [ 0 0 150 ] -locationRange [ 0 0 50 ] -flagSet [ announce_titan ] ]

modtools/reaction-trigger -reactionName BUY_PET_DRAGON -command [ modtools/create-unit -race DRAGON -domesticate -setUnitToFort -location [ 0 0 150 ] -locationRange [ 0 0 50 ] -flagSet [ announce_titan ] ]

modtools/reaction-trigger -reactionName BUY_PET_HYDRA -command [ modtools/create-unit -race HYDRA -domesticate -setUnitToFort -location [ 0 0 150 ] -locationRange [ 0 0 50 ] -flagSet [ announce_titan ] ]

modtools/reaction-trigger -reactionName BUY_PET_ROC -command [ modtools/create-unit -race ROC -domesticate -setUnitToFort -location [ 0 0 150 ] -locationRange [ 0 0 50 ] -flagSet [ announce_titan ] ]

modtools/reaction-trigger -reactionName BUY_PET_GIANT_CAVE_SPIDER -command [ modtools/create-unit -race GIANT_CAVE_SPIDER -domesticate -setUnitToFort -location [ 0 0 150 ] -locationRange [ 0 0 50 ] -flagSet [ announce_titan ] ]

modtools/reaction-trigger -reactionName BUY_PET_GIANT_DESERT_SCORPION -command [ modtools/create-unit -race GIANT_DESERT_SCORPION -domesticate -setUnitToFort -location [ 0 0 150 ] -locationRange [ 0 0 50 ] -flagSet [ announce_titan ] ]

modtools/reaction-trigger -reactionName BUY_PET_UNICORN -command [ modtools/create-unit -race UNICORN -domesticate -setUnitToFort -location [ 0 0 150 ] -locationRange [ 0 0 50 ] -flagSet [ announce_titan ] ]


HOW TO ADD BUYABLE PETS ?

First you have to find the name of the pet you want, you can check this list on the wiki : https://dwarffortresswiki.org/index.php/DF2014:List_of_creatures_by_pet_value

You can also add your own custom pets.

So for example if you want to add the ELEPHANT for 5000 coins :

 - Add the reaction in \raw\objects\reaction_petshop.txt :

Quote
[REACTION:BUY_PET_ELEPHANT]
   [NAME:Buy an Elephant (5K Gold Coins)]
   [BUILDING:PET_SHOP:NONE]
   [REAGENT:A:5000:COIN:NONE:INORGANIC:GOLD]
[DESCRIPTION:Cost 5K Gold Coins]   
[SKILL:NEGOTIATION]

- Add the line in your \raw\objects\entity_default.txt (or your custom entity file) :

Quote
[PERMITTED_REACTION:BUY_PET_ELEPHANT]

- Add the line in \raw\OnLoad.init :

Quote
modtools/reaction-trigger -reactionName BUY_PET_ELEPHANT -command [ modtools/create-unit -race ELEPHANT -domesticate -setUnitToFort -location [ 0 0 150 ] -locationRange [ 0 0 50 ] -flagSet [ announce_titan ] ]

- And Voila !


This is my first mod, I'm thinking about working on several shops like this, like an economy mod.
I like to craft COINS, but there is no use for these items in DF.

Tell me what you think, if you have some ideas for example !

Hope you enjoy ! :)
« Last Edit: May 10, 2020, 01:43:53 am by KassaK »
Logged

Iä! RIAKTOR!

  • Bay Watcher
    • View Profile
Re: [47.X] Pet Shop : Buy pets with gold coins !
« Reply #1 on: May 09, 2020, 10:13:05 pm »

Do you know how make script that automatically read CREATURE type from item (PET, VERMIN, REMAINS, FISH, FISH_RAW and EGG has CREATURE:CASTE as material data) and one reaction may be used for all types of vermins reanimation? I want back spiders to live after they were killed by cats.
Logged

KassaK

  • Bay Watcher
    • View Profile
Re: [47.X] Pet Shop : Buy pets with gold coins !
« Reply #2 on: May 09, 2020, 11:27:24 pm »

I'm new to modding, so no sorry I don't understand what you need !
Logged

Iä! RIAKTOR!

  • Bay Watcher
    • View Profile
Re: [47.X] Pet Shop : Buy pets with gold coins !
« Reply #3 on: May 10, 2020, 03:15:11 am »

I'm new to modding, so no sorry I don't understand what you need !
Meph can help you.
Logged

Ziusudra

  • Bay Watcher
    • View Profile
Re: [47.X] Pet Shop : Buy pets with gold coins !
« Reply #4 on: May 10, 2020, 03:33:17 am »

I'm new to modding, so no sorry I don't understand what you need !
Meph can help you.
Except Meph is a bit busy, currently.
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.