[MOD] Improved Soil Quality - Plantations and Hydroponic Farms
#1
[MOD] Improved Soil Quality (design/cheat)

--I Used Uberworkers by Wowiwankenobi as template for this Mod. (I'm a total noob and could not have made this on my own.)

I made this mod because I wanted to have more control over the design of my Island. This mod will allow you to improve the soil quality for farms and Hydroponic Farms and give you more freedom to choose where to place these fields on your Island.((I tried to make this into an upgrade for the palace but after two day of doing every thing I could think of this is the best I could come up with. )) - fixed thanks to DarthPresidente

Use only one version of the mod, either the plantation or the palace not both.

Upgrade added to Plantations and Hydroponics Farms

There are two versions, one sets the price for each upgrade to $25,000 (makes it feel as less of a cheat). The other version is set to $1,000 for each upgrade. Both add 50 to the location bonus across the map for that type of crop and bonus of 10 effectiveness to that plantation . It may take a couple of seconds for the values to change.

Download Here Upgrade cost $25,000
Download Here Upgrade cost $1,000

Place in "CommonLua" folder

Upgrade added to Palace

This version of the mod adds a single upgrade to the palace that effects all crop types. Again props to DarthPresidente for the code

There are three versions in each file effectiveness from 50, 100, 150 use only one.

Download Here Upgrade cost $100,000
Download Here Upgrade cost $1,000

Place in "CommonLua" folder

WARNING!
Using a mod may void eligibility for customer support from the game publisher.


Here are some some low res pictures from my awesome laptop

Original soil quality on Isla Enorme
[Image: http://s1.directupload.net/images/140625/rootw2h9.jpg]

Upgrade on one Plantation
[Image: http://s7.directupload.net/images/140625/2e946pqf.jpg]

Upgrade on Plantation number two
[Image: http://s7.directupload.net/images/140625/ptpz6mhm.jpg]

Upgrade on plantation number three (unnecessary)
[Image: http://s7.directupload.net/images/140625/l3ain3ct.jpg]

If you want to change the values on the mod feel free to mess with them, this is how i was able to come up with this. If you don't have Notepad++ I suggest you get it, makes editing this types of mods simpler. I also tried editing the Ranches to slow down the pasture decay but i cant find what values to edit.
Reply
#2
nice one Smile
Reply
#3
Ooooh nice one! Will definitely add to the collection!

With regards to the pasture decay, I wonder if this is what affects it?

Code:
PlaceObj("Ranch", {
    "Animals",
    "Cattles",
    "Spawn",
    "RanchCow",
    "MinDec",
    5,
    "MaxDec",
    15
  }),

Just a hunch here, I know diddly squat about coding (unless it's genetic code, hehe!).
Reply
#4
(25-06-2014, 07:50 PM)Wowiwankenobi Wrote: nice one Smile

Thank you for your mod

(26-06-2014, 12:08 AM)DrBeast Wrote: Ooooh nice one! Will definitely add to the collection!

With regards to the pasture decay, I wonder if this is what affects it?

Code:
PlaceObj("Ranch", {
    "Animals",
    "Cattles",
    "Spawn",
    "RanchCow",
    "MinDec",
    5,
    "MaxDec",
    15
  }),

Just a hunch here, I know diddly squat about coding (unless it's genetic code, hehe!).

I was thinking that too but my skills are to limited and i can't figure out how to implement it. I got lucky with this mod by taking apart the "Extensive Fertilization" upgrade from the tobacco plantation.

I will keep trying on the ranches because i don't like how the factory farms look, and it's completely unrealistic how quick the pastures decay with the ranches. It's not a desert island it's supposed to be a tropical island with everything needed for the grass/pasture not to die out.
Reply
#5
I slapped together a quick and dirty mod and I'm about to test my theory - if it works, I'll paste the code. Are you ok with Btweak, aka do you use DarthPresidente's Mod Loader?

ETA: I'll be damned, it works! I feel like Jeremy Clarkson when he finally mended something! Big Grin
There's still some decay, but it's really minimal. Soil quality only dropped by 2 over the course of the 3 years I ran the test.

Here's the code snippet, in Btweak format:

Code:
    BTweak("RanchCattle", "Ranch", "MinDec", 0)
    BTweak("RanchCattle", "Ranch", "MaxDec", 1)
    BTweak("RanchGoats", "Ranch", "MinDec", 0)
    BTweak("RanchGoats", "Ranch", "MaxDec", 1)
    BTweak("RanchLlama", "Ranch", "MinDec", 0)
    BTweak("RanchLlama", "Ranch", "MaxDec", 1)
    BTweak("RanchPigs", "Ranch", "MinDec", 0)
    BTweak("RanchPigs", "Ranch", "MaxDec", 1)

ETA 2: If you don't use the Mod Loader (which I highly recommend, since it makes tweaking stuff MUCH easier), here's how the code should look like:

Code:
-- Slower Ranch Decay
-- For Tropico 5
-- By yournamehere

OnMsg.DataLoaded = function()
    DataInstances.BuildingTemplate.RanchCattle[DataInstances.BuildingTemplate.RanchCattle:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchCattle[DataInstances.BuildingTemplate.RanchCattle:FindIndexOfClass("Ranch")]["MaxDec"] = 1
    DataInstances.BuildingTemplate.RanchGoats[DataInstances.BuildingTemplate.RanchGoats:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchGoats[DataInstances.BuildingTemplate.RanchGoats:FindIndexOfClass("Ranch")]["MaxDec"] = 1
    DataInstances.BuildingTemplate.RanchLlama[DataInstances.BuildingTemplate.RanchLlama:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchLlama[DataInstances.BuildingTemplate.RanchLlama:FindIndexOfClass("Ranch")]["MaxDec"] = 1
    DataInstances.BuildingTemplate.RanchPigs[DataInstances.BuildingTemplate.RanchPigs:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchPigs[DataInstances.BuildingTemplate.RanchPigs:FindIndexOfClass("Ranch")]["MaxDec"] = 1
end
Reply
#6
(26-06-2014, 02:02 AM)DrBeast Wrote: I slapped together a quick and dirty mod and I'm about to test my theory - if it works, I'll paste the code. Are you ok with Btweak, aka do you use DarthPresidente's Mod Loader?

ETA: I'll be damned, it works! I feel like Jeremy Clarkson when he finally mended something! Big Grin
There's still some decay, but it's really minimal. Soil quality only dropped by 2 over the course of the 3 years I ran the test.

Here's the code snippet, in Btweak format:

Code:
    BTweak("RanchCattle", "Ranch", "MinDec", 0)
    BTweak("RanchCattle", "Ranch", "MaxDec", 1)
    BTweak("RanchGoats", "Ranch", "MinDec", 0)
    BTweak("RanchGoats", "Ranch", "MaxDec", 1)
    BTweak("RanchLlama", "Ranch", "MinDec", 0)
    BTweak("RanchLlama", "Ranch", "MaxDec", 1)
    BTweak("RanchPigs", "Ranch", "MinDec", 0)
    BTweak("RanchPigs", "Ranch", "MaxDec", 1)

ETA 2: If you don't use the Mod Loader (which I highly recommend, since it makes tweaking stuff MUCH easier), here's how the code should look like:

Code:
-- Slower Ranch Decay
-- For Tropico 5
-- By yournamehere

OnMsg.DataLoaded = function()
    DataInstances.BuildingTemplate.RanchCattle[DataInstances.BuildingTemplate.RanchCattle:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchCattle[DataInstances.BuildingTemplate.RanchCattle:FindIndexOfClass("Ranch")]["MaxDec"] = 1
    DataInstances.BuildingTemplate.RanchGoats[DataInstances.BuildingTemplate.RanchGoats:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchGoats[DataInstances.BuildingTemplate.RanchGoats:FindIndexOfClass("Ranch")]["MaxDec"] = 1
    DataInstances.BuildingTemplate.RanchLlama[DataInstances.BuildingTemplate.RanchLlama:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchLlama[DataInstances.BuildingTemplate.RanchLlama:FindIndexOfClass("Ranch")]["MaxDec"] = 1
    DataInstances.BuildingTemplate.RanchPigs[DataInstances.BuildingTemplate.RanchPigs:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchPigs[DataInstances.BuildingTemplate.RanchPigs:FindIndexOfClass("Ranch")]["MaxDec"] = 1
end

This is great i'll try it out later today and i'll definitely give mod loader a try.

You should post this to it's own thread, there are probably others looking for something like this.
Reply
#7
If anyone wants to package it up as a mod and release it, go right ahead. I don't even want credit for it. Plus, I have extremely low tolerance for people who will come whining that it's a cheat and doesn't contribute anything to the game Tongue
Reply
#8
(25-06-2014, 07:24 PM)LigerZero Wrote: [MOD] Improved Soil Quality (design/cheat)

I tried to make this into an upgrade for the palace but after two day of doing every thing I could think of this is the best I could come up with.

Great idea to flip the soil quality decrease modifier into an increase modifier without the ticks.

I PM'd you the code to make it work on a palace.
Reply
#9
how to make in increase the soil quality of all the ranches is what I am interested in as I was a dairy farmer at one time the soil actually became more fertile over time because of the cow manure
Reply
#10
well if you simply add about 15000 effectiveness to a farm/ranch, you will see... not sure (cant count them all) 500? 1000? cows or whatever in the boxes. and the soil quality will go down in a few minutes I think, but it will still produce more than you can handle Big Grin

and it could be a bit unaesthetic, but you can eat whatever you want... elephants, donkeys, snakes a.s.o...

[Image: http://s1.directupload.net/images/140627/dghh5ggn.jpg]
Reply
#11
(27-06-2014, 06:54 PM)Wowiwankenobi Wrote: well if you simply add about 15000 effectiveness to a farm/ranch

Tried that but set effectiveness to 300, worked well for years until the ranch got wiped out by a tornado. The game would not let me rebuild or replop in the same spot after that.

Took one look at your picture and immediately thought "Black Market Ivory Empire, would make millions". How evil does this make me
Reply
#12
(27-06-2014, 08:11 PM)LigerZero Wrote: ...The game would not let me rebuild or replop in the same spot after that...

Sounds like you're running v1.02. Upgrade to v1.03, that will solve this bug (which was introduced by v1.02, incidentally).
Reply
#13
Yes I made that personal mod before 1.03, If its no longer a problem i will try it again. thanks for the info
Reply
#14
I think if you use it with the soil quality mod it shouldnt be a problem anymore...
Reply
#15
Just replicated the problem, setup several cattle ranches effectiveness 10,000 let one be destroyed by pirates and was not able to rebuild because of "not enough pastures in the area", when i looked to the ranch next to it the location bonus was at -188. I am still trying to find a ways to edit the ranches in the game.

Weird i'm having more fun trying to change the game than actually playing it.

I actually spent a couple of minutes seeing if I could make ivory into a possible trade resource in the game.
Reply
#16
(27-06-2014, 10:13 PM)LigerZero Wrote: Just replicated the problem, setup several cattle ranches effectiveness 10,000 let one be destroyed by pirates and was not able to rebuild because of "not enough pastures in the area", when i looked to the ranch next to it the location bonus was at -188.

Have you implemented the no soil degrade snippet I posted? Like Wowi said, if you only up the Effectiveness they'll destroy the soil quality in no time.

(27-06-2014, 10:13 PM)LigerZero Wrote: I am still trying to find a ways to edit the ranches in the game.

I'll buy you a virtual beer if you can adapt this mod to ranches! Big Grin

(27-06-2014, 10:13 PM)LigerZero Wrote: Weird i'm having more fun trying to change the game than actually playing it.

Welcome to the wonderful world of modding. Enjoy your OTD (Obsessive Tweaking Disorder) Wink
Reply
#17
(27-06-2014, 10:22 PM)DrBeast Wrote: Have you implemented the no soil degrade snippet I posted?

Yes i'm using the code you posted, took it out to see if i could replicate the inability to rebuild problem that i had.

I expected to have some people jumping at me for making a cheat mod by now, seeing it all over other threads.
Reply
#18
So did you add the no soil degrade to your linked mod in the first post?
Reply
#19
(28-06-2014, 08:06 AM)cwjakesteel Wrote: So did you add the no soil degrade to your linked mod in the first post?

No that mod was all DrBeast and i didn't contribute anything to it. Even though DrBeast said it's alright to post it it doesn't feel right.

Copy one of the versions DrBeast posted to a text file and rename it to whatever you want, just add a ".lua" at the end of it.

If for whatever reason that doesn't work for you, take an existing mod, delete it's contents and paste DrBeast's mod. After that just hit "save as" (use "save as" that way you wont overwrite the existing mod) and rename it to whatever you want.

If you already know how to do this than sorry for oversimplifying, but someone might stumble on to this later and maybe it will help them out.
Reply
#20
(28-06-2014, 09:10 AM)LigerZero Wrote: No that mod was all DrBeast and i didn't contribute anything to it. Even though DrBeast said it's alright to post it it doesn't feel right.

Copy one of the versions DrBeast posted to a text file and rename it to whatever you want, just add a ".lua" at the end of it.

If for whatever reason that doesn't work for you, take an existing mod, delete it's contents and paste DrBeast's mod. After that just hit "save as" (use "save as" that way you wont overwrite the existing mod) and rename it to whatever you want.

If you already know how to do this than sorry for oversimplifying, but someone might stumble on to this later and maybe it will help them out.

Oh no I am a noob to modding. This mod worked great. What I would like to do is the modify this mod to make it work for ranches too. Do you know how?
Reply
#21
this mod seems great but after going to ww era's the farms (all of them) stop working any ideas?

first time that happens to me
Reply
#22
(29-06-2014, 05:08 AM)cwjakesteel Wrote: What I would like to do is the modify this mod to make it work for ranches too

I still have not figured out how to improve pastures for ranches, trying a couple of things with no success yet.

(29-06-2014, 05:19 AM)tonecas99 Wrote: this mod seems great but after going to ww era's the farms (all of them) stop working any ideas?

Went trough a couple of quick sandbox games and both the palace and plantation mods worked fine independently. Then i thought of placing both mods in and the plantations stopped producing.

Do you have both versions of the mod loaded and if not how did the plantations stop working, or are you talking about having Hydroponic Farms in the world wars era and if so are you using a mod to get them early in the game.

Have to leave out of state in a couple of hours if i think of anything else post later if not i'll be out for a couple of days. Try using another version of the mod and see if you can replicate the problem.
Reply
#23
(29-06-2014, 07:02 AM)LigerZero Wrote: I still have not figured out how to improve pastures for ranches, trying a couple of things with no success yet.


Went trough a couple of quick sandbox games and both the palace and plantation mods worked fine independently. Then i thought of placing both mods in and the plantations stopped producing.

Do you have both versions of the mod loaded and if not how did the plantations stop working, or are you talking about having Hydroponic Farms in the world wars era and if so are you using a mod to get them early in the game.

Have to leave out of state in a couple of hours if i think of anything else post later if not i'll be out for a couple of days. Try using another version of the mod and see if you can replicate the problem.

when i place it they auto produce 1 time after that they stop producing (normal farms) and i have both mod installed they simple stop
Reply
#24
(29-06-2014, 01:02 PM)tonecas99 Wrote: i have both mod installed they simple stop

Use only one either the palace or the plantation mod, you might need to start a new game let me know if it happens again.

hopefully there are no other problems i'll be out for a couple of days.
Reply
#25
This mod, must be in patch 1.04 Wink
Thank you!
Reply
#26
If you build too many plantages the positive effect will go negative. If this happens, destroy nearly all plantages, and leave only 1 or 2, so the soil may raise again.

There seems to be a problem if the quality is TOO good, I built about 6 planatges and upgraded the soil quality, after that the grid overlay for abnanas was red on the entire island. I destroyed 5 of them and it turned to green again
Reply
#27
I've noticed some wonkiness with the tobacco farms, though I've never seen the workers tab disappear. Switching the farm from tobacco to anything else before demolishing it works. Switching from anything else TO tobacco will cause issues (the transition never goes through).
Reply
#28
Excellent little mod. I hope you don't mind but I've used this as the basis of my first attempt at modding.

You can find it at the Tropico 5 Modding Forum and it clearly states it's based on this mod

I've converted it into the Mod Loader format, changed it so that it iterates over tables containing Plantation and Hydroponic farm names.
I've also removed the Increased Effectiveness but added a second upgrade to all plantations called Improved Irrigation that improves the effectiveness and job quality of them by 10 but is only available from the World Wars period onwards.

Also you now can't use the Plantation upgrade until you have research the Sickle and it's all in one nice little file Smile
Reply
#29
(26-06-2014, 02:02 AM)DrBeast Wrote: I slapped together a quick and dirty mod and I'm about to test my theory - if it works, I'll paste the code. Are you ok with Btweak, aka do you use DarthPresidente's Mod Loader?

ETA: I'll be damned, it works! I feel like Jeremy Clarkson when he finally mended something! Big Grin
There's still some decay, but it's really minimal. Soil quality only dropped by 2 over the course of the 3 years I ran the test.

Here's the code snippet, in Btweak format:

Code:
    BTweak("RanchCattle", "Ranch", "MinDec", 0)
    BTweak("RanchCattle", "Ranch", "MaxDec", 1)
    BTweak("RanchGoats", "Ranch", "MinDec", 0)
    BTweak("RanchGoats", "Ranch", "MaxDec", 1)
    BTweak("RanchLlama", "Ranch", "MinDec", 0)
    BTweak("RanchLlama", "Ranch", "MaxDec", 1)
    BTweak("RanchPigs", "Ranch", "MinDec", 0)
    BTweak("RanchPigs", "Ranch", "MaxDec", 1)

ETA 2: If you don't use the Mod Loader (which I highly recommend, since it makes tweaking stuff MUCH easier), here's how the code should look like:

Code:
-- Slower Ranch Decay
-- For Tropico 5
-- By yournamehere

OnMsg.DataLoaded = function()
    DataInstances.BuildingTemplate.RanchCattle[DataInstances.BuildingTemplate.RanchCattle:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchCattle[DataInstances.BuildingTemplate.RanchCattle:FindIndexOfClass("Ranch")]["MaxDec"] = 1
    DataInstances.BuildingTemplate.RanchGoats[DataInstances.BuildingTemplate.RanchGoats:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchGoats[DataInstances.BuildingTemplate.RanchGoats:FindIndexOfClass("Ranch")]["MaxDec"] = 1
    DataInstances.BuildingTemplate.RanchLlama[DataInstances.BuildingTemplate.RanchLlama:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchLlama[DataInstances.BuildingTemplate.RanchLlama:FindIndexOfClass("Ranch")]["MaxDec"] = 1
    DataInstances.BuildingTemplate.RanchPigs[DataInstances.BuildingTemplate.RanchPigs:FindIndexOfClass("Ranch")]["MinDec"] = 0
    DataInstances.BuildingTemplate.RanchPigs[DataInstances.BuildingTemplate.RanchPigs:FindIndexOfClass("Ranch")]["MaxDec"] = 1
end


Thanks, doc! This works and is highly appreciated!

Since you didn't want to make it into a separate mod, I went ahead and did it myself so it's easier to be found and used. Uploaded here: https://tropicomodding.org/viewtopic.php?f=7&t=350

If you don't want that, just say so and I'll remove it.
Reply




Users browsing this thread: 1 Guest(s)