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:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minimal Lumberjacking
Author Message
Rostok
Apprentice
*

Posts: 31
Likes Given: 6
Likes Received: 2 in 1 posts
Joined: Mar 2016
Reputation: 0



Post: #1
Minimal Lumberjacking
Hello all! I'm tryed to create minimal lumberjacking, but failed =((
System: Ubuntu 16
Spheresvr:
Sphere Version 0.56d-Release [Linux] by http://www.spherecommunity.net
Compiled: Feb 13 2017 (12:32:30) [build 333 / GIT hash 4f84c89]


There are my scripts:

lumber_res.scp

PHP Code:
// Craft-Item
[ITEMDEF 0f43]
//Hatchet
DEFNAME=i_hatchet
NAME 
Hatchet
RESOURCES
=10 i_ingot_iron
TYPE
=T_WEAPON_SWORD
FLIP
=1
DAM
=2,4
SPEED
=20
SKILL
=Swordsmanship
REQSTR
=15
TWOHANDS
=N
WEIGHT
=4
CATEGORY
=Provisions Weapons
SUBSECTION
=Axes
DESCRIPTION
=Hatchet
SKILLMAKE
=TINKERING 13.9
DUPELIST
=0f44

[ITEMDEF 01bdd]
DEFNAME=i_log
NAME
=Willow log%s
VALUE
=10
TYPE
=T_LOG
WEIGHT
=.5
CATEGORY
=Resources
DESCRIPTION
=Log

[REGIONRESOURCE mr_tree]
skill=1.0
amount
=10,15
REAP
=i_log
REGEN
=20*20*5

ON
=@ResourceFound
ON
=@ResourceGather
 SRC
.SYSMESSAGE You got <EVAL <ARGN1>> willow logs

REGION_TYPE

PHP Code:
[REGIONTYPE r_default_tree t_tree]
// All trees produce wood by default.
//=60.0 mr_nothing
RESOURCES=15.0 mr_tree    // This large number makes this very common. 

MAP

PHP Code:
[AREADEF a_world]
NAME=My Shard
GROUP
=MyShard
P
=1323,1624,55,0
RECT
=0,0,6144,4096,0
EVENTS
=r_default,r_default_rock,r_default_water,r_default_tree 

SKILL LUMBERJACKING

PHP Code:
[SKILL 44]
DEFNAME=Skill_Lumberjack
KEY
=Lumberjacking
TITLE
=Lumberjack
FLAGS
=skf_gather
DELAY
=1.6
STAT_STR
=100
STAT_DEX
=100
STAT_INT
=100
BONUS_STR
=0
BONUS_DEX
=0
BONUS_INT
=0
BONUS_STATS
=20
ADV_RATE
=// Old value: 2.5,50.0,200.0
VALUES=1,10,50
RANGE
=3

ON
=@PreStart
  SRC
.SYSMESSAGE prestart

ON
=@Success
  SRC
.SYSMESSAGE  success
ON
=@Fail
    SRC
.SYSMESSAGE You hack at the tree for while, but fail to produce any useable wood.

ON=@Abort
    SRC
.SYSMESSAGE You decide not to chop wood for now.

ON=@Stroke
   SRC
.SYSMESSAGE stroke 

Seems that's all...

So problem:
Every time i'm trying to chop a tree with hatchet
i see only text "It appears immune to your blow" ...

There was no any error with similar scripts for mining, but lumberjacking fails...

Please help me, i'm stuck with that basic functionality =((

p.s. i will try to test this with 56c too...

Tryed to get 56c sources - failed =(
(This post was last modified: 02-19-2017 04:30 PM by Rostok.)
02-19-2017 03:44 PM
Find all posts by this user Like Post Quote this message in a reply
Rostok
Apprentice
*

Posts: 31
Likes Given: 6
Likes Received: 2 in 1 posts
Joined: Mar 2016
Reputation: 0



Post: #2
RE: Minimal Lumberjacking
Ok, I got working Lumberjacking with scripts-pack from GitHub...
That means that my build is ok, and problem is in scripts... uh...
02-19-2017 04:57 PM
Find all posts by this user Like Post Quote this message in a reply
Rostok
Apprentice
*

Posts: 31
Likes Given: 6
Likes Received: 2 in 1 posts
Joined: Mar 2016
Reputation: 0



Post: #3
RE: Minimal Lumberjacking
Om, i got it!

Seems that this section helped:

[ITEMDEF 01bdd]
DEFNAME=i_log
NAME=log%s
TYPE=t_log
VALUE=1
WEIGHT=0.5
DUPELIST=01bde,01bdf,01be0,01be1,01be2


[ITEMDEF i_Willow_log]
ID=i_log
DEFNAME=i_Willow_log
NAME=Willow log%s
VALUE=10
TYPE=T_LOG
WEIGHT=.5
CATEGORY=Resources
DESCRIPTION=Log
02-19-2017 06:01 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #4
RE: Minimal Lumberjacking
try using axe weapons (TYPE=t_weapon_axe), because I can't remember correctly but maybe swords (TYPE=t_weapon_sword) only get kindling instead logs from trees
(This post was last modified: 02-21-2017 07:14 AM by Coruja.)
02-20-2017 12:58 PM
Find all posts by this user Like Post Quote this message in a reply
Rostok
Apprentice
*

Posts: 31
Likes Given: 6
Likes Received: 2 in 1 posts
Joined: Mar 2016
Reputation: 0



Post: #5
RE: Minimal Lumberjacking
Thank you!
02-20-2017 03:14 PM
Find all posts by this user Like Post Quote this message in a reply
Rostok
Apprentice
*

Posts: 31
Likes Given: 6
Likes Received: 2 in 1 posts
Joined: Mar 2016
Reputation: 0



Post: #6
RE: Minimal Lumberjacking
Some new problem with gathering:

I cannot gather more resources than i set in AMOUNT

PHP Code:
[REGIONRESOURCE mr_tree]
AMOUNT=

I'm trying to create luck-chance to gather more resources sometimes and stuck with
PHP Code:
@ResourceFound
@Resourcegather 

Tryed to change ARGO.AMOUNT in @ResourceFound - fail

Tryed to change <ARGN1> in @Resourcegather - In this case i can get ONLY MAX amount from
PHP Code:
[REGIONRESOURCE mr_tree] - AMOUNT 
section. So if there are 3 , and i changed <ARGN1> to 30 , in this case i will get only 3 resources anyway, no more =(( .
I know, that resources are creating after @ResourceFound, so it is normal system behavior, but how i can get write-access to amount of resources?

Thank You!


Sphere 56d
(This post was last modified: 03-02-2017 06:01 PM by Rostok.)
03-02-2017 07:47 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: Minimal Lumberjacking
argn1 in @resourcegather works fine for me, remember that you can't get more resource than there are in the gembit (if the gembit have 10 resources, and you set argn1 to 30 you'll get 10 resources).
03-02-2017 09:15 PM
Find all posts by this user Like Post Quote this message in a reply
Rostok
Apprentice
*

Posts: 31
Likes Given: 6
Likes Received: 2 in 1 posts
Joined: Mar 2016
Reputation: 0



Post: #8
RE: Minimal Lumberjacking
(03-02-2017 09:15 PM)darksun84 Wrote:  argn1 in @resourcegather works fine for me, remember that you can't get more resource than there are in the gembit (if the gembit have 10 resources, and you set argn1 to 30 you'll get 10 resources).

Yes, i understand that.

Question is "How to set custom resources amount in gembit when gembit is created, or how to change it after creation?"

Thank you in advance!
03-02-2017 10:08 PM
Find all posts by this user Like Post Quote this message in a reply
Rostok
Apprentice
*

Posts: 31
Likes Given: 6
Likes Received: 2 in 1 posts
Joined: Mar 2016
Reputation: 0



Post: #9
RE: Minimal Lumberjacking
I will try <ARGO.AMOUNT> in @RegionResourceFound this evening ...

<ARGO.AMOUNT> in @ResourceFound failed - value always is "1" =((
03-03-2017 01:43 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #10
RE: Minimal Lumberjacking
I took a look in the save file and i noticed this:

//This is a gembit related to a lumberjacking resource
[WORLDITEM i_worldgem_bit]
SERIAL=040001fd4
TIMER=35808
AMOUNT=5
TYPE=t_tree
ATTR=092
MORE1=mr_tree
P=1522,1750,1

After we change the amount, this happens:

[WORLDITEM i_worldgem_bit]
SERIAL=040001fd4
TIMER=35808
AMOUNT=5
TYPE=t_tree
ATTR=092
MORE1=mr_tree
P=1522,1750,1
AMOUNT=10

Looks like that the new amount is added at the bottom of the item block instead of overwriting the previous value
03-03-2017 02:17 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
Post Reply 


Forum Jump:


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