I found a little solution to grow it faster, but there is this problem with that decay of crops. (disappear)
Now here is my actually script, i´m not the best in object oriented programming so these Torque 3D is new for me since the day before yesterday
(But im good with PHP and Javascript or Jquery but anyway.. )
In this script i´m not really use objects i only use functions.
I have to read some ebooks and references about Tourque 3D and try this script. It works fine on my dedicated Server.
Code
create a new file for example "myScript.cs" and place it in your main directory where your main.cs is located. Than open your main.cs and add this to the top
- Code: Select all
exec("myScript.cs");
Then open myScript.cs and copy this in it. (If you dont like the names of the function you can change it of Course, i just use it because i dont know if the game has functions with the exsiting names that i will overwrite if i use other names )
- Code: Select all
// Grow all crops and start the schedule again
function nvaGrowAll(%time){
// Growfunction from life is feudal (i hope)
stretchedGrowStart();
centerPrintAll("Pflanzen wachsen lassen",5);
echo("Grow Plants \n");
// start schedule again
nvaStart(%time);
}
// use this to start the grow faster
// time is in miliseconds
// 30000 = 30 sec.
function nvaStart(%time){
// clear timer to be safe
nvaStop();
// set the schedule in the global var $nvaInterval to cancel it
$nvaInterval = schedule(%time, 0, "nvaGrowAll", %time);
echo("setSchedule...");
echo("Time = ");
echo(%time);
}
// to stop this function
function nvaStop(){
cancel($nvaInterval);
}
// start this functions automatically
nvaStop();
// repeat every 2 min. i know its really fast you can change it of course
nvaStart(120000);
FYI here i found all functions and classes from life is feudal
Classes
http://pastebin.com/tqhixQq9
Functions
http://pastebin.com/c3Eb3QPF
so now to understand how this crops work in database i have to explain what i have found.
How plants are grow ?
Crops(plants) are grow in 8 Levels.
if you plant a seed it will have Step 1.
Then it depends on your server <dayCycle> in your config.
I use 0.5 as example (1 ingame day need a 0.5 real time hour -- 30 min.)
Every ingame day the crops will go up 1 Step.
On Step 8 it is ready for your sickle
I read that it needs 1/3 of the time it grows to disappear.
In my test it is on step 12 see in the image link...
A Picture of my test what can explain it a little bit (i hope)
http://envalee.de/lif/img/cropLevels.jpg
There you can see some database values and that the crops change the substance if the levelFlag goes over 96 ( or 100).
It start from the top when you set the seed.
I used wheat and the seed have the substance 101 OR 102 when you will plant it. ( I dont know why... maybe the rotation or something depends on placement)
After 30 min. the crops level up to "32" and so on...
Every Level up will create a new Database entry instead of update it
After the substance 102 goes over 96 (or 100) with the levelFlag it will change the substance + 2 (=104) and also change the displaystyle in game that you can see it grow.
Databse tables
Used Tables from the DB are
geo_patch
terrain_blocks
in the geo_patch are the fields you created and all crops with there level (state)
What terrain_blocks tabel is for i haven't found yet. Maybe someone can explain ?
What i want to do ?
I want to deny the cropdecay (disappear) or change the time that it needs more time (much more...) to disappear.
I tried to change some database values before the grow functions starts but only the change in Database have no effect.
I Think that this function of disappear is in another script and what i really hope is that this not need to change something on the client side
If there is some out there who want to speed up the grow time and change the disappear time, then maybe this can be the beginning of that mod
I would be really happy if someone can help me
btw - sorry for mybe bad english i´m from germany