wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Samples
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 09-13-2006, 11:58 PM   #1
shadow1500
STARCRAFT II OMFG
 
shadow1500's Avatar
 
Join Date: Jul 2004
Posts: 1,004

Submissions (9)

shadow1500 is just really nice (306)shadow1500 is just really nice (306)shadow1500 is just really nice (306)

Send a message via ICQ to shadow1500 Send a message via AIM to shadow1500 Send a message via MSN to shadow1500
Default Recipe System

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: jpg RS.jpg (64.6 KB, 2749 views)
Attached Files
File Type: w3x RecipeSystem1.3.w3x (82.4 KB, 1442 views)

Last edited by shadow1500 : 01-30-2007 at 08:24 PM.
shadow1500 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 09-15-2006, 11:17 AM   #2
Archian
Dark & Ominous
 
Archian's Avatar


Project Leader: LoC
 
Join Date: Apr 2006
Posts: 1,459

Submissions (27)

Archian is a glorious beacon of light (477)Archian is a glorious beacon of light (477)Archian is a glorious beacon of light (477)Archian is a glorious beacon of light (477)

Default

Image reminds me of Diablo :P
Anyway, it sounds interesting, well done
Archian is offline   Reply With Quote
Old 09-15-2006, 01:06 PM   #3
Chuckle_Brother
Oh for the sake of fudge
 
Chuckle_Brother's Avatar


Respected User
 
Join Date: Dec 2005
Posts: 782

Submissions (2)

Chuckle_Brother will become famous soon enough (53)Chuckle_Brother will become famous soon enough (53)

Send a message via ICQ to Chuckle_Brother Send a message via AIM to Chuckle_Brother Send a message via MSN to Chuckle_Brother Send a message via Yahoo to Chuckle_Brother
Default

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*
__________________
"...you play a mean banjo"
Chuckle_Brother is offline   Reply With Quote
Old 09-15-2006, 07:02 PM   #4
shadow1500
STARCRAFT II OMFG
 
shadow1500's Avatar
 
Join Date: Jul 2004
Posts: 1,004

Submissions (9)

shadow1500 is just really nice (306)shadow1500 is just really nice (306)shadow1500 is just really nice (306)

Send a message via ICQ to shadow1500 Send a message via AIM to shadow1500 Send a message via MSN to shadow1500
Default

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.

Last edited by shadow1500 : 09-15-2006 at 07:48 PM.
shadow1500 is offline   Reply With Quote
Old 09-20-2006, 07:13 PM   #5
shadow1500
STARCRAFT II OMFG
 
shadow1500's Avatar
 
Join Date: Jul 2004
Posts: 1,004

Submissions (9)

shadow1500 is just really nice (306)shadow1500 is just really nice (306)shadow1500 is just really nice (306)

Send a message via ICQ to shadow1500 Send a message via AIM to shadow1500 Send a message via MSN to shadow1500
Default

bump
shadow1500 is offline   Reply With Quote
Old 09-20-2006, 07:45 PM   #6
The)TideHunter(
SpeakerGames.com
 
The)TideHunter('s Avatar
 
Join Date: Mar 2006
Posts: 1,328

Submissions (1)

The)TideHunter( is a jewel in the rough (160)The)TideHunter( is a jewel in the rough (160)

Send a message via MSN to The)TideHunter(
Default

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!
__________________
Big plans...

Last edited by The)TideHunter( : 09-20-2006 at 07:53 PM.
The)TideHunter( is offline   Reply With Quote
Old 09-20-2006, 08:55 PM   #7
shadow1500
STARCRAFT II OMFG
 
shadow1500's Avatar
 
Join Date: Jul 2004
Posts: 1,004

Submissions (9)

shadow1500 is just really nice (306)shadow1500 is just really nice (306)shadow1500 is just really nice (306)

Send a message via ICQ to shadow1500 Send a message via AIM to shadow1500 Send a message via MSN to shadow1500
Default

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.
shadow1500 is offline   Reply With Quote
Old 09-20-2006, 09:03 PM   #8
Turkey_Slayer
User
 
Turkey_Slayer's Avatar
 
Join Date: Mar 2006
Posts: 239

Turkey_Slayer is on a distinguished road (10)

Send a message via AIM to Turkey_Slayer
Default

Wasn't this the kind of recipe system that was going to go into ToB O? Very nice, by the way.
__________________
[IMG]http://img339.imageshack.us/img339/6223/shiteb7.jpg[/IMG]
Turkey_Slayer is offline   Reply With Quote
Old 09-22-2006, 04:35 PM   #9
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

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.
__________________

Last edited by blu_da_noob : 09-22-2006 at 04:59 PM.
blu_da_noob is offline   Reply With Quote
Old 09-22-2006, 05:16 PM   #10
shadow1500
STARCRAFT II OMFG
 
shadow1500's Avatar
 
Join Date: Jul 2004
Posts: 1,004

Submissions (9)

shadow1500 is just really nice (306)shadow1500 is just really nice (306)shadow1500 is just really nice (306)

Send a message via ICQ to shadow1500 Send a message via AIM to shadow1500 Send a message via MSN to shadow1500
Default

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.

Last edited by shadow1500 : 09-22-2006 at 05:16 PM.
shadow1500 is offline   Reply With Quote
Old 09-22-2006, 05:17 PM   #11
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

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.
__________________
blu_da_noob is offline   Reply With Quote
Old 09-22-2006, 05:27 PM   #12
Aray
Concepter & Writer
 
Aray's Avatar
 
Join Date: Mar 2006
Posts: 473

Aray will become famous soon enough (44)Aray will become famous soon enough (44)

Default

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?
__________________
Aray is offline   Reply With Quote
Old 09-25-2006, 09:42 PM   #13
Xandramas
User
 
Xandramas's Avatar
 
Join Date: Aug 2004
Posts: 59

Xandramas is on a distinguished road (10)

Default

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?
Xandramas is offline   Reply With Quote
Old 09-25-2006, 10:31 PM   #14
shadow1500
STARCRAFT II OMFG
 
shadow1500's Avatar
 
Join Date: Jul 2004
Posts: 1,004

Submissions (9)

shadow1500 is just really nice (306)shadow1500 is just really nice (306)shadow1500 is just really nice (306)

Send a message via ICQ to shadow1500 Send a message via AIM to shadow1500 Send a message via MSN to shadow1500
Default

You're probably missing the I2Item function, make sure you have it in your map.
shadow1500 is offline   Reply With Quote
Old 11-15-2006, 10:34 AM   #15
Bones66
User
 
Join Date: Nov 2006
Posts: 5

Bones66 has little to show at this moment (0)

Default

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
Bones66 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 11:24 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services