1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

[Release] Clockwork Recipe Library

Discussion in 'Development' started by SomeSortOfDuck, Feb 20, 2014.

  1. An easy to use recipe library for crafting is in the works.

    Syntax
    Returns a RECIPE object.


    Registers a new recipe, as well as returning it.


    Attempts to craft the recipe with the given player's items.


    Adds an item to the table of required items for a recipe. Optional amount (defaults to 1 if not specified).


    Adds an item to the table of items given to the player after the craft is executed. Optional amount (defaults to 1 if not specified).


    Called when the recipe has been successfully crafted. Return a string for a success message to be displayed.


    Called when the recipe has failed to craft. Return a string for an error message to be displayed.


    Hooks

    Called when a player crafts a recipe.

    Called when a player fails to craft a recipe.

    Example
    [​IMG]
     
  2. Razor

    Razor Guest

    Re: Clockwork Recipe Library

    Good job, I see you grabbed some ideas (mostly the format of the thing and two hooks) from KuroCrafting.
     
  3. Re: Clockwork Recipe Library

    Nah. Only reason I am making this is to complement Polis' plugin since the way he did it wasn't optimal, using if statements and such. The key part of this library was the object orientation. The format I'm following is the basic CW library format of creating a new object, setting the properties, and then registering it.
     
  4. Datzy

    Datzy Guest

    Re: Clockwork Recipe Library

    I don't think that this conclusion should be made when it's simply a (hopefully) common design for the code. And, the hooks are just OnX.... return "" .... end -- nothing special or personal to you.
     
  5. kurozael

    kurozael Cloud Sixteen Director Staff Member Administrator Investor

    Re: Clockwork Recipe Library

    Would be useful in Clockwork by default... *cough* GitHub *cough*
     
  6. Re: Clockwork Recipe Library

    Sure, I'll put it on it when I think of a few more features.

    I need some suggestions. Also, would you be able to make a menu for it? I am awful with derma. All recipes are in Clockwork.recipe.stored and have two tables: required and output. The keys in the tables are the uniqueID of the item and the values are the amount.
     
  7. RJ

    RJ no pay Legend Clockwork Customer

    Re: Clockwork Recipe Library

    player:TakeItem(player:FindItemByID("item_id"))

    Y u snip?
     
  8. Re: Clockwork Recipe Library

    Cause I figured it out :p

    Thanks, though.
     
  9. kurozael

    kurozael Cloud Sixteen Director Staff Member Administrator Investor

    Re: Clockwork Recipe Library

    Even without a menu the lib would be useful. A schema developer could make a menu.
     
  10. Re: Clockwork Recipe Library

    I was planning on tailoring it for devs and casual modders but I guess it'll have to do without a menu.
     
  11. https://github.com/CloudSixteen/Clockwork/pull/103
     

Previous Readers (Total: 0)