System Matrix Recipe System

Matrix

New Member
Reaction score
5
My first sytem I've created.
**************************************************************************************
*************************Simple Recipe System v1.01***********************************
**********************************************************************************
******************************By: Matrix****************************************
Pros:
1) Allow same item-types [like Stygian Desolator]
2) Consists of 74 lines
3) Can be used not only for Jassers/vJassers but also for GUI users
4) It is the simpliest system I've ever seen:)
Cons:
The only thing it's bad is if's. Due to them it's not very fast
*******************
**Changelog v1.02**
*******************
1) Added RecipeEx function
2) Now function returns a boolean depending on wether the recipe succeeded or not
3) More Cleaner&Leakless code
*******************
**How to implant:**
*******************
The system is very easy. The only things you'll have to do to implement the system is to
copy the custom script code
*******************
**How to use:******
*******************
To use this system u have to have a trigger with the event unit pick up item and in the actions
just write:
call Recipe(GetTriggerUnit(),'rde3','rde1','rde1',0,0,0,0)
Arguments:
GetTriggerUnit() - Unit that picked up item //I think it is clear
'rde3' - The New Item rawcode (the rawcode of the item that must be created)
'rde1' - The Rawcode of the first ingredient
'rde1' - The Rawcode of the second ingredient
0 - The Recipe hasn't more ingredients so the 3,4,5,6 ingredient are 0

************************
*****Trouble Shooter****
************************
Q: I have some troubles with this system. It doesn't work!!!
A: The reason maybe globals. If u have global integer i, i1,i2,i3,i4,i5,i6,count,j,ni... and all the arguments the system works with.
If u havent JassNewGenPack all must be Ok.

Q: Why did u do this shit?
A: I'm cr8ing an AoS map and I was searching for a simple recipe sytem but I didn't find=(
That's why I decided to cr8 my own =)


Hopefully you like the system!
~Matrix 3.08.08

P.S. I think I found my new home...
It's thehelper.net - really helper
Thx a lot to Earth-Fury for his suggestion
JASS:
function Recipe takes unit hero, integer ni, integer i1, integer i2, integer i3, integer i4, integer i5, integer i6, string Effect, string where returns boolean
local integer id
local integer i = 0
local integer j = 1
local integer count = 0
local item array Items
local item it = null
if i1!=0 then
   set count = count+1
endif
if i2!=0 then
   set count = count+1
endif
if i3!=0 then
   set count = count+1
endif
if i4!=0 then
   set count = count+1
endif
if i5!=0 then
   set count = count+1
endif
if i6!=0 then
   set count = count+1
endif
loop
    exitwhen i>5
    set it = UnitItemInSlot(hero, i)
    set id = GetItemTypeId(it) 
    if id == i1 and i1!=0 then
           set Items[j] = it
           set j = j+1
           set i1=0
    elseif id == i2 and i2!=0 then
           set Items[j] = it
           set j = j+1
           set i2=0
    elseif id == i3 and i3!=0 then
           set Items[j] = it
           set j = j+1
           set i3=0
    elseif id == i4 and i4!=0 then
           set Items[j]= it
           set j=j+1
           set i4=0
    elseif id == i5 and i5!=0 then
           set Items[j] = UnitItemInSlot(hero, i)
           set j=j+1
           set i5=0
    elseif id == i6 and i6!=0 then
           set Items[j] = it
           set j=j+1
           set i6=0
    endif
    set i = i+1
endloop
set i = 1
if j-1!=count then
   return false
endif
loop
    exitwhen i>count
    call RemoveItem(Items<i>)
    set Items<i>=null
    set i = i+1
endloop 
set it = null
set bj_lastCreatedItem = UnitAddItemById(hero, ni)
call DestroyEffect(AddSpecialEffectTarget(Effect,hero,where))
return true
endfunction
function RecipeEx takes unit hero, integer ni, integer i1, integer i2, integer i3, integer i4, integer i5, integer i6 returns boolean
    return Recipe(hero,ni,i1,i2,i3,i4,i5,i6,null,null)
endfunction</i></i>

Download Simple Recipe System v1.02
 

Trollvottel

never aging title
Reaction score
262
maybe you want to add implementation instructions and a little argumentation why to use this system and not the other systems which are out here? I for myself would prefer a system for which i only set the ingredients of a recipe and which automatically combines them.
 

Kenny

Back for now.
Reaction score
202
Maybe put the script in JASS tags, and also i think i found something wrong with the script.

JASS:
if i6!=0 then
   set count = count+1
   set ItemIde[count]=i6 // ItemIde ??? 
endif
 

Matrix

New Member
Reaction score
5
2 Trollvotell
I just search a simple system withouy cache but i Did'nt find it.
So that's why I've cr8ed this one..
 

Romek

Super Moderator
Reaction score
964
Don't Double Post.
Use JASS tags.
Stop saying "cr8ed". I keep thinking its "Cried" and it's easier to read "created"

Saying what it does (Although its obvious) and actually saying what the arguments are would help.
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
Geez, another one? :/
Lines mean nothing, it's the performance that counts.

Isn't there one already in the Systems section?
 

SerraAvenger

Cuz I can
Reaction score
234
2 Trollvotell
I just search a simple system withouy cache but i Did'nt find it.
So that's why I've cr8ed this one..

what about mine?
It is currently outdated and will be changed to constant speed in a few weeks though ( using hashtables ). This will also allow for more than just 2 items per recipe : D

Mine just takes the recipes and then combines automatically.
I do however not remember wether 2 of the same items were allowed...
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
> 2) Allow double item types [as Stygian Desolator in Dota]
You should give a better example. Some people may not know what Stygian Desolator because they haven't played DotA. Maybe you could edit it like:
2) Allow double item types (like combining 2 Gloves of Haste into something new)
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
JASS:
function RecipeEx takes unit hero, integer ni, integer i1, integer i2, integer i3, integer i4, integer i5, integer i6 returns boolean
    return Recipe(hero,ni,i1,i2,i3,i4,i5,i6,null,null)
endfunction

Erm... RecipeEx should have more arguments then Recipe... Ex = Extended, usually. That's how the other JASS functions work, the Ex version has more arguments(Most of them, it's a Z coordinate added - Some of the lightning ones have this).

Really, Recipe should call RecipeEx and give "" as the argument for the strings, not the other way around.

To use this system u have to have a trigger with the event unit pick up item and in the actions
just write:
call Recipe(GetTriggerUnit(),'rde3','rde1','rde1',0,0,0,0)
How about you give a working example? That will give a "not enough arguments" error, as Recipe also takes two strings.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
I don't see a difference between this and the multiple other "recipe" systems.

As long as this doesn't offer something unique it's graveyarded.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top