Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pick and digg
Author Message
PurpleHaze
Apprentice
*

Posts: 10
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Jan 2018
Reputation: 0



Post: #1
pick and digg
Hi there,
I have a little problem with my pick.
Code:
[ITEMDEF i_pickmagic]
ID=i_pickaxe
NAME=Magic Pickaxe

ON=@Create
MOREY=10

ON=@Targon_Ground
if (<src.targ.type>==t_terrain type)
MOREY=(<eval <morey>>-1)
Return 0
else
Return 1
endif

Terrible problem - my hero simply stands and does not dig.
07-28-2018 07:28 PM
Find all posts by this user Like Post Quote this message in a reply
Darkyhood
Apprentice
*

Posts: 36
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Mar 2012
Reputation: 0



Post: #2
RE: pick and digg
(07-28-2018 07:28 PM)PurpleHaze Wrote:  if (<src.targ.type>==t_terrain type)
Should be just t_terrain and you should have this type in your scripts. For debug you can add some logs and fix this problem by self. For example:
Code:
[ITEMDEF i_pickmagic]
ID=i_pickaxe
NAME=Magic Pickaxe

ON=@Create
MOREY=10

ON=@Targon_Ground
if (<src.targ.type>==t_terrain type)
MOREY=(<eval <morey>>-1)
serv.log I can dig!
Return 0
else
serv.log Something wrong!
Return 1
endif
07-28-2018 11:18 PM
Find all posts by this user Like Post Quote this message in a reply
PurpleHaze
Apprentice
*

Posts: 10
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Jan 2018
Reputation: 0



Post: #3
RE: pick and digg
Code:
ON=@Targon_Ground
if (<src.targ.type>==t_rock)
MOREY=(<eval <morey>>-1)
serv.log I can dig!
Return 0
else
serv.log Something wrong!
Return 1
endif

I have a message - Something wrong!
(This post was last modified: 07-29-2018 06:56 AM by PurpleHaze.)
07-29-2018 06:55 AM
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: pick and digg
you're already using an debug msg to track the script behavior, but your msg is not showing the most important value that you're looking for: <SRC.TARG.TYPE>

Code:
ON=@Targon_Ground
SERV.LOG Targ type is '<SRC.TARG.TYPE>'

maybe this should help you get this missing <SRC.TARG.TYPE> value to fix the code
07-29-2018 04:24 PM
Find all posts by this user Like Post Quote this message in a reply
PurpleHaze
Apprentice
*

Posts: 10
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Jan 2018
Reputation: 0



Post: #5
RE: pick and digg
01:58:(minew.scp,910)Targ type is '0'
01:58:(minew.scp,916)Something wrong!

My terrain type is - t_Rock

why I cant mine?
07-31-2018 09:01 AM
Find all posts by this user Like Post Quote this message in a reply
fabiohvp
Apprentice
*

Posts: 23
Likes Given: 11
Likes Received: 5 in 4 posts
Joined: Jul 2018
Reputation: 0



Post: #6
RE: pick and digg
According to wiki you get that target (ground) by ARGN1
http://wiki.spherecommunity.net/index.ph...gOn_Ground

[ITEMDEF i_pickmagic]
ID=i_pickaxe
NAME=Magic Pickaxe

ON=@Create
MOREY=10

ON=@Targon_Ground
if (<serv.ITEMDEF.<ARGN1>.type>==t_terrain)
MOREY=(<eval <morey>>-1)
serv.log I can dig!
Return 0
else
serv.log Something wrong!
Return 1
endif
(This post was last modified: 07-31-2018 01:03 PM by fabiohvp.)
07-31-2018 01:03 PM
Find all posts by this user Like Post Quote this message in a reply
PurpleHaze
Apprentice
*

Posts: 10
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Jan 2018
Reputation: 0



Post: #7
RE: pick and digg
Thank you Brazil friends!
08-01-2018 05:07 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)