Aller au contenu

Photo

Crafting events...


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
FramnkRulez

FramnkRulez
  • Members
  • 19 messages
Are there any events fired as a result of crafting?  I know that crafting GUI itself is started as the result of skill events, I'm just curious if an event happens when an item is created?

#2
FergusM

FergusM
  • Members
  • 460 messages
EVENT_TYPE_CRAFT_ITEM is fired (to the module script, I think?) when an item is crafted.

#3
FramnkRulez

FramnkRulez
  • Members
  • 19 messages
Is there any information that can be gleaned from this event other than the person who did the crafting? There do not seem to be any strings, ints, floats, resources or objects other than the character passed with this event. Is there a way to figure out what item was crafted during this event?

#4
TimelordDC

TimelordDC
  • Members
  • 923 messages
The brute force way is to check the items before and after the event is fired. Before would be to check when the game-mode changes to the crafting GUI and after would be in the craft_item event (don't even know if this will work but wouldn't hurt to try)

#5
FergusM

FergusM
  • Members
  • 460 messages
You can try setting the ITEM_SEND_ACQUIRED_EVENT variable in the items editor to 1 for your item. This makes it send EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED to the module script when you gain the item. I'm not sure if this works for items gained through crafting, but I don't see why not. Presumably the item acquired is the 0th event object.

Modifié par FergusM, 15 juillet 2010 - 12:51 .


#6
FramnkRulez

FramnkRulez
  • Members
  • 19 messages
Good suggestions, thanks!