SphereCommunity
Minimal Lumberjacking - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Minimal Lumberjacking (/Thread-Minimal-Lumberjacking)

Pages: 1 2


Minimal Lumberjacking - Rostok - 02-19-2017 03:44 PM

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 =(


RE: Minimal Lumberjacking - Rostok - 02-19-2017 04:57 PM

Ok, I got working Lumberjacking with scripts-pack from GitHub...
That means that my build is ok, and problem is in scripts... uh...


RE: Minimal Lumberjacking - Rostok - 02-19-2017 06:01 PM

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


RE: Minimal Lumberjacking - Coruja - 02-20-2017 12:58 PM

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


RE: Minimal Lumberjacking - Rostok - 02-20-2017 03:14 PM

Thank you!


RE: Minimal Lumberjacking - Rostok - 03-02-2017 07:47 AM

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


RE: Minimal Lumberjacking - darksun84 - 03-02-2017 09:15 PM

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).


RE: Minimal Lumberjacking - Rostok - 03-02-2017 10:08 PM

(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!


RE: Minimal Lumberjacking - Rostok - 03-03-2017 01:43 AM

I will try <ARGO.AMOUNT> in @RegionResourceFound this evening ...

<ARGO.AMOUNT> in @ResourceFound failed - value always is "1" =((


RE: Minimal Lumberjacking - darksun84 - 03-03-2017 02:17 AM

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