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:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating New Gathering Skill
Author Message
RanXerox
Master
**

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



Post: #5
RE: Creating New Gathering Skill
Here is a simple example of adding a TYPEDEF to an item.

Here is the TYPEDEF that lets you cut a cake (i_cake_tiered) into 6 slices (i_cake_tiered_slice):

Code:
[TYPEDEF t_kitchenknife]
ON=@DClick
   TARGET
   RETURN 1
ON=@TargOn_Item
   IF (!STRCMPI(i_cake_tiered,<ARGO.DEFNAME>))
      IF (<ARGO.TOPOBJ>!=<SRC>)
         SRC.SYSMESSAGELOC color_text,1042001//"That must be in your backpack for you to use it."
         RETURN 1
      ENDIF
      FOR 6
         SERV.NEWITEM i_cake_tiered_slice,1,<SRC>
         NEW.COLOR=<ARGO.COLOR>
      ENDFOR
      ARGO.REMOVE
   ENDIF
   //FIXME: add more code like this for carving wheel of cheese and pie
   RETURN 1

...Here is an example of me giving this ability to all kitchen knives:

Code:
[ITEMDEF 09a5]
DEFNAME=i_knife
FLIP=1
VALUE=6
WEIGHT=0.1
RESOURCES=1 i_ingot_iron
SKILLMAKE=Tinkering 12.0,t_tinker_tools
CATEGORY=Decoration - Kitchen and Dining
SUBSECTION=Table Settings
DESCRIPTION=Butter Knife
DUPELIST=09a6,09f6,09f7
TEVENTS=t_kitchenknife

The nice thing about using TEVENTS like this is that all existing in-game i_knife objects will instantly get this new ability!

If you want to dynamically add this ability to a item in-game that normally doesn't have it, you can do that too. Just type this in-game:

.set EVENTS +t_kitchenknife

...and then target the item that you want to be able to carve cake (for example, maybe the prize for your lumberjacking contest is a carpentry saw that can cut cakes!)

Note: You can remove EVENTS from items using a - instead of the + but you can NOT remove TEVENTS from an item since they are permanently defined in the ITEMDEF itself.

Your harvesting tool would use a similar technique.

The @DClick trigger calls up the target reticule.

The @TargOn_Item would be used to detect logs that you manually placed in-game while decorating and @TargOn_Ground would detect static logs that are baked into the map itself. Both of those triggers would then trigger the skill itself (I am not precicely sure how to code that having never tried it before.)
(This post was last modified: 09-05-2013 03:19 PM by RanXerox.)
09-05-2013 03:11 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Creating New Gathering Skill - Archaaz - 09-05-2013, 03:44 AM
RE: Creating New Gathering Skill - Archaaz - 09-05-2013, 02:23 PM
RE: Creating New Gathering Skill - RanXerox - 09-05-2013 03:11 PM
RE: Creating New Gathering Skill - Archaaz - 09-05-2013, 09:48 PM
RE: Creating New Gathering Skill - Archaaz - 09-06-2013, 06:47 PM
RE: Creating New Gathering Skill - Archaaz - 09-07-2013, 07:06 PM

Forum Jump:


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