Poll

What you like better?

Dreams
Memes

Author Topic: Farming - Ready to work again, what do I do now?  (Read 39185 times)

 Although the bricks would make them appear nicer than other roads, something has to be done to lower the brickcount. Maybe someone could "combine" the bricks used for the roads, and package it into a single placeable brick? then again, it may take some time. It would at least keep the roads looking nice, and save some space for more bricks on the server.

 I have never made a mod for BL though, the closest to coding I have ever done was when someone helped me with VCE, and when I made custom jobs for a City mod by switching the restrictions of old jobs.
« Last Edit: June 26, 2016, 05:06:17 PM by Killbot Alpha »

Although the bricks would make them appear nicer than other roads, something has to be done to lower the brickcount. Maybe someone could "combine" the bricks used for the roads, and package it into a single placeable brick? then again, it may take some time. It would at least keep the roads looking nice, and save some space for more bricks on the server.

 I have never made a mod for BL though, the closest to coding I have ever done was when someone helped me with VCE, and when I made custom jobs for a City mod by switching the restrictions of old jobs.
contrary to popular belief its not brickcount that lags; its the faces needed to be rendered. having custom bricks totaling 1000 bricks vs one brick isnt that much of a performance difference

contrary to popular belief its not brickcount that lags; its the faces needed to be rendered. having custom bricks totaling 1000 bricks vs one brick isnt that much of a performance difference
While that's true signifgantly lowering your brickcount is sill desirable.

Anyway I got the bigger lots an better lot allocation from the second server, the latest version of the main server, and the pipes all working together. I've only really done an hour's or so work so far but it looks nice.

I now need to recalibrate the crops grow time for rpg mode and add in the storage system.

 Will there be a train? That was probably the best part when I joined the last farming server. Sometimes you'd just sit with 1 other person and have a little chat. It also would get rid of the need for vehicles if you had the train run everywhere/multiple tracks.

 EDIT: Could you post/ PM me some pictures of the server? I want to try to find my build, since I remember building a pretty nice Barn.
« Last Edit: June 26, 2016, 08:21:43 PM by Killbot Alpha »

So I'm going to rewrite the crop growing code. Not only to increase the growing time, but to make the system more regular. Basically before each crop had its own code despite there really only being two different types of crops. So now all crops will have preferences like this that will make changing crops or adding new crops really easy:

Code: [Select]
$farmPref::secondsPerTick = 180;
$farmPref::crops = 8;

//0 - Annual
//1 - Perennial
//2 - Constant

$farmPref::crop::name[0] = "corn";
$farmPref::crop::baseWaterUsagePerTick[0] = 5;
$farmPref::crop::soilBrick[0] = brickDDRPdirtData;
$farmPref::crop::growStyle[0] = 0;
$farmPref::crop::ticksPerStage[0] = 15;
$farmPref::crop::basePrice[0] = 10;
$farmPreF::crop::growStages[0] = 6;
$farmPref::crop::growStage[0,0] = brickDDRPcorn1Data;
$farmPref::crop::growStage[0,1] = brickDDRPcorn2Data;
$farmPref::crop::growStage[0,2] = brickDDRPcorn3Data;
$farmPref::crop::growStage[0,3] = brickDDRPcorn4Data;
$farmPref::crop::growStage[0,4] = brickDDRPcorn5Data;
$farmPref::crop::growStage[0,5] = brickDDRPcorn6Data;
$farmPref::crop::harvestStages[0] = 1;
$farmPref::crop::harvestStage[0,0] = brickDDRPcorn7Data;
$farmPref::crop::deadStage[0] = brickDDRPcorn8Data;

$farmPref::crop::name[1] = "tomato";
$farmPref::crop::baseWaterUsagePerTick[1] = 5;
$farmPref::crop::soilBrick[1] = brickDDRPdirtData;
$farmPref::crop::growStyle[1] = 0;
$farmPref::crop::ticksPerStage[1] = 15;
$farmPref::crop::basePrice[1] = 15;
$farmPref::crop::growStages[1] = 8;
$farmPref::crop::growStage[1,0] = brickDDRPtomato1Data;
$farmPref::crop::growStage[1,1] = brickDDRPtomato2Data;
$farmPref::crop::growStage[1,2] = brickDDRPtomato3Data;
$farmPref::crop::growStage[1,3] = brickDDRPtomato4Data;
$farmPref::crop::growStage[1,4] = brickDDRPtomato5Data;
$farmPref::crop::growStage[1,5] = brickDDRPtomato6Data;
$farmPref::crop::growStage[1,6] = brickDDRPtomato7Data;
$farmPref::crop::growStage[1,7] = brickDDRPtomato8Data;
$farmPref::crop::harvestStages[1] = 1;
$farmPref::crop::harvestStage[1,0] = brickDDRPtomato9Data;
$farmPref::crop::deadStage[1] = brickDDRPtomato10Data;

$farmPref::crop::name[2] = "wheat";
$farmPref::crop::baseWaterUsagePerTick[2] = 5;
$farmPref::crop::soilBrick[2] = brickDDRPdirtData;
$farmPref::crop::growStyle[2] = 0;
$farmPref::crop::ticksPerStage[2] = 15;
$farmPref::crop::basePrice[2] = 12.5;
$farmPref::crop::growStages[2] = 7;
$farmPref::crop::growStage[2,0] = brickDDRPwheat1Data;
$farmPref::crop::growStage[2,1] = brickDDRPwheat2Data;
$farmPref::crop::growStage[2,2] = brickDDRPwheat3Data;
$farmPref::crop::growStage[2,3] = brickDDRPwheat4Data;
$farmPref::crop::growStage[2,4] = brickDDRPwheat5Data;
$farmPref::crop::growStage[2,5] = brickDDRPwheat6Data;
$farmPref::crop::growStage[2,6] = brickDDRPwheat7Data;
$farmPref::crop::harvestStages[2] = 1;
$farmPref::crop::harvestStage[2,0] = brickDDRPwheat8Data;
$farmPref::crop::deadStage[2] = brickDDRPwheat9Data;

$farmPref::crop::name[3] = "potato";
$farmPref::crop::baseWaterUsagePerTick[3] = 5;
$farmPref::crop::soilBrick[3] = brickDDRPdirtData;
$farmPref::crop::growStyle[3] = 0;
$farmPref::crop::ticksPerStage[3] = 15;
$farmPref::crop::basePrice[3] = 7.5;
$farmPref::crop::growStages[3] = 5;
$farmPref::crop::growStage[3,0] = brickDDRPpotato1Data;
$farmPref::crop::growStage[3,1] = brickDDRPpotato2Data;
$farmPref::crop::growStage[3,2] = brickDDRPpotato3Data;
$farmPref::crop::growStage[3,3] = brickDDRPpotato4Data;
$farmPref::crop::growStage[3,4] = brickDDRPpotato5Data;
$farmPref::crop::harvestStages[3] = 1;
$farmPref::crop::harvestStage[3,0] = brickDDRPpotato6Data;
$farmPref::crop::deadStage[3] = brickDDRPpotato7Data;

$farmPref::crop::name[4] = "melon";
$farmPref::crop::baseWaterUsagePerTick[4] = 5;
$farmPref::crop::soilBrick[4] = brickDDRPbushData;
$farmPref::crop::growStyle[4] = 0;
$farmPref::crop::ticksPerStage[4] = 15;
$farmPref::crop::basePrice[4] = 12.5;
$farmPref::crop::growStages[4] = 8;
$farmPref::crop::growStage[4,0] = brickDDRPmelon1Data;
$farmPref::crop::growStage[4,1] = brickDDRPmelon2Data;
$farmPref::crop::growStage[4,2] = brickDDRPmelon3Data;
$farmPref::crop::growStage[4,3] = brickDDRPmelon4Data;
$farmPref::crop::growStage[4,4] = brickDDRPmelon5Data;
$farmPref::crop::growStage[4,5] = brickDDRPmelon6Data;
$farmPref::crop::growStage[4,6] = brickDDRPmelon7Data;
$farmPref::crop::growStage[4,7] = brickDDRPmelon8Data;
$farmPref::crop::harvestStages[4] = 3;
$farmPref::crop::harvestStage[4,0] = brickDDRPmelon9Data;
$farmPref::crop::harvestStage[4,1] = brickDDRPmelon10Data;
$farmPref::crop::harvestStage[4,2] = brickDDRPmelon11Data;
$farmPref::crop::deadStage[4] = brickDDRPmelon8Data;

$farmPref::crop::name[5] = "blueberries";
$farmPref::crop::baseWaterUsagePerTick[5] = 5;
$farmPref::crop::soilBrick[5] = brickDDRPbushData;
$farmPref::crop::growStyle[5] = 1;
$farmPref::crop::ticksPerStage[5] = 60;
$farmPref::crop::basePrice[5] = 15;
$farmPref::crop::growStages[5] = 6;
$farmPref::crop::growStage[5,0] = brickDDRPblueberries1Data;
$farmPref::crop::growStage[5,1] = brickDDRPblueberries2Data;
$farmPref::crop::growStage[5,2] = brickDDRPblueberries3Data;
$farmPref::crop::growStage[5,3] = brickDDRPblueberries4Data;
$farmPref::crop::growStage[5,4] = brickDDRPblueberries5Data;
$farmPref::crop::growStage[5,5] = brickDDRPblueberries6Data;
$farmPref::crop::adultStages[5] = 2;
$farmPref::crop::adultStage[5,0] = brickDDRPblueberries7Data;
$farmPref::crop::adultStage[5,1] = brickDDRPblueberries8Data;
$farmPref::crop::harvestStages[5] = 1;
$farmPref::crop::harvestStage[5,0] = brickDDRPblueberries9Data;
$farmPref::crop::deadStage[5] = brickDDRPblueberries10Data;

$farmPref::crop::name[6] = "grapes";
$farmPref::crop::baseWaterUsagePerTick[6] = 5;
$farmPref::crop::soilBrick[6] = brickDDRPfenceData;
$farmPref::crop::growStyle[6] = 1;
$farmPref::crop::ticksPerStage[6] = 60;
$farmPref::crop::basePrice[6] = 15;
$farmPref::crop::growStages[6] = 5;
$farmPref::crop::growStage[6,0] = brickDDRPgrapes1Data;
$farmPref::crop::growStage[6,1] = brickDDRPgrapes2Data;
$farmPref::crop::growStage[6,2] = brickDDRPgrapes3Data;
$farmPref::crop::growStage[6,3] = brickDDRPgrapes4Data;
$farmPref::crop::growStage[6,4] = brickDDRPgrapes5Data;
$farmPref::crop::adultStages[6] = 3;
$farmPref::crop::adultStage[6,0] = brickDDRPgrapes6Data;
$farmPref::crop::adultStage[6,7] = brickDDRPgrapes7Data;
$farmPref::crop::adultStage[6,8] = brickDDRPgrapes8Data;
$farmPref::crop::harvestStages[6] = 2;
$farmPref::crop::harvestStages[6,0] = brickDDRPgrapes9Data;
$farmPref::crop::harvestStages[6,1] = brickDDRPgrapes10Data;
$farmPref::crop::deadStage[6] = brickDDRPgrapes6Data;

$farmPref::crop::name[7] = "cannabis";
$farmPref::crop::baseWaterUsagePerTick[7] = 5;
$farmPref::crop::soilBrick[7] = brickDDRPdirtData;
$farmPref::crop::growStyle[7] = 2;
$farmPref::crop::ticksPerStage[7] = 25;
$farmPref::crop::basePrice[7] = 10;
$farmPref::crop::growStages[7] = 10;
$farmPref::crop::growStage[7,0] = brickDDRPweed1Data;
$farmPref::crop::growStage[7,1] = brickDDRPweed2Data;
$farmPref::crop::growStage[7,2] = brickDDRPweed3Data;
$farmPref::crop::growStage[7,3] = brickDDRPweed4Data;
$farmPref::crop::growStage[7,4] = brickDDRPweed5Data;
$farmPref::crop::growStage[7,5] = brickDDRPweed6Data;
$farmPref::crop::growStage[7,6] = brickDDRPweed7Data;
$farmPref::crop::growStage[7,7] = brickDDRPweed8Data;
$farmPref::crop::growStage[7,8] = brickDDRPweed9Data;
$farmPref::crop::growStage[7,9] = brickDDRPweed10Data;

function prepareCropDatablocks()
{
for(%a=0;%a<$farmPref::crops;%a++)
{
if(isObject($farmPref::crop::deadStage[%a]))
{
$farmPref::crop::adultStage[%a].isPlantBrick = true;
$farmPref::crop::adultStage[%a].crop = %a;
$farmPref::crop::adultStage[%a].isGrowingBrick = false;
$farmPref::crop::adultStage[%a].isDeadBrick = true;
$farmPref::crop::adultStage[%a].isHarvestBrick = false;
$farmPref::crop::adultStage[%a].isAdultBrick = false;
}
for(%b=0;%b<$farmPref::crop::growStages[%a];%b++)
{
$farmPref::crop::growStage[%a,%b].isPlantBrick = true;
$farmPref::crop::growStage[%a,%b].crop = %a;
$farmPref::crop::growStage[%a,%b].stage = %b;
$farmPref::crop::growStage[%a,%b].isGrowingBrick = true;
$farmPref::crop::growStage[%a,%b].isDeadBrick = false;
$farmPref::crop::growStage[%a,%b].isHarvestBrick = false;
$farmPref::crop::growStage[%a,%b].isAdultBrick = false;
}
for(%b=0;%b<$farmPref::crop::harvestStages[%a];%b++)
{
$farmPref::crop::harvestStage[%a,%b].isPlantBrick = true;
$farmPref::crop::harvestStage[%a,%b].crop = %a;
$farmPref::crop::harvestStage[%a,%b].stage = %b;
$farmPref::crop::harvestStage[%a,%b].isGrowingBrick = false;
$farmPref::crop::harvestStage[%a,%b].isDeadBrick = false;
$farmPref::crop::harvestStage[%a,%b].isHarvestBrick = true;
$farmPref::crop::harvestStage[%a,%b].isAdultBrick = false;
}
for(%b=0;%b<$farmPref::crop::adultStages[%a];%b++)
{
$farmPref::crop::adultStage[%a,%b].isPlantBrick = true;
$farmPref::crop::adultStage[%a,%b].crop = %a;
$farmPref::crop::adultStage[%a,%b].stage = %b;
$farmPref::crop::adultStage[%a,%b].isGrowingBrick = false;
$farmPref::crop::adultStage[%a,%b].isDeadBrick = false;
$farmPref::crop::adultStage[%a,%b].isHarvestBrick = false;
$farmPref::crop::adultStage[%a,%b].isAdultBrick = true;
}
}
}

prepareCropDatablocks();
« Last Edit: June 27, 2016, 01:02:57 AM by DrenDran »

So now, instead of having code for each crop, you could make a crop, and just copy/paste some code, with a few alterations?

So now, instead of having code for each crop, you could make a crop, and just copy/paste some code, with a few alterations?
Yup.

Compare and contrast the /buy command before:
Code: [Select]
function servercmdbuy(%client,%crop,%amount)
{
if(%amount < 1)
messageclient(%client,'',"\c3You need to enter in a positive number.");
else
{
if(%crop $= "corn")
{
%price = %amount*($currentCornPrice+$farming::cornPrice+2);
if($farming::client::money[%client.bl_id] < %price)
messageclient(%client,'',"\c3You need $\c2" @ %price @ "\c3 to buy that.");
else
{
messageclient(%client,'',"\c3You bought \c6" @ %amount @ " \c3corn seeds for $\c2" @ %price);
$farming::client::money[%client.bl_id] -= %price;
$farming::client::cornSeed[%client.bl_id] += %amount;
}
}
else if(%crop $= "wheat")
{
%price = %amount*($currentWheatPrice+$farming::wheatPrice+2);
if($farming::client::money[%client.bl_id] < %price)
messageclient(%client,'',"\c3You need $\c2" @ %price @ "\c3 to buy that.");
else
{
messageclient(%client,'',"\c3You bought \c6" @ %amount @ " \c3wheat seeds for $\c2" @ %price);
$farming::client::money[%client.bl_id] -= %price;
$farming::client::wheatSeed[%client.bl_id] += %amount;
}
}
else if(%crop $= "melon")
{
%price = %amount*($currentMelonPrice+$farming::melonPrice+2);
if($farming::client::money[%client.bl_id] < %price)
messageclient(%client,'',"\c3You need $\c2" @ %price @ "\c3 to buy that.");
else
{
messageclient(%client,'',"\c3You bought \c6" @ %amount @ " \c3melon seeds for $\c2" @ %price);
$farming::client::money[%client.bl_id] -= %price;
$farming::client::melonSeed[%client.bl_id] += %amount;
}
}
else if(%crop $= "grape")
{
%price = %amount*($currentgrapePrice+$farming::grapePrice+2);
if($farming::client::money[%client.bl_id] < %price)
messageclient(%client,'',"\c3You need $\c2" @ %price @ "\c3 to buy that.");
else
{
messageclient(%client,'',"\c3You bought \c6" @ %amount @ " \c3grape seeds for $\c2" @ %price);
$farming::client::money[%client.bl_id] -= %price;
$farming::client::grapeSeed[%client.bl_id] += %amount;
}
}
else if(%crop $= "tomato")
{
%price = %amount*($currentTomatoPrice+$farming::tomatoPrice+2);
if($farming::client::money[%client.bl_id] < %price)
messageclient(%client,'',"\c3You need $\c2" @ %price @ "\c3 to buy that.");
else
{
messageclient(%client,'',"\c3You bought \c6" @ %amount @ " \c3tomato seeds for $\c2" @ %price);
$farming::client::money[%client.bl_id] -= %price;
$farming::client::tomatoSeed[%client.bl_id] += %amount;
}
}
else if(%crop $= "potato")
{
%price = %amount*($currentPotatoPrice+$farming::potatoPrice+2);
if($farming::client::money[%client.bl_id] < %price)
messageclient(%client,'',"\c3You need $\c2" @ %price @ "\c3 to buy that.");
else
{
messageclient(%client,'',"\c3You bought \c6" @ %amount @ " \c3potato seeds for $\c2" @ %price);
$farming::client::money[%client.bl_id] -= %price;
$farming::client::potatoSeed[%client.bl_id] += %amount;
}
}
else if(%crop $= "blueberry")
{
%price = %amount*($currentBlueberryPrice+$farming::blueberryPrice+2);
if($farming::client::money[%client.bl_id] < %price)
messageclient(%client,'',"\c3You need $\c2" @ %price @ "\c3 to buy that.");
else
{
messageclient(%client,'',"\c3You bought \c6" @ %amount @ " \c3blueberry seeds for $\c2" @ %price);
$farming::client::money[%client.bl_id] -= %price;
$farming::client::blueberrySeed[%client.bl_id] += %amount;
}
}
else if(%crop $= "cannabis")
{
%price = %amount*(15+$currentCannabisPrice+$farming::cannabisPrice);
if($farming::client::money[%client.bl_id] < %price)
messageclient(%client,'',"\c3You need $\c2" @ %price @ "\c3 to buy that.");
else
{
messageclient(%client,'',"\c3You bought \c6" @ %amount @ " \c3cannabis seeds for $\c2" @ %price);
$farming::client::money[%client.bl_id] -= %price;
$farming::client::cannabisSeed[%client.bl_id] += %amount;
}
}
else
messageclient(%client,'',"\c6" @ %crop @ "\c3 is not a valid selection, choices are: potato,tomato,corn,wheat,blueberry,cannabis,melon,grape");
}
}
And after:
Code: [Select]
function servercmdsell(%client,%crop,%amount)
{
if(%amount < 1)
messageclient(%client,'',"\c3You need to enter in a positive number.");
else
{
%theCrop = -1;

for(%q=0;%q<$farmPref::crops;%q++)
{
if(%msg $= $farmPref::crop::name[%q])
{
%theCrop = %q;
break;
}
}

if(%theCrop == -1)
{
messageclient(%a,'',%msg @ "\c6 was not a valid choice.");
%ret = "\c6Valid choices are: ";
for(%q=0;%q<$farmPref::crops;%q++)
%ret = %ret @ $farmPref::crop::name[%q] @ ",";
messageclient(%a,'',%ret);
return;
}

%price = %amount*$farming::server::currPrice[%theCrop];
if($farming::client::seed[%client.bl_id,%theCrop] < %amount)
messageclient(%client,'',"\c3You don't have enough crops/seeds to do that!");
else
{
addCropSold(%theCrop,%amount);
messageclient(%client,'',"\c3You sold \c3" @ %amount @ " \c3" @ $farmPref::crop::name[%theCrop] @ " seed for $\c2" @ %price);
$farming::client::money[%client.bl_id] += %price;
$farming::client::seed[%client.bl_id,%theCrop] -= %amount;
}
}
}

 How will starting out work? Will you just start with cash, and go from there? Or could you have it where you can pick a lot for free (Only 1 lot, Obviously), and when you pick that lot, it loads up a small plot with a 3x3 area of dirt (Maybe with a brick skirting around the dirt to make it look a little nicer, to stop people with red lots/ spammy builds until they have more cash to build), and you get 1 wheat seed, 1 potato seed, & 1 corn seed to start out. Then people wont blow their money all on one thing, and forget that they have to buy seeds/ dirt.
 EDIT: This is what I mean by Brick Skirting if you don't know what I mean:
« Last Edit: June 27, 2016, 06:06:00 PM by Killbot Alpha »

in march 2016 hosting, players started with a number of free dirt blocks and seeds. as for nice fancy blocks, thats likely not going to happen unless theres a revamp with the bricks used for this.

The skirting can be default blocks put together, Also will the server have a colorset/ mods once it is up?
« Last Edit: June 28, 2016, 03:25:33 AM by Killbot Alpha »

I asked Conan if he could take the current crop models I made (corn, potatos, wheat, tomatos, cannabis) and both fix the collision errors so people don't get stuck in them, and separate the crop itself from the soil. This means that not only will the height of the soil no longer change when crops grow, but the color of the plant can be modified so each stage can be shown as dead.

edit: Growing the original types of crops (tomato, potato, corn, wheat) as well as melon now works. I will be opening a passworded test server tomorrow and giving anyone who wants it the password. They will test the new crop growth system and the sprinklers while I work on adding in the other types of crops. That said, the test server won't save your progress permanently.
« Last Edit: June 28, 2016, 03:05:33 PM by DrenDran »

When I'm ready to test the password will be 'meme'

Just wondering, what is the optimal temperature for crops, and the range of heaters/big sprinklers?

 Also, maybe add a calendar, & thermometer brick that allow you to quickly check the day/temperature instead of typing the commands to check.
« Last Edit: June 30, 2016, 07:07:53 PM by Killbot Alpha »

It's 77. Also if you're on the server now sprinklers stop working if you leave.

 I saw that you did that so it would lessen the lag of the server. Nice, it's always that one giant weed farm with 80 sprinklers and 50 heaters being on when unneeded.

 EDITT: You're potatoes trapped me, help.
« Last Edit: June 30, 2016, 07:11:37 PM by Killbot Alpha »