Sign in to follow this  
joedobo

[ABANDONED] more farm crops

Recommended Posts

I want to add more farm crops for all herbs, spices, berries, mushrooms, fruit, nuts and maybe a few custom things from my mods. Take note, Wurm is a fantasy game for me, so I have no problem with say oranges or pine nuts coming from a small farm plant instead of a tree. The following list is the plan at this point to do it. Am I forgetting anything? Finally, I likely won't make a release for this and it will stay as WIP. I'll share the progress and code on github. I just don't want to try and maintain something that appears like it'll be a hassle.

 

project on GitHub: https://github.com/Joedobo27/AddFarmCropsMod

 

1. Use byte code to add new farm TILE_FIELD objects to the Tiles.Tile enum. The following thread explains how to do that. I may be able to also do it with the JA CodeConverter: 

 

2. Overwrite Crops.getTileType() method to add code to handle identifying TILE_FIELD3, TILE_FIELD4 ... etc.

 

4. Add new crops entries to the Crops.cropTypes field. Given that the field is a final Array in WU, I made my own Crop[] array in the mod, used reflection to invoke and fill that array with Crop instances and finally use JA code converter to redirect all accessor of the original array to instead use my new Crop[] array.

 

5. Either add new seed items for each new crop or make it so the item itself can be planted. For the latter its just adding ITEM_TYPE_SEED flag to each item template. 

 

6. Overwrite Crops.encodeFieldData() so the final value is converted with:   "value Modulo 16", instead of "cropNumber & 15"

 

7. modify Action.getBehaviour() so the TileFieldBehaviour.class and its behaviourProvider work with the new farm tiles.

 

8. Overwrite Crops.getCropNumber() method to add code to handle identifying TILE_FIELD3, TILE_FIELD4 ... etc.

 

9. Modify Terraforming.harvest() so it knows what to do with the new field tile types.

 

10. Modify the CropTilePoller so all its methods know how to work the new field tile types.

 

In the client...

1. modify the Tiles.Tile enum in order to add the same thing that was added to server. 

 

2. tile sprites. (other then the fact they need to be made I don't know what else needs to be done to make this step work).

Edited by joedobo
more steps needed added.
  • Like 1

Share this post


Link to post
Share on other sites

Good luck with this joe, always great to see more of the 'survival' aspect of Wurm, including more crops.

Share this post


Link to post
Share on other sites

Cocoa beans and raspberries?  Those would be awesome to be able to plant, if it can be done!  :-D

Share this post


Link to post
Share on other sites

Raspberries became plantable in WO now.

Share this post


Link to post
Share on other sites

Definitely add plantable cocoa beans, i was looking earlier at marzipans, the only thing missing would be almonds, possible to add almonds? 

Share this post


Link to post
Share on other sites
3 hours ago, Cecci said:

Raspberries became plantable in WO now.

Isn't that as a bush which is subject to WO very limited seasonal harvesting and considerably less yield compared to farming?

 

 

@thread...

People seems to like this so maybe I'll make a release. Although, I wonder what folks will think when they see my very bad art skills. The plants you see coming out of the ground is a crop sprite. I'd have to make them for all the new things. Right now I'm think about doing the sprites like this (that is a Calabash plant and below is WU default wheat):

QBpkBP2.png

 

Black beans, chickpea, peanut...lots of room. Way more room then I thought was in WU.

specifically TILE_FIELD2 is at 43 and TILE_TREE_BIRCH is at 100. Each new farm tile can support 16 more crops. There are potential conflicts that likly will happen as CC adds new tiles. But I could just move things around again.

  • Like 1

Share this post


Link to post
Share on other sites

Go ahead mate, whatever we can do to expand the game will be good for it, in the long term. 

Share this post


Link to post
Share on other sites

Oh my, what a hassle!

 

Latests problem is the new tiles(TILE_FIELD3 at 44, TILE_FIELD4 at 45) don't appear to be supported. I'm wondering if the client also needs to be modded to support new tile additions. Could be an error on my part I missed somewhere. 

 

I put my progress on a GitHub. There is no release. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this