The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 3 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lumberjacking log types based on the type of tree
Author Message
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #1
Lumberjacking log types based on the type of tree
Here is an alternative lumberjacking system that returns logs based on the kind of tree you are chopping...

First, the Region and Resource related stuff:

Code:
[REGIONRESOURCE mr_tree]
SKILL=1.0,80.0
AMOUNT=9,30
REAPAMOUNT=3,9
REAP=i_log
REGEN=60*60*10
ON=@ResourceFound
   FOR <SRC.TARGP.STATICS>
      OBJ=<ARGO>
      LOCAL.TreeType=<SRC.TARGP.STATICS.<EVAL <LOCAL._FOR>-1>.DEFNAME>
      IF (<LOCAL.TreeType>==i_tree_cedar1_trunk) || (<LOCAL.TreeType>==i_tree_cedar2_trunk)
         OBJ.f_setresource mr_tree_cedar
      ELSEIF (<LOCAL.TreeType>==i_tree_oak1_trunk) || (<LOCAL.TreeType>==i_tree_oak2_trunk) || (<LOCAL.TreeType>==i_tree_oak3_trunk) || (<LOCAL.TreeType>==i_tree_oak4_trunk)
         OBJ.f_setresource mr_tree_oak
      ELSEIF (<LOCAL.TreeType>==i_tree_walnut1_trunk) || (<LOCAL.TreeType>==i_tree_walnut2_trunk)
         OBJ.f_setresource mr_tree_walnut
      ELSEIF (<LOCAL.TreeType>==i_tree_willow1_trunk) || (<LOCAL.TreeType>==i_tree_willow2_trunk) || (<LOCAL.TreeType>==i_tree_willow3_trunk)
         OBJ.f_setresource mr_tree_willow
      ELSEIF (<LOCAL.TreeType>==i_tree_cyprus1_trunk) || (<LOCAL.TreeType>==i_tree_cyprus2_trunk) || (<LOCAL.TreeType>==i_tree_cyprus3_trunk) || (<LOCAL.TreeType>==i_tree_cyprus4_trunk)
         OBJ.f_setresource mr_tree_cyprus
      ELSEIF (<LOCAL.TreeType>==i_tree_trunk_yew_1)
         OBJ.f_setresource mr_tree_yew
      ELSEIF (<LOCAL.TreeType>==i_tree_bamboo)
         OBJ.f_setresource mr_tree_bamboo
      ELSEIF (<LOCAL.TreeType>==i_tree_trunk_cherry)
         OBJ.f_setresource mr_tree_cherry
      ELSEIF (<LOCAL.TreeType>==i_tree_trunk_maple)
         OBJ.f_setresource mr_tree_maple
      ELSEIF (<LOCAL.TreeType>==i_tree1_trunk)
         OBJ.f_setresource mr_tree_regular
      ELSEIF (<LOCAL.TreeType>==i_tree2_trunk)
         OBJ.f_setresource mr_tree_regular
      ELSEIF (<LOCAL.TreeType>==i_tree3_trunk)
         OBJ.f_setresource mr_tree_regular
      ELSEIF (<LOCAL.TreeType>==i_tree4_trunk)
         OBJ.f_setresource mr_tree_regular
      ELSEIF (<LOCAL.TreeType>==i_tree5_trunk)
         OBJ.f_setresource mr_tree_regular
      ELSEIF (<LOCAL.TreeType>==i_tree6_trunk)
         OBJ.f_setresource mr_tree_regular
      ENDIF
   ENDFOR

[FUNCTION f_setresource]
FORITEMS 0
  IF (<BASEID>==i_worldgem_bit) && (<TYPE>==t_tree)
     MORE1=<ARGV[0]>
     AMOUNT={4 9}//This may not be necessary...
     RETURN 0
  ENDIF
ENDFOR
RETURN 1

[REGIONRESOURCE mr_tree_regular]
SKILL=80.0,100.0
AMOUNT=4,9
REAP=i_log
REGEN=60*60*10

[REGIONRESOURCE mr_tree_cedar]
SKILL=80.0,100.0
AMOUNT=4,9
REAP=i_log_cedar
REGEN=60*60*10

[REGIONRESOURCE mr_tree_oak]
SKILL=80.0,100.0
AMOUNT=4,9
REAP=i_log_oak
REGEN=60*60*10

[REGIONRESOURCE mr_tree_walnut]
SKILL=70.0,95.0
AMOUNT=4,9
REAP=i_log_walnut
REGEN=60*60*10

[REGIONRESOURCE mr_tree_willow]
SKILL=70.0,95.0
AMOUNT=4,9
REAP=i_log_willow
REGEN=60*60*10

[REGIONRESOURCE mr_tree_cyprus]
SKILL=70.0,95.0
AMOUNT=4,9
REAP=i_log_cyprus
REGEN=60*60*10

[REGIONRESOURCE mr_tree_yew]
SKILL=70.0,95.0
AMOUNT=4,9
REAP=i_log_yew
REGEN=60*60*10

[REGIONRESOURCE mr_tree_bamboo]
SKILL=70.0,95.0
AMOUNT=4,9
REAP=i_log_bamboo
REGEN=60*60*10

[REGIONRESOURCE mr_tree_cherry]
SKILL=70.0,95.0
AMOUNT=4,9
REAP=i_log_cherry
REGEN=60*60*10

[REGIONRESOURCE mr_tree_maple]
SKILL=70.0,95.0
AMOUNT=4,9
REAP=i_log_maple
REGEN=60*60*10

Now the log and board items...

Code:
[DEFNAME colors_resources_wood]
color_o_ash        0157
color_o_bamboo     098
color_o_bloodwood  04aa
color_o_cedar      0157
color_o_cherry     0676
color_o_cyprus     0235
color_o_frostwood  04ab
color_o_heartwood  04a9
color_o_maple      06c0
color_o_oak        04a6
color_o_sunwood    04ac
color_o_walnut     0473
color_o_willow     02e9
color_o_yew        04a8

[ITEMDEF i_log_ash]
ID=i_log
NAME=ash log%s
TYPE=t_log
VALUE=2
WEIGHT=2.0
CATEGORY=Resources
SUBSECTION=Wood
DESCRIPTION=Ash Log
ON=@Create
   COLOR=color_o_ash

[ITEMDEF i_board_ash]
ID=i_board
NAME=ash board%s
TYPE=t_board
VALUE=5
WEIGHT=1.0
CATEGORY=Resources
SUBSECTION=Boards
DESCRIPTION=Ash Board
ON=@Create
   COLOR=color_o_ash

[ITEMDEF i_log_cedar]
ID=i_log
NAME=cedar log%s
TYPE=t_log
VALUE=2
WEIGHT=2.0
CATEGORY=Resources
SUBSECTION=Wood
DESCRIPTION=Cedar Log
ON=@Create
   COLOR=color_o_cedar

[ITEMDEF i_board_cedar]
ID=i_board
NAME=cedar board%s
TYPE=t_board
VALUE=5
WEIGHT=1
CATEGORY=Resources
SUBSECTION=Boards
DESCRIPTION=Cedar Board
ON=@Create
   COLOR=color_o_cedar

[ITEMDEF i_log_oak]
ID=i_log
NAME=oak log%s
TYPE=t_log
VALUE=2
WEIGHT=2.0
CATEGORY=Resources
SUBSECTION=Wood
DESCRIPTION=Oak Log
ON=@Create
   COLOR=color_o_oak

[ITEMDEF i_board_oak]
ID=i_board
NAME=oak board%s
TYPE=t_board
VALUE=5
WEIGHT=1
CATEGORY=Resources
SUBSECTION=Boards
DESCRIPTION=Oak Board
ON=@Create
   COLOR=color_o_oak

[ITEMDEF i_log_walnut]
ID=i_log
NAME=walnut log%s
TYPE=t_log
VALUE=2
WEIGHT=2.0
CATEGORY=Resources
SUBSECTION=Wood
DESCRIPTION=Walnut Log
ON=@Create
   COLOR=color_o_walnut

[ITEMDEF i_board_walnut]
ID=i_board
NAME=walnut board%s
TYPE=t_board
VALUE=5
WEIGHT=1
CATEGORY=Resources
SUBSECTION=Boards
DESCRIPTION=Walnut Board
ON=@Create
   COLOR=color_o_walnut

[ITEMDEF i_log_willow]
ID=i_log
NAME=willow log%s
TYPE=t_log
VALUE=2
WEIGHT=2.0
CATEGORY=Resources
SUBSECTION=Wood
DESCRIPTION=Willow Log
ON=@Create
   COLOR=color_o_willow

[ITEMDEF i_board_willow]
ID=i_board
NAME=willow board%s
TYPE=t_board
VALUE=5
WEIGHT=1
CATEGORY=Resources
SUBSECTION=Boards
DESCRIPTION=Willow Board
ON=@Create
   COLOR=color_o_willow

[ITEMDEF i_log_cyprus]
ID=i_log
NAME=cyprus log%s
TYPE=t_log
VALUE=2
WEIGHT=2.0
CATEGORY=Resources
SUBSECTION=Wood
DESCRIPTION=Cyprus Log
ON=@Create
   COLOR=color_o_cyprus

[ITEMDEF i_board_cyprus]
ID=i_board
NAME=cyprus board%s
TYPE=t_board
VALUE=5
WEIGHT=1
CATEGORY=Resources
SUBSECTION=Boards
DESCRIPTION=Cyprus Board
ON=@Create
   COLOR=color_o_cyprus

[ITEMDEF i_log_yew]
ID=i_log
NAME=yew log%s
TYPE=t_log
VALUE=2
WEIGHT=2.0
CATEGORY=Resources
SUBSECTION=Wood
DESCRIPTION=Yew Log
ON=@Create
   COLOR=color_o_yew

[ITEMDEF i_board_yew]
ID=i_board
NAME=yew board%s
TYPE=t_board
VALUE=5
WEIGHT=1
CATEGORY=Resources
SUBSECTION=Boards
DESCRIPTION=Yew Board
ON=@Create
   COLOR=color_o_yew

[ITEMDEF i_log_bamboo]
ID=i_log
NAME=bamboo
TYPE=t_log
VALUE=2
WEIGHT=1.0
CATEGORY=Resources
SUBSECTION=Wood
DESCRIPTION=Bamboo Log
ON=@Create
   COLOR=color_o_bamboo

[ITEMDEF i_board_bamboo]
ID=i_board
NAME=bamboo board%s
TYPE=t_board
VALUE=5
WEIGHT=1
CATEGORY=Resources
SUBSECTION=Boards
DESCRIPTION=Bamboo Board
ON=@Create
   COLOR=color_o_bamboo

[ITEMDEF i_log_cherry]
ID=i_log
NAME=cherry log%s
TYPE=t_log
VALUE=2
WEIGHT=2.0
CATEGORY=Resources
SUBSECTION=Wood
DESCRIPTION=Cherry Log
ON=@Create
   COLOR=color_o_cherry

[ITEMDEF i_board_cherry]
ID=i_board
NAME=cherry board%s
TYPE=t_board
VALUE=5
WEIGHT=1
CATEGORY=Resources
SUBSECTION=Boards
DESCRIPTION=Cherry Board
ON=@Create
   COLOR=color_o_cherry

[ITEMDEF i_log_maple]
ID=i_log
NAME=maple log%s
TYPE=t_log
VALUE=2
WEIGHT=2.0
CATEGORY=Resources
SUBSECTION=Wood
DESCRIPTION=Maple Log
ON=@Create
   COLOR=color_o_maple

[ITEMDEF i_board_maple]
ID=i_board
NAME=maple board%s
TYPE=t_board
VALUE=5
WEIGHT=1
CATEGORY=Resources
SUBSECTION=Boards
DESCRIPTION=Maple Board
ON=@Create
   COLOR=color_o_maple

Note: If there are problems, check the DEFNAME's for your tree trunks...
09-27-2012 02:43 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes RanXerox's post
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #2
RE: Lumberjacking log types based on the type of tree
I like this way since a DEFLIST is easier to understand and update in this case. Posting for reference and because we each have some trees the other lacks. This isn't a complete script, just the function and DEFs for the trees.

Code:
[REGIONRESOURCE mr_tree]
// lumberjacking default
// t_tree
SKILL=0.0,70.0
AMOUNT=9,30
REAP=i_log_birch
REAPAMOUNT=1,8
REGEN=60*60*24

on=@resourcefound
obj=<argo.uid>
call f_findtree
if <def.logs.<var.tree>>
    obj.more1=<def.logs.<var.tree>>
endif

[function f_findtree]
for x 0 <eval <obj.p.statics>-1>
    if (<obj.p.statics.<local.x>.type>==t_tree)
        if (<def.logs.<obj.p.statics.<local.x>.baseid>>)
            var.tree=<obj.p.statics.<local.x>.baseid>
        endif
    endif
endfor

Code:
[defname lumberjacking_constants]

logs.i_tree_trunk=mr_tree_dead //gives dead wood (reagent)
logs.i_tree_trunk_2=mr_tree_dead
logs.i_tree_trunk_3=mr_tree_dead

logs.i_tree_cedar=mr_tree_cedar
logs.i_tree_cedar2=mr_tree_cedar

logs.i_tree_oak=mr_tree_oak
logs.i_tree_oak2=mr_tree_oak

logs.i_tree_walnut=mr_tree_walnut
logs.i_tree_walnut2=mr_tree_walnut

logs.i_tree_trunk_willow=mr_tree_willow
logs.i_tree_trunk_willow2=mr_tree_willow

logs.i_tree_cyprus=mr_tree_cyprus
logs.i_tree_cyprus2=mr_tree_cyprus
logs.i_tree_cyprus3=mr_tree_cyprus
logs.i_tree_cyprus4=mr_tree_cyprus

logs.i_tree_trunk_part_1=mr_tree_mahogany
logs.i_tree_trunk_part_2=mr_tree_mahogany
logs.i_tree_trunk_part_3=mr_tree_mahogany
logs.i_tree_trunk_part_4=mr_tree_mahogany

logs.i_tree_trunk_2_part_1=mr_tree_mahogany
logs.i_tree_trunk_2_part_2=mr_tree_mahogany
logs.i_tree_trunk_2_part_3=mr_tree_mahogany
logs.i_tree_trunk_2_part_4=mr_tree_mahogany
logs.i_tree_trunk_2_part_5=mr_tree_mahogany

logs.i_tree_trunk_3_part_1=mr_tree_mahogany
logs.i_tree_trunk_3_part_2=mr_tree_mahogany
logs.i_tree_trunk_3_part_3=mr_tree_mahogany
logs.i_tree_trunk_3_part_4=mr_tree_mahogany
logs.i_tree_trunk_3_part_5=mr_tree_mahogany

logs.i_tree_trunk_4_part_1=mr_tree_mahogany
logs.i_tree_trunk_4_part_2=mr_tree_mahogany
logs.i_tree_trunk_4_part_3=mr_tree_mahogany

logs.i_tree_yew_1=mr_tree_yew

logs.i_tree_3=mr_tree_birch
logs.i_tree_4=mr_tree_birch
logs.i_tree_5=mr_tree_birch

(Birch is just normal wood in this system BTW, I wanted a specific default the way iron is for metal and birchs are common and basic.)



Also for those wondering, these systems will still find other resources if you like.
Code:
[REGIONTYPE r_default_tree t_tree]
// All tress produce wood by default.
RESOURCES=50.0 mr_tree
RESOURCES=1.0 mr_frostwood
RESOURCES=1.0 mr_bloodwood
RESOURCES=1.0 mr_sunwood
RESOURCES=1.0 mr_heartwood
With this t_tree region def you'll occasionally get rare woods from any tree, otherwise it'll default to the species. Chaga mushrooms could go here. (Yes I know that doesn't match EA but it makes more sense than some of their harvestables, look up actual Chaga mushrooms)

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
09-27-2012 02:59 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #3
RE: Lumberjacking log types based on the type of tree
Thanks RANXEROX for the script, I was trying to do the same thing you did.
But I was stucked how to change the worldgem bit, lol.

One thing I saw, is that if the player try to gather logs from a far tree, the worldgem bit still being created on the tree targeted.
Could you check it?

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
(This post was last modified: 09-29-2012 03:25 AM by Extreme.)
09-28-2012 02:37 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #4
RE: Lumberjacking log types based on the type of tree
This is not my script Extreme.

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
09-28-2012 05:46 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #5
RE: Lumberjacking log types based on the type of tree
Ah =D

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
09-28-2012 05:52 AM
Find all posts by this user Like Post Quote this message in a reply
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #6
RE: Lumberjacking log types based on the type of tree
I don't think that's a bug, at least not in this script. The SphereServer creates the gem on any test, like some sort of quantum particle. If the world bit gems where all there all the time the only negative result would be a little more lag. I think this is actually useful since it means you could have a special resource harvestable from further away and Sphere won't let them harvest the gem under normal circumstances even if it gets created.

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
09-28-2012 07:44 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #7
Re: Lumberjacking log types based on the type of tree
No problem.. I will put a check to don't target very far trees or mine floor.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
09-28-2012 10:29 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #8
RE: Lumberjacking log types based on the type of tree
Just 2 days ago I was thinking about making this script. I had one very much like this years ago, not written by me, I don't recall who did it. You've saved me a job....

Now... does anyone want to script all the craftable stuff I had made that went with this script? I'm missing that too lol

[Image: 2nis46r.jpg]
09-28-2012 11:49 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #9
RE: Lumberjacking log types based on the type of tree
What craftable stuff... maybe I have that too!
09-29-2012 03:09 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #10
RE: Lumberjacking log types based on the type of tree
OHHHHHHHH GOD! THAT A SHAME!
Sorry RanXerox!!! I just saw the yellow name and remembered Skul LOL!

Thanks RanXerox for the script!

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
09-29-2012 03:25 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)