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
SkillMakeItem Trigger
Author Message
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #1
SkillMakeItem Trigger
Hey mates, i need some help again, when crafting tailoring or carpentry items... how could i make a reference of the t_sewing_kit of t_carpentry kit used???

ACT The item that was crafted.
ARGO The item that the item was crafted from. // usually resources like hides or logs, etc..
I The character who crafted the item.
SRC The character who crafted the item.

// ITEM where the target was originated from?

is it possible to add a new reference for item kit used?

on those cases it's necesary to double click it to bring the crafting menu up. but i cant figure how to make a reference of this item to store it.. so, forconttype would work but wouldnt be precise in case i have 2 or more of this type items backpacked.... so...
any suggestions?
(This post was last modified: 08-06-2014 07:15 AM by kn4tseb.)
08-06-2014 07:03 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #2
RE: SkillMakeItem Trigger
use @skillmakeitem and findtype, example:
Code:
on=@skillmakeitem //player event
if (<serv.skill.<action>.key>==carpentry)
  findtype.t_carpentry.XXX //xxx being function/value to alter
elseif (<serv.skill.<action>.key>==tailoring)
  findtype.t_sewing_kit.XXX //again, function or value to alter
elseif (<serv.skill.<action>.key>==tinkering)
  findtype.t_tinker_tools.XXX //etc..
endif

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
08-06-2014 07:58 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #3
RE: SkillMakeItem Trigger
uhmmm what would the function or value to alter be for example???
i dont see how it would make a difference between two same type items..

im trying to recreate somekind of "tailor runic tools" so i need to be as accure as possible identifing whichone is backpacked and used when crafting.
(This post was last modified: 08-06-2014 08:35 AM by kn4tseb.)
08-06-2014 08:34 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #4
RE: SkillMakeItem Trigger
ah, ok, you'll need to add the special tool to the SKILLMAKE of the item to be crafted, example:
Code:
SKILLMAKE=TAILORING 60.0, i_sewing_kit_special
RESOURCES=100 i_cloth, 10 i_thread

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
08-06-2014 08:48 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #5
RE: SkillMakeItem Trigger
uhmmm.. i still dont get it

if i have i_sewing_kit_special1 and i_sewing_kit_special2 both items have charges (uses)

and when i craft an item i want that a specified one to be its charges decrease by one, how would i be able to make a reference of it?.

this is what i have at the moment.

Code:
ON=@SkillMakeItem
IF strmatch(*t_armor_leather*,<act.type>)
forconttype t_sewing_kit
   if <baseid> == i_sewing_kit_runic_spined || <baseid> == i_sewing_kit_runic_horned || <baseid> == i_sewing_kit_runic_barbed
      ref1 = <uid>
   endif
endfor
IF <REF1>
   ref1.tag0.uses -= 1
   ref1.update
   ref1.<runicarmorsattr> // function
ENDIF

But the thing is what if i have more than one of those items or more than one of this special items... with this code, its not totally accure to specify the item i want to be used..
(This post was last modified: 08-06-2014 09:08 AM by kn4tseb.)
08-06-2014 08:59 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #6
RE: SkillMakeItem Trigger
Might be better off creating an [itemdef] for each spine/horned/barbed leather item and a sewing kit for each. I use a spined/horned/barbed leather script on my server and it uses special hides rather than a sewing kit to create. But seeing how you want it done, you might want to check for the 'best' sewing kit (being barbed) and use it accordingly:
Code:
on=@skillmakeitem
if (<act.type>==t_armor_leather)
  if (<findid.i_sewing_kit_runic_barbed>)
    ref1=<findid.i_sewing_kit_runic_barbed>
  elseif (<findid.i_sewing_kit_runic_horned>)
    ref1=<findid.i_sewing_kit_runic_horned>
  elseif (<findid.i_sewing_kit_runic_spined>)
    ref1=<findid.i_sewing_kit_runic_spined>
  endif
  if (<ref1.uid>)
    ref1.tag0.uses -= 1
    ref1.<runicarmorsattr> // function
    if (<ref1.dtag0.uses> < 1)
      ref1.destroy
    endif
  endif
endif

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
08-06-2014 09:34 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #7
RE: SkillMakeItem Trigger
If you looking for a way to find out which sewing kit is used when sphere runs makeitem, well your out of luck because sphere doesn't use a specific item, but rather just checks to see if one is present in the pack.
So you will have to keep going with a custom way to pick a specific one.

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
08-06-2014 01:04 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #8
RE: SkillMakeItem Trigger
Thx skull, gonna try it, by the way BEN, when crafting tailoring items it's neccesary to double click the i_sewing_kit and a target cursor appears, so, is it possible to add a feature for this trigger to refer the item that creats the target???

thanks in advance Smile
08-06-2014 02:35 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #9
RE: SkillMakeItem Trigger
Well, actually Sphere doesnt store the tool, as Ben said, you can do something like this for example when double clicking a tool:

Code:
ON=@DClick
src.ctag.current_tool=<uid>

ON=@SkillMakeItem
ref1=<ctag0.current_tool>

Adding something to the source will be adding just this, the only difference is that you won't see it XD.
08-06-2014 05:09 PM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #10
RE: SkillMakeItem Trigger
Hahahahaha, thats fine, thank you all Smile
08-07-2014 08:32 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)