Praxiiz

Member
Praxiiz submitted a new resource:

UltimaLive Lumber Harvesting - Lumber Harvesting

Introduction
UltimaLive Lumber Harvesting is a graphics based harvest system. It allows players to actually chop down trees and cut them into pieces. Tree locations are saved and re-spawned according to a minimum interval set by shard owners.


Requirements
  • UltimaLive v.0.97
  • Cut Down Trees, Stumps and Saplings v.0.30 by Hank
Installation
  1. Unzip the archive into your UltimaLive folder.
  2. Install Custom Graphics
More...

Read more about this resource...
 
If anyone needs any help with my graphics or any other graphics relating to UltimaLine Lune Harvesting by Praxiiz. You can also pm me for aid on adding the art/tiledata.
Also check out his Map Streamer and Editor
 
Last edited by a moderator:
Excellent resource here, gentlemen. I've deployed it and UltimaLive on my own shard (http://www.13thrones.com), and I'm currently testing it. Working great so far, save for a scant few issues:

1) Artwork for the downed trees needs to be added into sub 0x4000 blocks when importing - if added in the 0x4000 or 0x5000 range, the harvest system will not recognize the items as harvestable when targetted. Not sure if this is an issue with the harvesting scripts itself, UltimaLive, or simply client issues/limitations.

2) Specifying a custom time between harvest phases/respawns doesn't appear to work - regardless of the timespan override, trees cycle through their regrowths on every save.

Other than that, this is a pretty amazing system!
 
In LumberHarvest.cs, line 33

Code:
tiles[i] += 0x4000;

Try raising that to 5000? I haven't implemented the system yet, but its the only reference I saw.
 
First thing I tried. At work now, but I can't remember if it threw me an error in compiling or just simply didn't work.
 
Hrm, hopefully Praxiiz has an idea then, because that would definitely stink. My only available free slots are well into the 4-5k's.
 
This will limit those who want to use this because of the "custom graphics" if one package could also be posted with out having the custom graphics, I'm sure more would like to use this :) Just my thoughts
 
You could tell it to use any of the distro art. In HarvestableTrees.cs Look at the #region OhiiTree, #region Generic Tree 1 and so on.
Most people will have to change their graphic hex values anyways because it unlikely everyone will be using the same exact graphic hex value.
All someone needs to do is go through and change the hex values to use default in game art
Not sure if praxiiz has a distro art style for this version.
 
That's pretty much required as is. Also a non artwork release would be doable if one were to just use the log art. Also Hank you may want to check your .csv files for mass imports. There were a few erroneous file paths in there specifically for Willow trees (willow vs. Willow1). Awesome work on the art by the way. Absolutely stunning.

Sent from my SCH-I535 using Tapatalk
 
This will limit those who want to use this because of the "custom graphics" if one package could also be posted with out having the custom graphics, I'm sure more would like to use this :) Just my thoughts

I was planning on having a non-custom graphics version. I haven't decided if I am going to handle that with a separate script or something like a #define. I am currently working on making that available.

You can see the stock graphics I was planning on using here:
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
 
Excellent resource here, gentlemen. I've deployed it and UltimaLive on my own shard (http://www.13thrones.com), and I'm currently testing it. Working great so far, save for a scant few issues:

1) Artwork for the downed trees needs to be added into sub 0x4000 blocks when importing - if added in the 0x4000 or 0x5000 range, the harvest system will not recognize the items as harvestable when targetted. Not sure if this is an issue with the harvesting scripts itself, UltimaLive, or simply client issues/limitations.

2) Specifying a custom time between harvest phases/respawns doesn't appear to work - regardless of the timespan override, trees cycle through their regrowths on every save.

Other than that, this is a pretty amazing system!

The underlying HarvestSystem base class (found in HarvestSystem.cs) is what we're working with. It is a stock server file that is distributed with RunUO/ServUO. The flow of execution looks like this:

BaseAxe.OnDoubleClick --> HarvestSystem.BeginHarvesting --> Sends new HarvestTarget

HarvestTarget.OnTarget --> HarvestSystem.StartHarvesting-->GetHarvestDetails

Code:
public virtual bool GetHarvestDetails(Mobile from, Item tool, object toHarvest, out int tileID, out Map map, out Point3D loc)
{
  if (toHarvest is Static && !((Static)toHarvest).Movable)
  {
    Static obj = (Static)toHarvest;

    tileID = (obj.ItemID & 0x3FFF) | 0x4000;
    map = obj.Map;
    loc = obj.GetWorldLocation();
  }
  else if (toHarvest is StaticTarget)
  {
    StaticTarget obj = (StaticTarget)toHarvest;

    tileID = (obj.ItemID & 0x3FFF) | 0x4000;
    map = from.Map;
    loc = obj.Location;
  }
  else if (toHarvest is LandTarget)
  {
    LandTarget obj = (LandTarget)toHarvest;

    tileID = obj.TileID;
    map = from.Map;
    loc = obj.Location;
  }
  else
  {
    tileID = 0;
    map = null;
    loc = Point3D.Zero;
    return false;
  }

  return (map != null && map != Map.Internal);
}

The relevent portion of code is
Code:
 tileID = (obj.ItemID & 0x3FFF) | 0x4000;

It could be to support lower client versions. I haven't really dug into it to know for sure. What I do know is that it would need to be changed to support higher graphics slots.
 
I just realized that I never actually implemented the growth timer. Currently it just regrows every time the world saves. This will be coming soon!
 
are there missing install instructions?

on this part (Modify Base Axe, and Polearm) I get the following error.
Code:
+ Items/- BaseClasses/BaseAxe.cs:
  CS0103: Line 68: The name 'UltimaLiveLumberjacking' does not exist in the cu
rrent context
 + Items/- BaseClasses/BasePoleArm.cs:
  CS0103: Line 63: The name 'UltimaLiveLumberjacking' does not exist in the cu
rrent context
I tried adding using UltimaLive; and using UltimaLive.LumberHarvest; and it still did not work.
 
Check your LumberHarvest.cs and see if the top portion matches this:

Code:
namespace Server.Engines.Harvest
{
  public class UltimaLiveLumberjacking :  HarvestSystem
  {
 
line 13 - 16
Code:
namespace Server.Engines.Harvest
{
  public class UltimaLiveLumberjacking :  HarvestSystem
  {

Also I extracted GraphicBasedHarvestSystems folder directly into Servuo/UltimaLive folder.
aka I extracted the archive into the UltimaLive folder.

(Post 300 :D)
 
Does your BaseAxe.cs have

Code:
using Server.Engines.Harvest;

at the top?


The method in BaseAxe.cs should look something like
Code:
public virtual HarvestSystem HarvestSystem
  {
  get
  {
  return UltimaLiveLumberjacking.System;
  }
  }
 
Does your BaseAxe.cs have
Code:
using Server.Engines.Harvest;
at the top?
Yes it does

This is my method in BaseAxe.cs
Code:
public virtual HarvestSystem HarvestSystem
  {
  get
  {
         //return Lumberjacking.System;
  return UltimaLiveLumberjacking.System;
  }
  }

I am also having an issue with UltimaLive map streamer and editor, I can't moved my character to the example 'test' map 32. It causes my client to lock up. I'm using client version 7.0.18
 
Praxiiz updated UltimaLive Lumber Harvesting with a new update entry:

Added

Implemented the configurable regrow rate. Setting TimeBetweenRegrowth in LumberHarvest.cs now has an effect, which is the minimum time that the system will wait before it regrows trees on a world save.

Added support for Stock Graphics. The system uses stock graphics by default. To enable custom graphics, uncomment #define CUSTOM_TREE_GRAPHICS in HarvestableTrees.cs

Read the rest of this update entry...
 
Thanks for updating Praxiiz. People are going to love the ability to use stock graphics!

Also i was able to get it to work! One of your install instructions is a bit misleading.
Unzip the archive into your UltimaLive folder.

There is actually two Ultima Lives folders. One in the base directory of ServUO and the one that is in the Scripts/Custom folder.

Extract the archive into your Scripts\Custom\UltimaLive folder
 
Whenever I go to chop wood, I get a server crash. It is always the second time you chop the tree. I cannot figure out what is happening. I would think it would crash on the first chop...

Code:
Exception:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at UltimaLive.LumberHarvest.BaseTreeHarvestPhase.RecordTreeLocationAndGraphic(Int32 mapId, Int32 itemId, Point3D trunkLocation)
  at UltimaLive.LumberHarvest.BaseTreeHarvestPhase.Harvest(Mobile from, Int32 itemId, Point3D harvestTargetLocation, Map map, MapOperationSeries& operationSeries)
  at UltimaLive.LumberHarvest.LeafHandlingTreePhase.Harvest(Mobile from, Int32 itemId, Point3D harvestTargetLocation, Map map)
  at Server.Engines.Harvest.UltimaLiveLumberjacking.FinishHarvesting(Mobile from, Item tool, HarvestDefinition def, Object toHarvest, Object locked)
  at Server.Engines.Harvest.HarvestSoundTimer.OnTick()
  at Server.Timer.Slice() in c:\RunUO\ServUO\Server\Timer.cs:line 387
  at Server.Core.Main(String[] args) in c:\RunUO\ServUO\Server\Main.cs:line 622

Has anyone else seen this happen?
 
I'd tell you to put your server in debug, but there's only one line in that method so it wouldn't do any good. My next step would be add some debug statements or step through it in a vs project.

In your BaseTreeHarvestPhase.cs the method that is crashing is RecordTreeLocationAndGraphic. If you change it to look like this it will let us pin point what is going wrong:

Code:
public virtual void RecordTreeLocationAndGraphic(int mapId, int itemId, Point3D trunkLocation)
  {
  try
  {
  Console.WriteLine("Map ID:" + mapId);
  Console.WriteLine("Item ID:" + itemId);
  Console.WriteLine("Trunk Location:" + trunkLocation);
  UltimaLiveLumberjacking.RegrowthMasterLookupTable[mapId][trunkLocation] = itemId;
  }
  catch { }
  }

The try catch should also keep the server from crashing.
 
Hi Praxiiz,I have successfully installed the script, including the client Graphic, TileData, but can not get the timber when Harvest.

The following statements have not been performed correctly:
BaseTreeHarvestPhase.cs

foreach (Item itm in assetPair.Value.ReapBonusResources(assetPair.Key, from))
{
from.Say("3"); //test
from.AddToBackpack(itm);
}


help me!
thank you very much:)
 
Sorry, my English is not very good, afraid you do not understand what I say.
I recorded a video. you see please, Can not get wood.
help me,thank you very much
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
 
This is what happens when I code late at night. I will have to get another version released soon. To fix the issue, you need to change the lines

Code:
//give out phase resource for each graphic asset removed
foreach (KeyValuePair<int, GraphicAsset> assetPair in phasePiecesRemoved)
{
  hue = assetPair.Key;
  foreach (Item itm in assetPair.Value.ReapBonusResources(assetPair.Key, from))
  {
    from.AddToBackpack(itm);
  }
}

to
Code:
//give out phase resource for each graphic asset removed
foreach (KeyValuePair<int, GraphicAsset> assetPair in phasePiecesRemoved)
{
  hue = assetPair.Key;

  Item itm = this.ReapResource(assetPair.Key, from, assetPair.Value.HarvestResourceBaseAmount);

  if (itm != null)
  {
    from.AddToBackpack(itm);
  }
}
 
This is what happens when I code late at night. I will have to get another version released soon. To fix the issue, you need to change the lines

Code:
//give out phase resource for each graphic asset removed
foreach (KeyValuePair<int, GraphicAsset> assetPair in phasePiecesRemoved)
{
  hue = assetPair.Key;
  foreach (Item itm in assetPair.Value.ReapBonusResources(assetPair.Key, from))
  {
    from.AddToBackpack(itm);
  }
}

to
Code:
//give out phase resource for each graphic asset removed
foreach (KeyValuePair<int, GraphicAsset> assetPair in phasePiecesRemoved)
{
  hue = assetPair.Key;

  Item itm = this.ReapResource(assetPair.Key, from, assetPair.Value.HarvestResourceBaseAmount);

  if (itm != null)
  {
    from.AddToBackpack(itm);
  }
}
Thank you very much!
 
This is an incredible system you have here and I can not wait to play around with it!

However I do have two issues, the first is the crash stated earlier in the thread:
Code:
Server Crash Report
===================
RunUO Version 0.5, Build 5199.26217
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.34011
Time: 3/27/2014 10:02:30 PM
Mobiles: 1
Items: 35
Exception:
System.Exception: World Save event threw an exception.  Save failed! ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.Collections.Generic.List`1.get_Item(Int32 index)
  at Server.Engines.Harvest.UltimaLiveLumberjacking.OnSave(WorldSaveEventArgs e)
  at Server.WorldSaveEventHandler.Invoke(WorldSaveEventArgs e)
  at Server.World.Save(Boolean message, Boolean permitBackgroundWrite) in c:\ServUO-master\Server\World.cs:line 1133
  --- End of inner exception stack trace ---
  at Server.World.Save(Boolean message, Boolean permitBackgroundWrite) in c:\ServUO-master\Server\World.cs:line 1161
  at Server.Misc.AutoSave.OnTick()
  at Server.Timer.Slice() in c:\ServUO-master\Server\Timer.cs:line 387
  at Server.Core.Main(String[] args) in c:\ServUO-master\Server\Main.cs:line 622
Clients:
- Count: 0
The only other issue I have is that when I run the client and it loads Ultima Live to copy files it crashes the client. This could be because I am using Windows 8, but any information would be great.

**EDIT**
I fixed it, I ran the debug dll and the "UNIQUE_SHARD_IDENTIFIER" in the Ultima Live settings apparently needs to be 27 characters or less lol, I of course used the max you stated of 28 and that's where my client would crash :)
Again this project is awesome and great job so far!
 
Last edited:
Are you using the current set of lumber harvest files from version 0.41? I thought that I had fixed the generic list issue by removing the generic list completely. It should now be a dictionary. If you can run your server in debug mode it should give me an exact line number to track down the error.
 
Are you using the current set of lumber harvest files from version 0.41? I thought that I had fixed the generic list issue by removing the generic list completely. It should now be a dictionary. If you can run your server in debug mode it should give me an exact line number to track down the error.
As far as I know yes I am using your latest files as I just downloaded it yesterday, I checked my timestamp and it was a few hours after you uploaded it I believe. All I did was install it per your instructions, let me recheck the files and then I will run the server in debug to get you a log.

**EDIT**
Checked the files and they are identical to the current version on ServUO.
Here is an updated crash log:
Code:
Server Crash Report
===================
RunUO Version 0.5, Build 5199.30134
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.34011
Time: 3/28/2014 2:52:38 AM
Mobiles: 4
Items: 133
Exception:
System.Exception: World Save event threw an exception.  Save failed! ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.Collections.Generic.List`1.get_Item(Int32 index)
  at Server.Engines.Harvest.UltimaLiveLumberjacking.OnSave(WorldSaveEventArgs e) in c:\ServUO-master\Scripts\Custom Systems\Ultima Live\LumberHarvest\LumberHarvest.cs:line 129
  at Server.WorldSaveEventHandler.Invoke(WorldSaveEventArgs e)
  at Server.World.Save(Boolean message, Boolean permitBackgroundWrite) in c:\ServUO-master\Server\World.cs:line 1133
  --- End of inner exception stack trace ---
  at Server.World.Save(Boolean message, Boolean permitBackgroundWrite) in c:\ServUO-master\Server\World.cs:line 1161
  at Server.Misc.AutoSave.Save(Boolean permitBackgroundWrite) in c:\ServUO-master\Scripts\Misc\AutoSave.cs:line 78
  at Server.Misc.AutoSave.OnTick() in c:\ServUO-master\Scripts\Misc\AutoSave.cs:line 88
  at Server.Timer.Slice() in c:\ServUO-master\Server\Timer.cs:line 387
  at Server.Core.Main(String[] args) in c:\ServUO-master\Server\Main.cs:line 622
Clients:
- Count: 0
 
Last edited:
As far as I know yes I am using your latest files as I just downloaded it yesterday, I checked my timestamp and it was a few hours after you uploaded it I believe. All I did was install it per your instructions, let me recheck the files and then I will run the server in debug to get you a log.

**EDIT**
Checked the files and they are identical to the current version on ServUO.
Here is an updated crash log:
Code:
Server Crash Report
===================
RunUO Version 0.5, Build 5199.30134
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.34011
Time: 3/28/2014 2:52:38 AM
Mobiles: 4
Items: 133
Exception:
System.Exception: World Save event threw an exception.  Save failed! ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.Collections.Generic.List`1.get_Item(Int32 index)
  at Server.Engines.Harvest.UltimaLiveLumberjacking.OnSave(WorldSaveEventArgs e) in c:\ServUO-master\Scripts\Custom Systems\Ultima Live\LumberHarvest\LumberHarvest.cs:line 129
  at Server.WorldSaveEventHandler.Invoke(WorldSaveEventArgs e)
  at Server.World.Save(Boolean message, Boolean permitBackgroundWrite) in c:\ServUO-master\Server\World.cs:line 1133
  --- End of inner exception stack trace ---
  at Server.World.Save(Boolean message, Boolean permitBackgroundWrite) in c:\ServUO-master\Server\World.cs:line 1161
  at Server.Misc.AutoSave.Save(Boolean permitBackgroundWrite) in c:\ServUO-master\Scripts\Misc\AutoSave.cs:line 78
  at Server.Misc.AutoSave.OnTick() in c:\ServUO-master\Scripts\Misc\AutoSave.cs:line 88
  at Server.Timer.Slice() in c:\ServUO-master\Server\Timer.cs:line 387
  at Server.Core.Main(String[] args) in c:\ServUO-master\Server\Main.cs:line 622
Clients:
- Count: 0

v.0.42 should fix the issue. Please let me know if it helps. If not, I will help fix further issues.
 
line 137 should be mapLookupTable instead of yLookupTable.. Looks like I typoed it when I packaged it up
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back