System Artificial's Recipe System

Discussion in 'Systems and Snippets' started by Artificial, Aug 8, 2008.

  1. Artificial

    Artificial Without Intelligence

    Ratings:
    +325 / 0 / -0
    That's a result of this:
    JASS:
    //          - When used on an recipe added via the charged recipe thingy
    //            the ingredient items won't recieve the amount of items they
    //            had when the result was made, but the default amount of charges.
     
  2. Nexor

    Nexor ...

    Ratings:
    +74 / 0 / -0
    Oh I see, and can this system be used for a recipesystem like the one DotA uses?
     
  3. TriggerHappy

    TriggerHappy ...

    Ratings:
    +341 / 0 / -0
    If dota combines items them yes.
     
  4. Artificial

    Artificial Without Intelligence

    Ratings:
    +325 / 0 / -0
    DotA's recipe system isn't that weird from what I know. The finest thing in it is that it allows an item type to be used multiple times in a recipe, which is something this system (and many others) allows as well. :p
     
  5. Nexor

    Nexor ...

    Ratings:
    +74 / 0 / -0
    but dota is using items that are used when picked up(like runes, so you can pick them up when your inventory is full)
     
  6. Romek

    Romek Super Moderator Staff Member

    Ratings:
    +961 / 0 / -0
    That's nothing to do with recipes.
    Wc3 has runes in the actual game itself.
    Play through the campaign. The very first mission has about 20 of them.

    DotA didn't make Wc3.
     
  7. Tom_Kazansky

    Tom_Kazansky --- wraith it ! ---

    Ratings:
    +157 / 0 / -0
    there still a "smart" order when you ordered a hero to pick up item, even his inventory is full.
    And it's nothing VERY special, it just checks recipes with the item in the ground and the items in inventory (so there are 7 items to check)

    I have made a demo map, check it out.
    I modify the Game Interface so there is no "Inventory is full" error message, you should display it by yourself.

    And there is one problem, I don't know how to queue a unit's order by trigger :(, anyone know this ?

    @Artificial, sorry for modifying your system.

    EDIT: removes unnecessary debugs
    Fixed a bug that allows 1 item to "self combine" when a recipe has several items of the same type as ingredients. :(
     

    Attached Files:

    • Like Like x 1
  8. Andrewgosu

    Andrewgosu The Silent Pandaren Helper Staff Member

    Ratings:
    +711 / 0 / -0
    One of the most fluent and elaborate recipe systems out there.

    Resource approved.


    P.S I took the liberty to clean the thread of bumps and double posts.

    Andrewgosu
     
    • Like Like x 1
  9. DruiD-Mk

    DruiD-Mk New Member

    Ratings:
    +0 / 0 / -0
    Hey guys I am quite new here.. Mm. I am making maps for some time but i never used triggers so i need a little help so that I can add my recipes...
    I tried to use this system and I can't enable the trigger..
    It says:
    Line 217: Expected a function name
    What should I do ? Please help me out.

    Btw on my map i just made a custom script like this:
    call AddRecipe('evtl', 'lhst', 0, 0, 0, 0, 'ward')
     
  10. Ryuu

    Ryuu I am back with Chocolate (:

    Ratings:
    +64 / 0 / -0
  11. brc

    brc New Member

    Ratings:
    +1 / 0 / -0
    I was just wondering how do i make it so that only heroes can combine items because in my map units and buildings all have an inventory. Also if i take out the disassembling and disabling a recipe part of the trigger, will it get messed up? Thanks and +rep Artificial!
     
    • Like Like x 1
  12. Artificial

    Artificial Without Intelligence

    Ratings:
    +325 / 0 / -0
    > how do i make it so that only heroes can combine items
    Set AUTO_COMBINE to false and then create this trigger:
    Trigger:
    • Combine
      • Events
        • Unit - A unit Acquires an item
      • Conditions
        • ((Triggering unit) is A hero) Equal to True
      • Actions
        • Custom script: call RecipeSYS_Combine(GetManipulatedItem(), GetTriggerUnit())


    > if i take out the disassembling and disabling a recipe part of the trigger
    If you don't want to use those, then you can just not use them anywhere. They aren't called unless you call them somewhere in your code yourself, so there isn't any need to remove them. Eg. if you only have the example trigger shown in the first post (the GUI one), the players won't be able to disassemble/disable recipes.

    But anyway, removing the disassembling functions shouldn't do any harm, but removing the 'enabled' member from the struct will cause some syntax errors, so you'd need to edit the system's code in several other places, too (IIRC).
     
  13. brc

    brc New Member

    Ratings:
    +1 / 0 / -0
    Thanks it works perfectly now. :D
     
  14. RaiJin

    RaiJin New Member

    Ratings:
    +40 / 0 / -0
    what if u just want to combine 2 items?

    JASS:
    call AddRecipe('B000', 'B001', 0, 0, 0, RESULT)


    what do i set the other values too...
     
  15. Artificial

    Artificial Without Intelligence

    Ratings:
    +325 / 0 / -0
    JASS:
    
    //      If you want the recipe to require less than 6 items, just give
    //      zeros as ingredient arguments.

    So you'd use
    JASS:
    call AddRecipe('B000', 'B001', 0, 0, 0, 0, RESULT)

    (just had to add one zero there).
     
  16. pdhc

    pdhc New Member

    Ratings:
    +0 / 0 / -0
    can someone explain how to convert the code from vJASS to JASS using NewGen? thanks
     
  17. Expelliarmus

    Expelliarmus Where to change the sig?

    Ratings:
    +48 / 0 / -0
    I don't think there is a button for that...
    You will need to do it manually, however some features of vJass (eg Structs) are harder to 'convert'.
     
  18. A.Dominion

    A.Dominion New Member

    Ratings:
    +0 / 0 / -0
    how to make it compatible with Bag system?

    for example you carry bag in you inventory that stock item, so in the end you have more than 6 items carried by yourself...:)

    is it possible to check all item carried (even in the bags) to create recipe, and if so is it possible to create recipe with more than 6 items?
    i guess that would also pose problem with compatibility between the jass code in the bag system and in you code...

    but well just asking and maybe giving new ideas on things to implement (like a system combining: recip, bag, and stacking charge) :eek:

    well your system look pretty cool so if i manage to use newgen i might use your system, unless i can make an easier one myself that isn't as customizable as yours but would be matching just the need of my map..:shades:
     
  19. Chao

    Chao Setting sail for fail in the sea of lame.

    Ratings:
    +63 / 0 / -0
    I think I made a big mistake.

    I'm attempting to import your Recipe System, but cut all of my custom items from the same mould; thus, the rawcode for nearly all of my items is the exact same. Is there a way I can input the Ingredient variable to apply my items?

    Danke!
     
  20. Artificial

    Artificial Without Intelligence

    Ratings:
    +325 / 0 / -0
    @A.Dominion
    I guess it would be possible to also check from the bags, but that really depends on the bag system. The reason I didn't make this compatible with bag systems was that I didn't come up with any way that'd work with any given bag system, as I believe they work rather differently. ;p

    @Chao
    Multiple items cannot have the same rawcode, even if they were based on the same item. When you take the rawcode, you take the four first chars. The custom items' rawcodes in the object editor are like this:base where 'this' is the rawcode of the item itself and 'base' is the rawcode of the base item.

    For example when I created a custom item based on Runed Bracers (brac), the rawcode shown in the object editor was I000:brac. The I000 part was the item's rawcode.
     
    • Like Like x 1

Share This Page