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!

[New, 0.92] Built-in Crafting

Discussion in 'Discussion' started by kurozael, Nov 30, 2014.

  1. kurozael

    kurozael Cloud Sixteen Director Staff Member Administrator Investor

    https://github.com/CloudSixteen/Clockwork/commits/master

    Added a built-in crafting / recipe system. All recipes will show up and integrate into the regular Business menu!

    Use ITEM:AddRecipe(uniqueId, amount, uniqueId, amount, uniqueId, amount, ...) to add recipes.

    Items can have multiple recipes. AddRecipe returns a table, which you can use .access, .factions, .classes to prohibit access to it.

    Say you have 3 items. Milk Jug, Melon, and Melon Milk. In the Melon Milk item:

    Code:
    ITEM:AddRecipe("milk_jug", 2, "melon", 3);
    
    Then, in the business menu you can craft Melon Milk with 2 milk jugs and 3 melons.

    If you wanted to add an additional recipe, and only allow people with 'k' flag to use it for some reason:

    Code:
    local recipe1 = ITEM:AddRecipe("milk_jug", 2, "melon", 3);
    
    local recipe2 = ITEM:AddRecipe("milk_jug", 1, "melon", 1);
    recipe2.access = "k";
    
    -- You can also use .classes and .factions to set custom permissions, too, just like any item can have.
    
    [​IMG]
     
  2. sparkz

    sparkz FUCK! Clockwork Customer

    Hell yeah.

    Good job, kuro.
     
  3. NightAngel

    NightAngel Fuck off Lev

    Everyone and their dog have made a crafting thing now, even kuro's done it. xD

    Good job, though, nice to see it's built in now.
     
  4. The Dovahneer

    The Dovahneer i can change my title

    kuro, could you add in a way to disable this?
     
  5. kurozael

    kurozael Cloud Sixteen Director Staff Member Administrator Investor

    To disable it just don't add any recipes. There are no default items or recipes in Clockwork.
     
  6. MistyPanda

    MistyPanda I hate everything!

    Woah, very nice kuro.
     
  7. RJ

    RJ no pay Legend Clockwork Customer

    That's probably not the best way to have it.
     
  8. kurozael

    kurozael Cloud Sixteen Director Staff Member Administrator Investor

    Feel free to submit a pull request for a config option :)
     
  9. RJ

    RJ no pay Legend Clockwork Customer

    Can't at the moment, don't have resources available for testing. But yeah, having a config option would be good, promotes the modularity that CW is great for.
     
  10. NightAngel

    NightAngel Fuck off Lev

    If I could learn how github works, I'd be happy to submit some stuff. I'm just intimidated by how confusing it is, and I don't want to break anything. ;3;
     
  11. Sir Trolled

    Sir Trolled Guest

    Should've been there from the start, but meh.

    Kudos kuro. I like this,
     
  12. Sheeplie

    Sheeplie Hi.

    .. melon milk? Looooool
     

Previous Readers (Total: 0)