RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[1.0] Harvest System 1.4

David

Moderate
[1.0] Harvest System 1.4

Summary:
Renewable Harvestable Plants and Crops.
Cotton, Flax, Wheat, Corn, Carrots, Onions, Garlic, Lettuce, Cabbage, Apple, Peach, Pear, Coconut, Banana, Mandrake, Nightshade and Ginseng.

1.0 Notes:
This system works under RunUO 1.0. As such I am moving it from Archives to Submissions. (I am in the process of doing that for all my archived scripts.) However it was an early script for me and I am not very happy with it from a coding or shard balancing point of view. There is at least one variation to this in the pre-1.0 script archives which I would encourage you to look at as well. A full re-write of this system is planed when RunUO 2.0 is released. - David 05/05/06

Description:
Version 1.4:
Tested on Beta 36, should work on future and recent past Beta’s as well. Note that as of Beta 36 the food items Wheat and Corn are not yet in the RunUO distribution. Currently Wheat and Corn crops return bread items. All scripts included use a new Namespace Server.Items.Crops this should minimize the impact of changes in Beta releases.

This is a renewable crop growing system. Crops include Cotton, Flax, Wheat, Corn, Carrots, Onions, Garlic, Lettuce, and Cabbage. Trees include Apple, Peach, Pear, Coconut, and Banana. Harvestable Reagents include Mandrake, Nightshade and Ginseng. Players may plant crops on any furrowed ground, other land tiles may be allowed by editing CropHelper.cs. Trees are planted by GM's pretty much anywhere. Reagents are designed to be placed by spawners in the wild.

Crops start as seeds, which may be bought from a Farmhand (included.) The player double-clicks the seed while in his/her pack and after a check of surrounding tiles, it is planted in the spot they are standing. With the exception of Lettuce and Cabbage, crops may not be planted too densely. A seedling sprouts right away. After a period of 10 to 30 minutes the seedling either turns into a crop or a weed based on a random chance against the sower's Lumberjacking skill. If a seedling does become a weed, the sower may pull it up right away, or anyone may after three hours. Once grown, the crop begins with a yield of zero, after ten minutes the yield will quickly raise to the crops maximum capacity. Maximum yield varies; ten for Cotton and Wheat, six for Carrots and Onions, three for Corn, and one for Lettuce and Cabbage. Crops may be harvested by anyone, to do so the player double-clicks the crop. Based on Lumberjacking skill, the sower may gather from zero to current yield with each attempt, others from zero to half the current yield. Another attempt may be made after three seconds. If an attempt to harvest the crops is made while the current yield is zero, the Player is presented with the option to destroy the crop (unless it was planted by a GM or better.) seedlings, partial crops, and full crops each have their own graphics.

GM's plant trees as saplings. [Add Applesapling, [Add Peachsapling, [Add Pearsapling. Saplings grow into a fruit tree three hours later and then produce fruit similarly to crops. Players may double-click a fruit tree to gather fruit up to the maximum yield of 12. Players may also chop down the tree to gather up to ten logs and up to 24 fruits. If chopped down, a stump remains for one hour, then sprouts a sapling and three hours later another fruit tree. In the TreeHelper.cs file there is a TreeOrdinance Boolean switch which by default is false, if true chopping a fruit tree in a guarded region is a criminal offense. There are two special tree types, BananaTree and CoconutPalm which bear fruit but are not choppable. GM's add these directly, no saplings.

Three types of reagents may also be harvested from the following plants; NightshadePlant, MandrakePlant, and GinsengPlant. These plants are intended to be placed by spawner in the wild. They can be hard to see, players will have to look for them. When found, a player stands next to the plant and double-clicks it. As in the other crop types there is a check against the Lumberjacking skill, at zero the player has a 20% chance of picking the plant and at eighty a 100% chance. If the check fails the player may try again in three seconds. The code is commented if you wish to remove the check. Once the player picks the plant, they will have an Uprooted Plant in their pack. Using a knife on an Uprooted Plant will produce between zero and four of the final reagent.

Changes from version 1.3:
* If the sower’s character is deleted, the next character to attempt to harvest the crops will be designated as the sower. This eliminates a potential shard-crashing bug.
* Added several Boolean switches at the beginning of the CropHelper.cs file. These switches are detailed below.
* CanGrowFarm, CanGrowDirt, CanGrowGround, CanGrowSwamp, CanGrowSand: These switches determine where on the map a Player may plant a seed. CanGrowFarm represents furrowed ground and is the only one that defaults to true. In addition, one more switch, CanGrowGarden will allow a Player to plant on ground tiles (Item 0x32C9 ) placed by GM’s or frozen into the Map. This will allow for the addition of garden deeds.
Note that CanGrowGarden defaults to false in CropHelper.cs but is overridden as true in each Crop script. This was done to demonstrate how the defaults can be changed per crop type. Net result is CanGrowGarden is allowed.
* A new setting SowerPickTime defaults to 14 days. If the sower does not harvest a crop within that time, the crop is destroyed on the next non-sower successful harvesting, unless the sower’s AccessLevel is GM or better. Setting SowerPickTime to TimeSpan.Zero will disable this check.
* If PlayerCanDestroy is set to true, when a Player attempts to harvest from an empty Crop they are presented with the opportunity to destroy the Crop, unless the sower is a GM or better.
* A little further down in CropHelper.cs (line 61) you will find the Boolean switch CanWorkMounted. This determines if a mounted Player may sow seeds, pull weeds, and harvest crops. CanWorkMounted defaults to false.
* TreeHelper.cs has a similar switch CanPickMounted which defaults to true. This switch affects picking fruit from any tree.
* If picking fruit from trees while mounted is allowed, the Player has a 20% better chance of gathering fruit while mounted.
* There are no changes to reagent plants in this version.

Planned Enhancements:
Planned for the next version are deeds for Garden plots placeable by Players and an easier to configure more consistent method of skill checking.

Coments, Questions, and Bugs are always welcome.
enjoy!

Installation:
Extract these files into your custom scripts folder. I suggest creating a new folder such as Scripts\Custom\Harvest.

Place a FarmHand in the fields to sell seeds. Otherwise read the description above.
 

Attachments

  • Harvest14.zip
    45.4 KB · Views: 2,192

David

Moderate
I reposted this from the earlier thread because it had some good suggestions which I did not want to get lost in case the old threads are wiped. Some of these ideas will make it into the next revision.

thanks DeepFreez ;)
DeepFreez said:
Been toying around with this scropt. Very nice.

There are a few suggstions I would like to make tho.
  • The properties that are available to GMs need a bit fleshing out I think. For seedlings, you only have read access tot he sower. It would be nice to be able to set this, so that a GM could plant seedlings and transfer ownership
  • There is no way to advance the growing time for a seedling or a tree (or crops for that matter) I understand that the reason for this is because you start up a timer when the seedling is planted or deserialized and replace the seedling with a crop plant when the timer expires. This means you cant change the timer afterwards.
    If you change the timing mechanism to something like this, it would behave the same and add the ability to change the timer:
    The timer periodicaly checks a property: GrowTime. If the current time is bigger or equal to this time, the sapling, seedling, crop etc does its growing.
    Now you can give the GMs access to the GrowTime property to allow them to edit it. The price you pay for this is that you have timers that generate events every now and then, instead of only one timer that does the job. If you give your timers a realy low priority and make it only check, say every minute, this impact should be minimal.
  • You could save a lot of code duplication by making a BaseSeed, BaseSeedling and BaseHarvestable that all derive from BaseCrop. Each of these would then implement the all methods that seem to be duplicated for every crop. The differences between WheatCrop and FlaxCrop then become parameters that only need to be set in the constructor. Save you some debugging in the end and make it more extensible. Also the UpRootGump will only need to know about BaseCrop and not every single crop type.
  • It would seem that it is possible to get an infinate harvest from one seed. Perhaps add an absolute maximum amount that can be harvested over time, based on the skill of the planter? As it is now, one will quickly find that the market is flooded with carrots because every one has access to an infinate amount by planting one seed.
  • For the sake of balance, make a requirement for planting or harvesting crops that the farmer has a tool, like a shovel or a pitchfork. Make it so that this tool has a limited number of uses (like other tools) so that the farmer has some running costs aswell
  • It would be nice to use the BeginAction and EndAction mechanism on harvesting, to preven people from farming AND practicing something else at the same time. (lots of macro abuse potential otherwise)
  • The fact that you have random chance of planting something with 4 crops close by, means that you can stil plant solid blocks of crops if you have a bit of patience. Not sure if this was your intention, but it makes that check rather redundent.
  • Lastly, it might be nice if you allowed for some one to get some seeds off their crops. Perhaps do a check based on skill when they uproot the crop. If the skill is over 80% they have a 10% chance of getting a seed. up to 100 skill where they have 30% chance of getting a seed. Imortant principle here is to not give more seeds than was planted originaly unless they have VERY high skill. Otherwise you will have the market flooded with seeds again [/list:u]

    Ok, I'll end my rather longwinded post now :twisted:
 

nerun

Sorceror
It is OSI accurate? Lumberjacking is the corrected skill check?

If a player has lumberjack 0, the player looses the plant (plant dissapear)?
 

KillerBeeZ

Knight
small bug but nasty for players

one thing I noticed that could use a bit of work is in the tree helper, if you set it so it is a crimminal act to chop a fruit tree, and you plant any fruit trees in town, players who try to chop a tree get guard whacked without the normal warning you get before doing anything illegal, In Trammel too.

I warned all the players on the shard using a news gump, but many people don't read that, and while I'm all for allowing players to get whacked if they don't bother reading, its still not a nice thing to have happen to a newbie in Trammel Britain (or anywhere for that matter).

I don't remember what version I'm using but I'm fairly sure its not this new one.

If this new one fixed that no warning problem, then please disregard this post.

Either way and in any case, this really is a nifty system and have been using it for quite some time.

I haven't noticed any bugs (aside from not being warned) but I have disabled the cotton and flax as they can break a shard if your not careful.

Great Work! I hope to see more soon.
 

David

Moderate
I am going to do a maintenance release soon then sometime later a complete rewrite. You are right, it should certianly have a crim warning. I will look at that for the maintenance release. Thanks for the feedback.

BTW, any suggestion/comments on the issue of cotton and flax?
 

Voran

Wanderer
Maybe a much higher chance of the plant dying when not planted by a GM? Or possibly only GMs can plant them.
 

nix4

Wanderer
I've been using this system for months and its great..I modified the wheat plant to give wheat bundles now that the wheat.cs script is out there and downloadable so now its possible to make dough from wheat.

I suggest if you heavy comment the part where the chance of being a weed when planted. That way people can adjust it to their liking (I like it as it is myself).

Everything in RunUO has a default weight of 1 stone? I noticed that spools of thread are 1 stone? thats like 1.4 lbs isnt it? Seems heavy to me.

How about the ability for players to buy and plant their own trees?
 

Carthage

Wanderer
nix4 said:
I've been using this system for months and its great..I modified the wheat plant to give wheat bundles now that the wheat.cs script is out there and downloadable so now its possible to make dough from wheat.

I suggest if you heavy comment the part where the chance of being a weed when planted. That way people can adjust it to their liking (I like it as it is myself).

Everything in RunUO has a default weight of 1 stone? I noticed that spools of thread are 1 stone? thats like 1.4 lbs isnt it? Seems heavy to me.

How about the ability for players to buy and plant their own trees?

That's a very cool idea nix4, but players have a way of ummm how should I say this abusing things they aren't suppose to.... I dunno about you, but I'd rather answer a page to plant a tree for a player then answer a ticked off plyer who had his/her front door turned into sherwood forrest :)
 

nix4

Wanderer
easy to fix different ways..1) only allow trees in soil tiles like you do for seeds.
2) if you allow trees anywhere then have a tile check around it to see if they are x tiles from a non grassy object..and if they are...say that it needs more room to grow...
 

nix4

Wanderer
Yeeehaw! get along little seedlings! rollin rollin rollin keep those seedlings rollin!...*ahem* nm...
 

KillerBeeZ

Knight
David said:
I am going to do a maintenance release soon then sometime later a complete rewrite. You are right, it should certianly have a crim warning. I will look at that for the maintenance release. Thanks for the feedback.

BTW, any suggestion/comments on the issue of cotton and flax?

YAY I can connect again (EV1 server was down for a bit)

Ok, about cotton/flax

2 things may work well for this

1) limit the number they can get
2) large chance of destroying the crop

Lets say they can get up to 6 flax/cotton then they have to wait maybe a real day or 3 to pick more, and as they are picking, maybe a 25% chance each time to destroy it.

Its just a balance issue really.
 

KillerBeeZ

Knight
nerun said:
Instead of Lumberjacking, is not Herding a better skill to plant?

While Hearding is a less used skill, it really has nothing to do with farming.

Maybe though it can be made into a secondary skill.

Lumberjacking for being able to pick the plant, Hearding for the amount you get each time.
 

David

Moderate
Plus, all I do in these scripts is check the skill. There is no gains associated with harvesting plants. Since most everyones Hearding will be close to zero, no one would be able to pick anything. *rubs chin* hmmm that would solve the castle from flax problem though... :)
 

KillerBeeZ

Knight
David said:
Plus, all I do in these scripts is check the skill. There is no gains associated with harvesting plants. Since most everyones Hearding will be close to zero, no one would be able to pick anything. *rubs chin* hmmm that would solve the castle from flax problem though... :)

that might work.

Perhaps make it so you need upwards of 90+ lumberjacking and 90+ herding to pick flax or cotton (should be more skill for flax because flax is lighter and easier to carry)

It could be the other way around from what I said, Herding to be able to pick and lumberjacking for the amount.

Also, how hard would it be to make it so they can actually gain from harvesting?
 

David

Moderate
I am intending to add skill gain to the rewrite of the entire system. However, maybe requiring 90 skill in Tailoring to pick flax or cotton would make more sense. (That check would not result in skill gain.)

Currently the plants have to be harvested by the sower at least once every two weeks or they wither. My thoughts are to add a maximum lifetime yield to each crop. Since most crops yield up to 10 items at a time, I was thinking 1000 as the default value. Is that too high, too low, or about right?
 

Greystar

Wanderer
I thought about doing this, but lumberjack didn't seem entirely right, too bad they dont just have a farming skills, since OSI is now letting players grow plants and what not, wouldnt that be the next logical step instead of adding a new world, but anyway... I was contemplating using Alchemy (sp) instead. Since it might take a BIT if alchemy to treat fields that may be infested with certain rodents AND maybe being able to "mix" a "special" fertilizer using "dung" since its in the code already and maybe some other of the reagents. hell even volcanic ash is very nutrient rich for plants and is often added to soil as soon as you reduce sulfur content, but anyway... just a thought.. One I am considering when i decide to add this to my Shard.
 

KillerBeeZ

Knight
David said:
I am intending to add skill gain to the rewrite of the entire system. However, maybe requiring 90 skill in Tailoring to pick flax or cotton would make more sense. (That check would not result in skill gain.)

Currently the plants have to be harvested by the sower at least once every two weeks or they wither. My thoughts are to add a maximum lifetime yield to each crop. Since most crops yield up to 10 items at a time, I was thinking 1000 as the default value. Is that too high, too low, or about right?

I personally think 1000 is too much, but other might not... the best thing I can say there is make it easily edited.

Imagine this. Player buys a flax seed for what? 500 gold? then they get 1000 total out of it.. thats around 50,000 gold from 1 seed. More than any farmer I know makes in a year from just 1 seed.

I'm thinking a max of 250 or so, least thats more around 12k still a bit high, but better than 50k. I say calculate how much money players can make off each crop, and balance it by making it so players can get a max number of crops based on the price of the crop.

Like, each seed you plant will give any number of crops that will add up to say 5k (or less) over a real week, thats 5000 cropts that give 1 gold, 2500 crops that give 2 gold and so forth.
 
Top