Page 1 of 1

Lumberjacking and mining

Posted: Sun Dec 05, 2010 6:18 pm
by phao
How are those two skills implemented?

I'm interested to know how you guys recognize the player is clicking in a mining floor and the player is clicking on tree?

Do you use target() and check if the graphic of the target is one of a tree, or the object type?

Do you use regions for mining, or also graphic/object type of the target?

That requires a big list of graphics/object types to check, if that's the case... is there any already done?

Is there anything on CORE that does part of this process of checking?

Re: Lumberjacking and mining

Posted: Tue Dec 07, 2010 12:46 pm
by kevin
phao wrote:Do you use target() and check if the graphic of the target is one of a tree, or the object type?
Use TargetCoordinates(), then check the resulting value's objtype. You can't Target() a maptile, you will get "What you selected does not seem to exist."

phao wrote:That requires a big list of graphics/object types to check, if that's the case... is there any already done?
Yes, look at include file :mining:mining's IsMinable() function in distro scripts 097.

phao wrote:Is there anything on CORE that does part of this process of checking?
It is not handled by the core.