HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Item Recipe System Recap

06-24-2005, 12:50 PM#1
volatile
Hi, this is for all those people looking for an EASY GUI Recipe system.

Seems that people have gotten complicated with this simple system and are making a lot more trouble for themselves.

Here is the system:

Code:
Item Recipe System
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
FIRST LOOP -->  For each (Integer recipe_integer[0]) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Item-type of (Item carried by (Triggering unit) in slot recipe_integer[0])) Equal to Dust of Appearance
                    Then - Actions
SECOND LOOP (NESTED) -->  For each (Integer recipe_integer[1]) from 1 to 6, do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Item-type of (Item carried by (Triggering unit) in slot recipe_integer[1])) Equal to Minor Replenishment Potion
                                        recipe_integer[1] Not equal to recipe_integer[0]
                                    Then - Actions
THIRD LOOP (NESTED) -------------->      For each (Integer recipe_integer[2]) from 1 to 6, do (Actions)
                                            Loop - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        (Item-type of (Item carried by (Triggering unit) in slot recipe_integer[2])) Equal to Potion of Speed
                                                        recipe_integer[2] Not equal to recipe_integer[0]
                                                        recipe_integer[2] Not equal to recipe_integer[1]
                                                    Then - Actions
                                                        Item - Remove (Item carried by (Triggering unit) in slot recipe_integer[0])
                                                        Item - Remove (Item carried by (Triggering unit) in slot recipe_integer[1])
                                                        Item - Remove (Item carried by (Triggering unit) in slot recipe_integer[2])
                                                        Hero - Create Ring of the Archmagi and give it to (Triggering unit)
                                                        Skip remaining actions  
                                                              Else - Actions
                                                                    Do nothing
                                    Else - Actions
                                        Do nothing
                    Else - Actions
                        Do nothing

This sytem is to combine 3 items. If you want to combine 2 items just REMOVE the "recipe_integer[2]" NESTED LOOP.

If you want to combine 4 or more items, simply ADD ANOTHER NESTED LOOP.

The ONLY thing that might confuse new people is the recipe_integer[x] variable. I USED AN ARRAY. recipe_integer[0] and recipe_integer[1] are 2 DIFFERENT VARIABLES. Instead of saying 2 variables of recipe_integer1 and recipe_integer2 I simply used an array to make things faster. You COULD however, do the recipe_integer1 variable if you wanted to. Just remember, I'm using 3 DIFFERENT VARIABLES HERE.

Basically the system runs like this:

first loop:
integer[0] checks all 6 slots (from 1 to 6 right?) for the first item of your recipe

second NESTED (like INSIDE a birds nest?) loop:
integer[1] checks all 6 slots AGAIN for the second item of your recipe
THEN MAKES SURE IT'S NOT THE SAME AS integer[0] U FOLLOW ME??

third NESTED (little birdy) loop:
integer[2] checks all 6 slots AGAIN for the third item of your recipe
THEN MAKES SURE IT'S NOT THE SAME AS integer[0] OR integer[1] GOT IT?

DONE....

Now a lot of people have been adding crap to this sytem, tweaking it, etc... But SERIOUSLY, what can u expect to define in a system like this? You need to define the 3 ITEMS for the recipe and the 1 item for the CRAFTED ITEM. So nomatter HOW you do this, you will have to define 4 Variables.

WITH THIS SYSTEM, YOU SIMPLY COPY + PASTE IT AS MANY RECIPES AS YOU NEED AND JUST HAVE THEM ALL RUN WHEN A UNIT AQUIRES ITEM. Simple.

For all you going to comment, QUIET PLZ :D Unless it's a good comment :P
06-24-2005, 03:52 PM#2
Guest
Ohh, why didn't u submit this in the submission forum? =D
06-24-2005, 04:13 PM#3
Anitarf
Because it already is there... I have another question, why didn't you use the [code] tags? And you should put a "skip remaining actions" function after you create the item.
06-24-2005, 09:10 PM#4
volatile
Another question? Anitarf you need to ask a question for the next one to be considered "another" one :D j/p
06-25-2005, 10:18 AM#5
Anitarf
Quote:
Originally Posted by volatile
Another question? Anitarf you need to ask a question for the next one to be considered "another" one :D j/p
Well, it was another one, because Hunter Destruction had already asked a question before that.

By the way, copy+pasting is really really realy bad way of programming...
06-26-2005, 08:35 AM#6
volatile
Copy and pasting what? You're totally losing me here Anitarf. I almost think you're trying to insult me in some subtle way, let me remind you that this thread is meant for people who want a "SIMPLE" way to add an item recipe system into their map because of you guys adding too much "whaaaaaaaaaaaaaahooooooo" to the other threads to make finding a solution easy for the beginner. This thread is the end all of end alls when it comes to item combination for beginners, and I think it accomplishes exactly what it needs to.

I don't think any more discussion needs to be done in this thread thank you :D