Delete poor quality trees / monthly auto uproot

Place for sharing your game modifications for Life is Feudal: Your Own

Remystemple
 
Posts: 80
Joined: 15 Jan 2015, 22:30

Re: Delete poor quality trees / monthly auto uproot

Post by Remystemple » 09 Feb 2015, 02:47

i must be doing something wrong. i can run it once perfectly but if i try again it makes trees not able to be cut down.


SKuDD3r
 
Posts: 15
Joined: 01 Feb 2015, 19:41

Re: Delete poor quality trees / monthly auto uproot

Post by SKuDD3r » 09 Feb 2015, 20:07

You aren't running that query while your server is up are you? You need to run that when your server is shutdown, or put it in the patch.sql.

If you run that on a live server its bound to break it.


Balax
 
Posts: 40
Joined: 30 Sep 2014, 11:03
Location: Norway

Re: Delete poor quality trees / monthly auto uproot

Post by Balax » 09 Feb 2015, 20:22

No, it's not, atleast not for me. I have done that 10 times atleast. But I have to restart the server for the trees to work properly.

But if you muck about the databases and files it is probably wise to have a mild idea of what you are doing.


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: Delete poor quality trees / monthly auto uproot

Post by Koiecks » 09 Feb 2015, 22:16

I placed mine at the end of my patch.sql
Image


Remystemple
 
Posts: 80
Joined: 15 Jan 2015, 22:30

Re: Delete poor quality trees / monthly auto uproot

Post by Remystemple » 10 Feb 2015, 15:48

yeah i don't do anything without taking the server down first. and adding to patch.sql ? you ran this multiple times using this method? also none of the changes or modifications are very advanced, so i can't see how changing a few container capacities could effect a stump removal script. I did what i was advised last time to drop the forest patch because the script wouldn't run a second time with out multiple trigger error. after running the script as query the forest patch wasn't recreated and had the no cutting trees bug.


Arthenius
 
Posts: 29
Joined: 25 Nov 2014, 09:50

Re: Delete poor quality trees / monthly auto uproot

Post by Arthenius » 13 Feb 2015, 10:24

hello
this script is used on our serveur every morning before server restart since one month without problems..

we also modified container weight in a stored procedure, and i put this script in an other stored procedure

The strump remover stored procedure is called in our modifycontainer stored procedure wich is called in patch.sql file


Remystemple
 
Posts: 80
Joined: 15 Jan 2015, 22:30

Re: Delete poor quality trees / monthly auto uproot

Post by Remystemple » 14 Feb 2015, 05:23

well. i was having trouble getting containers to stay at adjusted levels. someone advised me to delete the patch.sql. i just renamed it but it helped the changes stay. i figured it would create another patch.sql but it didn't. so it looks like a 1 time deal for me. pretty odd tho.


Remystemple
 
Posts: 80
Joined: 15 Jan 2015, 22:30

Re: Delete poor quality trees / monthly auto uproot

Post by Remystemple » 18 Feb 2015, 04:05

Anything else you guys can tell me. i'd like to run this script again, but last time i ran it a second time it made trees unable to be cut down. had to wipe. i ran it when i first started up the new server. the trees are growing back and i know it's only a matter of time till the server gets laggy. i'm trying to figure out how to run it again properly. tried to get a private server going following instructions on utube. it worked but after restarting my computer it doesn't. was hoping to use it as a test server.

User avatar
Razoreqx
 
Posts: 91
Joined: 06 Oct 2014, 13:13

Re: Delete poor quality trees / monthly auto uproot

Post by Razoreqx » 18 Feb 2015, 17:42

Remystemple wrote:Anything else you guys can tell me. i'd like to run this script again, but last time i ran it a second time it made trees unable to be cut down. had to wipe. i ran it when i first started up the new server. the trees are growing back and i know it's only a matter of time till the server gets laggy. i'm trying to figure out how to run it again properly. tried to get a private server going following instructions on utube. it worked but after restarting my computer it doesn't. was hoping to use it as a test server.



Wipe? Backing up your SQL database is almost a must doing this kind of testing. You should never have to wipe a server. Unless you wanted too I guess.
Razors Edge
A Life is Feudal Persistent World
http://razors-edge.org
22 Custom MODS / Custom Graphics models Planned. Visit our Gallery.


Remystemple
 
Posts: 80
Joined: 15 Jan 2015, 22:30

Re: Delete poor quality trees / monthly auto uproot

Post by Remystemple » 19 Feb 2015, 01:06

so no one knows why this script can only be ran once?


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: Delete poor quality trees / monthly auto uproot

Post by Koiecks » 19 Feb 2015, 21:46

This is what I placed at the end of my patch.sql It has been ran and works without messing up the ability to cut trees on my server




Machine wrote:Here's what I used to remove all trees under Quality 80. You can change the quality to whatever you want. When I used it I got an instant fast loading server. It's very helpful if you don't wipe your server often.

There's 3 tables you need to change to remove the trees. The first and second is forest and forest_patch, the both share tree info, but after you remove the trees there, you need to re-index the Version column for each TerID (442-450) and then the last table you need to change is terrain_blocks. In there ForestVersion must have the latest Version from each TerID.

So as an example, if in forest_patch I'm looking at all the entries with the TerID = 442, I would need the largest Version number and put that in as the ForestVersion for ID 442.

Here's the code, you don't need to do anything, just run as query and done. Make sure you backup your database before using this!

Code: Select all
DELETE forest, forest_patch
FROM forest, forest_patch
WHERE forest.GeoDataID = forest_patch.GeoDataID  AND
      forest.Quality < 80;

SET @c442 = 1;
SET @c443 = 1;
SET @c444 = 1;
SET @c445 = 1;
SET @c446 = 1;
SET @c447 = 1;
SET @c448 = 1;
SET @c449 = 1;
SET @c450 = 1;

UPDATE forest_patch
SET Version = @c442:=@c442+1
WHERE TerID = 442;

UPDATE forest_patch
SET Version = @c443:=@c443+1
WHERE TerID = 443;

UPDATE forest_patch
SET Version = @c444:=@c444+1
WHERE TerID = 444;

UPDATE forest_patch
SET Version = @c445:=@c445+1
WHERE TerID = 445;

UPDATE forest_patch
SET Version = @c446:=@c446+1
WHERE TerID = 446;

UPDATE forest_patch
SET Version = @c447:=@c447+1
WHERE TerID = 447;

UPDATE forest_patch
SET Version = @c448:=@c448+1
WHERE TerID = 448;

UPDATE forest_patch
SET Version = @c449:=@c449+1
WHERE TerID = 449;

UPDATE forest_patch
SET Version = @c450:=@c450+1
WHERE TerID = 450;

SET @c442 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 442 ORDER BY TerID);
SET @c443 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 443 ORDER BY TerID);
SET @c444 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 444 ORDER BY TerID);
SET @c445 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 445 ORDER BY TerID);
SET @c446 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 446 ORDER BY TerID);
SET @c447 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 447 ORDER BY TerID);
SET @c448 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 448 ORDER BY TerID);
SET @c449 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 449 ORDER BY TerID);
SET @c450 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 450 ORDER BY TerID);

UPDATE terrain_blocks
SET ForestVersion = @c442
WHERE ID = 442;

UPDATE terrain_blocks
SET ForestVersion = @c443
WHERE ID = 443;

UPDATE terrain_blocks
SET ForestVersion = @c444
WHERE ID = 444;

UPDATE terrain_blocks
SET ForestVersion = @c445
WHERE ID = 445;

UPDATE terrain_blocks
SET ForestVersion = @c446
WHERE ID = 446;

UPDATE terrain_blocks
SET ForestVersion = @c447
WHERE ID = 447;

UPDATE terrain_blocks
SET ForestVersion = @c448
WHERE ID = 448;

UPDATE terrain_blocks
SET ForestVersion = @c449
WHERE ID = 449;

UPDATE terrain_blocks
SET ForestVersion = @c450
WHERE ID = 450;
Image


Bigsteve
 
Posts: 88
Joined: 07 Feb 2014, 03:53

Re: Delete poor quality trees / monthly auto uproot

Post by Bigsteve » 23 Feb 2015, 14:47

so does patch.sql get processed by the server every time the server starts?


Arthenius
 
Posts: 29
Joined: 25 Nov 2014, 09:50

Re: Delete poor quality trees / monthly auto uproot

Post by Arthenius » 26 Feb 2015, 11:31

patch.sql is run every time you restart your server


Traeck86
 
Posts: 9
Joined: 17 Jan 2015, 11:16

Re: Delete poor quality trees / monthly auto uproot

Post by Traeck86 » 03 Mar 2015, 20:24

Is this mod Still working with the newest update?


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: Delete poor quality trees / monthly auto uproot

Post by Koiecks » 06 Mar 2015, 01:43

Traeck86 wrote:Is this mod Still working with the newest update?


Yes, confirmed, this is working. Don't forget to change the < 80 to
< 10 unless u want to wipe out the majority of your trees
Image


Azeron
Alpha Tester
 
Posts: 24
Joined: 08 Oct 2014, 18:27
Location: Chicago, IL

Re: Delete poor quality trees / monthly auto uproot

Post by Azeron » 03 Apr 2015, 11:35

Is it working with new patch (0.3.4.1) as of April 3rd,2015?
I been trying and it corrupts my database...
If so what code your using

User avatar
antonio70
 
Posts: 73
Joined: 20 Aug 2014, 18:17

Re: Delete poor quality trees / monthly auto uproot

Post by antonio70 » 13 Apr 2015, 14:26

Azeron wrote:Is it working with new patch (0.3.4.1) as of April 3rd,2015?
I been trying and it corrupts my database...
If so what code your using

Yes, I can confirm its still working fine :)
I just tried it today.


Scrire
 
Posts: 6
Joined: 18 Apr 2015, 09:00

Re: Delete poor quality trees / monthly auto uproot

Post by Scrire » 18 Apr 2015, 09:02

Hi all, sorry but i don't understand what and where to put that script, could someone please tell me point to point what i have to do, like sql-->patch.sql>add the script and so on? thanks!

User avatar
antonio70
 
Posts: 73
Joined: 20 Aug 2014, 18:17

Re: Delete poor quality trees / monthly auto uproot

Post by antonio70 » 21 Apr 2015, 11:11

You have to connect to your sql database through some program. I use HeidiSQL which is free or Navicat.
My serverprovider is Blackbox so there is their instructions:
Spoiler

Write ip adress, user name, password and port.
Then when you are connected click there:
Spoiler

(I use my language but icon should be same :D ) and then copy to this window all this:
Spoiler

And then tap F9 or right mouse button and then choose run.
Don't forget to set lower quality of trees. I used 15 and it remove just fine amount of trees
Last edited by antonio70 on 06 Sep 2015, 09:32, edited 1 time in total.


Scrire
 
Posts: 6
Joined: 18 Apr 2015, 09:00

Re: Delete poor quality trees / monthly auto uproot

Post by Scrire » 21 Apr 2015, 15:31

Thanks man, but where i have to set the quality?

User avatar
antonio70
 
Posts: 73
Joined: 20 Aug 2014, 18:17

Re: Delete poor quality trees / monthly auto uproot

Post by antonio70 » 21 Apr 2015, 21:57

4rd line in code. Where is written:
Spoiler

just change the number
Spoiler
15 as I used or as you wish


Scrire
 
Posts: 6
Joined: 18 Apr 2015, 09:00

Re: Delete poor quality trees / monthly auto uproot

Post by Scrire » 21 Apr 2015, 23:17

This works also with all server hosters? i tried to open my database via navicat and heidisql but it don't open, only filezilla works, there's a way to add this lines via filezilla? sorry for these stupid questions

User avatar
antonio70
 
Posts: 73
Joined: 20 Aug 2014, 18:17

Re: Delete poor quality trees / monthly auto uproot

Post by antonio70 » 22 Apr 2015, 09:09

Filezila looks like FTP browser but you need to connect to your SQL database. Maybe try to contact your server provider and ask him how to connect to your database.


Gms0012
 
Posts: 166
Joined: 23 Feb 2015, 08:49

Re: Delete poor quality trees / monthly auto uproot

Post by Gms0012 » 22 Apr 2015, 10:21

you can add the sql code to the end of the patch.SQL file (in the SQL folder)

so download this file with the ftp client
change the file
upload it again

then the script runs with each server restart
Image


Scrire
 
Posts: 6
Joined: 18 Apr 2015, 09:00

Re: Delete poor quality trees / monthly auto uproot

Post by Scrire » 23 Apr 2015, 00:26

I added those lines at the very end of my patch.sql like in the spoiler
Spoiler
it's right? i can upload it in my server?


Gms0012
 
Posts: 166
Joined: 23 Feb 2015, 08:49

Re: Delete poor quality trees / monthly auto uproot

Post by Gms0012 » 23 Apr 2015, 07:25

yes, but the code is not complete, isnt it?
Image


Scrire
 
Posts: 6
Joined: 18 Apr 2015, 09:00

Re: Delete poor quality trees / monthly auto uproot

Post by Scrire » 23 Apr 2015, 09:02

No is complete, i only cutted it away from the image to let you see where the normal patch.sql finishes the low trees code begins

User avatar
Ghost_swe79
True Believer
 
Posts: 41
Joined: 16 Apr 2015, 12:17
Location: Sweden

Re: Delete poor quality trees / monthly auto uproot

Post by Ghost_swe79 » 10 Aug 2015, 09:54

anyone knows if still works after update?

just ran script in patch.sql nothing happend.

DELETE forest, forest_patch
FROM forest, forest_patch
WHERE forest.GeoDataID = forest_patch.GeoDataID AND
forest.Quality < 80;

SET @c442 = 1;
SET @c443 = 1;
SET @c444 = 1;
SET @c445 = 1;
SET @c446 = 1;
SET @c447 = 1;
SET @c448 = 1;
SET @c449 = 1;
SET @c450 = 1;

UPDATE forest_patch
SET Version = @c442:=@c442+1
WHERE TerID = 442;

UPDATE forest_patch
SET Version = @c443:=@c443+1
WHERE TerID = 443;

UPDATE forest_patch
SET Version = @c444:=@c444+1
WHERE TerID = 444;

UPDATE forest_patch
SET Version = @c445:=@c445+1
WHERE TerID = 445;

UPDATE forest_patch
SET Version = @c446:=@c446+1
WHERE TerID = 446;

UPDATE forest_patch
SET Version = @c447:=@c447+1
WHERE TerID = 447;

UPDATE forest_patch
SET Version = @c448:=@c448+1
WHERE TerID = 448;

UPDATE forest_patch
SET Version = @c449:=@c449+1
WHERE TerID = 449;

UPDATE forest_patch
SET Version = @c450:=@c450+1
WHERE TerID = 450;

SET @c442 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 442 ORDER BY TerID);
SET @c443 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 443 ORDER BY TerID);
SET @c444 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 444 ORDER BY TerID);
SET @c445 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 445 ORDER BY TerID);
SET @c446 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 446 ORDER BY TerID);
SET @c447 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 447 ORDER BY TerID);
SET @c448 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 448 ORDER BY TerID);
SET @c449 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 449 ORDER BY TerID);
SET @c450 = (SELECT Max(Version) as max FROM forest_patch WHERE TerID = 450 ORDER BY TerID);

UPDATE terrain_blocks
SET ForestVersion = @c442
WHERE ID = 442;

UPDATE terrain_blocks
SET ForestVersion = @c443
WHERE ID = 443;

UPDATE terrain_blocks
SET ForestVersion = @c444
WHERE ID = 444;

UPDATE terrain_blocks
SET ForestVersion = @c445
WHERE ID = 445;

UPDATE terrain_blocks
SET ForestVersion = @c446
WHERE ID = 446;

UPDATE terrain_blocks
SET ForestVersion = @c447
WHERE ID = 447;

UPDATE terrain_blocks
SET ForestVersion = @c448
WHERE ID = 448;

UPDATE terrain_blocks
SET ForestVersion = @c449
WHERE ID = 449;

UPDATE terrain_blocks
SET ForestVersion = @c450
WHERE ID = 450;

User avatar
Lillo
Zealous Believer
 
Posts: 3
Joined: 06 Aug 2015, 09:25
Location: Roma

Re: Delete poor quality trees / monthly auto uproot

Post by Lillo » 10 Aug 2015, 11:09

But there is a script to delete only the roots left by users?
mail: lillosoft@alice.it cellulare 392 2862281 sempre attivo


Vande
Zealous Believer
 
Posts: 1
Joined: 17 Aug 2015, 18:15

Re: Delete poor quality trees / monthly auto uproot

Post by Vande » 18 Aug 2015, 14:09

Wondering if this still works too.

Return to Game mods

cron