HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Recipe System

09-13-2006, 11:58 PM#1
shadow1500
A template for making recipes.. its automated so you dont have to create a trigger for each recipe to add/remove the items, etc.
Works with advanced inventory systems (modify the abstract functions), it also supports charge based recipes.
Read the "Info" trigger on how to implement and use.

UPDATE 1.3:
- Uses latest CSCache (thus requiring JASSHelper)
- Should be a lot easier to implement now.
- Removed common functions; they are named differently so that they don't cause conflicts.

UPDATE: 1.1:
- Fixes pool leak
- Saves recipe data to gamecache for later use.

UPDATE 1.2
- Fixed some display bug
Attached Images
File type: jpgRS.jpg (64.6 KB)
Attached Files
File type: w3xRecipeSystem1.3.w3x (82.4 KB)
09-15-2006, 11:17 AM#2
Archian
Image reminds me of Diablo :P
Anyway, it sounds interesting, well done
09-15-2006, 01:06 PM#3
Chuckle_Brother
Good stuff, but there is probably a bunch of optimizations.

Collapse JASS:
    // Read recipe data from ability.
    loop
        set cur = GetAbilityEffectById(abilId,EFFECT_TYPE_TARGET,x)
        exitwhen cur==last
        set last = cur
        if SubString(cur,0,1)=="r" then
            set hav_Item[x] = CreatePool()
            set req_Count[x] = S2I(SubString(cur,2,4))
            set req_Item[x] = GetInteger(SubString(cur,5,StringLength(cur)))
            set reqsNum = reqsNum + 1
        elseif SubString(cur,0,1)=="g" then
            set got_Item = GetInteger(SubString(cur,2,StringLength(cur)))
        endif
        set x = x + 1
    endloop

Might it not be better here to save the values? for future use of the item-type? I dunno, maybe I am way off base, but it would kill future needs to do that substringing.

Anyway, good stuff here.*Thumbs up*
09-15-2006, 07:02 PM#4
shadow1500
Hm, yes, it will probably be faster. Now I noticed that I am also leaking pools . Version 1.1 coming soon to fix problems...

EDIT: Updated.
09-20-2006, 07:13 PM#5
shadow1500
bump
09-20-2006, 07:45 PM#6
The)TideHunter(
Zomg, how did i not see this before!
"Click the link to dl"
Testing now.

EDIT: I like it loads, very easy to use, code is easy to CnP, and it seems good. Goodjob on it!
09-20-2006, 08:55 PM#7
shadow1500
Quote:
Originally Posted by The)TideHunter(
Zomg, how did i not see this before!
"Click the link to dl"
Testing now.

EDIT: I like it loads, very easy to use, code is easy to CnP, and it seems good. Goodjob on it!

but the bump was for a mod review...

Its easy to CnP yes.. the problem comes with creating the recipes, since you need to know rawcodes for each ingridient/result, and also must create 2 abilities and 1 item for each recipe.
09-20-2006, 09:03 PM#8
Turkey_Slayer
Wasn't this the kind of recipe system that was going to go into ToB O? Very nice, by the way.
09-22-2006, 04:35 PM#9
blu_da_noob
There is no need to bump resource submissions. It's not like there are multiple pages and they might get lost. Order is of no significance either, so bumping can only serve to advertise.

Checking it out now.

Edit:
There is no need to null handle-type variables which are passed as arguements to a function.

Pretty basic thing, so approved otherwise.
09-22-2006, 05:16 PM#10
shadow1500
Quote:
Originally Posted by blu_da_noob
There is no need to bump resource submissions. It's not like there are multiple pages and they might get lost. Order is of no significance either, so bumping can only serve to advertise.

Checking it out now.
I noticed several times where new resource submissions would get reviewed over old resources. Besides it was a week old so I am allowed to bump it.

Quote:
Originally Posted by blu_da_noob
There is no need to null handle-type variables which are passed as arguements to a function.
Ah, I know, it was a trigger action before. It's no big deal, since the speed decrease is unnoticeable.
Anyway thanks for the approval.
09-22-2006, 05:17 PM#11
blu_da_noob
Quote:
Originally Posted by shadow1500
I noticed several times where new resource submissions would get reviewed over old resources. Besides it was a week old so I am allowed to bump it.

I almost always review older resources before newer ones, unless I have a reason not to. But that is beside the point, I was just mentioning that bumping in resource submissions is pointless and effectively spam.
09-22-2006, 05:27 PM#12
Aray
I finally got around to test it for real shadow :D It's great! Though some flashy effects when the items are created would be nice ;) Is it possible to make effects on the items as well? I mean, when the two items are combined, could there be a small duration with a golden "flash" around the new created item?
09-25-2006, 09:42 PM#13
Xandramas
I have an error when implimenting your system.

Expected a name (error)

set i = I2Item(PoolGetItem(hav_Item[x],y))

Do you know what this means or how to get around it?
09-25-2006, 10:31 PM#14
shadow1500
You're probably missing the I2Item function, make sure you have it in your map.
11-15-2006, 10:34 AM#15
Bones66
im having trouble implimenting this system ... everytime i copy it into my WE and save my WE crashes but only if CSCache and recipe system are enabled ... and now i cant enable them .

please help