HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Perfect Item Crafting Trigger

09-09-2004, 11:53 PM#16
iplaystarcraft
Quote:
Originally Posted by Anitarf
Yeah, that would work, unless the recipie requires multiple items of same type, in that case, this method cannot work.

The original method can be easily modified for 2 or 4 item combinations; basicaly, what the trigger does is, it loops through all the items a hero has, looking for the first combo item; if it finds it, it then starts looking for the next one; in case there are two same items required, the second loop also checks that the item it finds isn't the same item that it found the first time it looked for the first item; for two items, you can stop here; for four items, you must repeat the loops two times more. Note that each loop must use it's own integer, because you use these integers to make sure no item gets selected twice, and you also use them at the end to remove the appropriate items: that's why, with 4 items, you would need an additional integer variable.


ok thx but i got 1 more problem....
i made a 2 item combo, it work the first and second time BUT the third time it just took away the 2 items the recipie requires and didnt give me the recipie item.... o_O
09-10-2004, 09:26 PM#17
Anitarf
Quote:
Originally Posted by iplaystarcraft
ok thx but i got 1 more problem....
i made a 2 item combo, it work the first and second time BUT the third time it just took away the 2 items the recipie requires and didnt give me the recipie item.... o_O

Is this exactly the trigger you used? This should work.

Code:
Temp Item System
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        For each (Integer A) 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 (Integer A))) Equal to Bracer of Agility
                    Then - Actions
                        For each (Integer B) 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 (Integer B))) Equal to Bracer of Intelligence
                                        (Integer B) Not equal to (Integer A)
                                    Then - Actions
                                        Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                                        Item - Remove (Item carried by (Triggering unit) in slot (Integer B))
                                        Hero - Create Sword Engraved with Pure Agility and give it to (Triggering unit)
                                    Else - Actions
                    Else - Actions
09-12-2004, 04:32 PM#18
sweet5
hey quetz ^_^ got to channel and I'll show u how CEO's works =P its way better than the other dudes if ur making a map like spellcraft that has like 3568304569345 combinations nice job ceo, I never thought to try it like that, go arrays!
10-12-2004, 01:31 PM#19
Freakazoid
Nice for my RPG. Maybe i'l use it
10-26-2004, 01:40 PM#20
Anitarf
Quote:
Originally Posted by Mara.Jade
I like Anitaarf's trigger a lot more than yours, Ceo. It's much more clean, much more simple, much more logical.

Salutions®

Thanks for the compliments some of you gave me, but I have to say that I like Ceo's trigger better than "mine"; because if I did such a trigger for my map, I would make it probably even more complex than Ceo did. However, for the purpose of explaining item-crafting on a forum, I resorted to a simple, specific trigger, which probably is easier to implement: just copy&paste as many times as you need and change the items in each trigger.
11-01-2004, 02:26 AM#21
Ceo
My trigger is equally if not more efficient. You guys are forgetting the fact that whenever someone picks up an item his runs hundreds of triggers, while mine runs one loop.


No offense to your trigger though Anitarf, it's great and I did use it as a base for mine.
11-01-2004, 03:56 AM#22
linkmaster23
Whoa, there is such a easier way to go about doing this... *goes to editor*
11-02-2004, 01:41 AM#23
volatile
Anitaarf's trigger is the MOST BASIC way to do item crafting. Even if you were to use CEO's trigger you would have to set variables defining what "items" you would need to create the "new" item.

Basically the beauty of this trigger is that although simple, it combines 3 items perfectly. Slightly modifying this trigger can in fact do 2, 4, 5, or 6 item combinations. I have no doubt that there probably is another trigger that will work more efficient for this process, however... This trigger causes no lag in-game when playing online (even though it does run many, many times every time an item is picked up). You could probably add to the beginning of the trigger a condition requiring it only run if one of the "specific" items is picked up and this would reduce the "load."

If anyone else can produce a "working" trigger that is more efficient than this one please, post it. I actually coded this trigger Anitaarf pointed me in the right direction, as I recall he actually gave me a trigger that didn't work :/ After some communication I eventually came up with the working trigger and decided to post it for all of you. So far this is the only WORKING sticky available on this site, and after months of being here, no one has yet to post a better one. Thx :D
11-02-2004, 03:18 AM#24
Ceo
Quote:
Originally Posted by linkmaster23
Whoa, there is such a easier way to go about doing this... *goes to editor*

I'd think so as well.

Keep in mind I wrote this what, 3 monthes ago? And I havn't mapped since, was just looking this topic up for a friend on another site and noticed it's somehow still alive...
11-02-2004, 07:26 AM#25
MindWorX
I would say it would be easier to do in another way, using loops, making it only have 2 triggers, one to set variables, and one for the loop, i'll try and make one when i get home, it's gonna look a little like my weapon system i think... Weapon System is on this forum too...

Cya later then...
11-02-2004, 04:42 PM#26
linkmaster23
No point in me making a new map, just use Anitarfs. gg.
11-02-2004, 10:13 PM#27
MindWorX
Quote:
Originally Posted by linkmaster23
No point in me making a new map, just use Anitarfs. gg.

Hehe... Too late...

This is a easy to implent Item Creation system, only works with 2 items per combination right now, but i'm working on making it better...

Haven't found any bugs my self...
11-03-2004, 12:30 AM#28
Ceo
Quote:
Originally Posted by MindWorX
Hehe... Too late...

This is a easy to implent Item Creation system, only works with 2 items per combination right now, but i'm working on making it better...

Haven't found any bugs my self...

Mindworx, if you're talking about what I think you're talking about look at about the fifth post or so, I posted it a longass time ago.
11-03-2004, 02:01 AM#29
Guest
Quote:
Originally Posted by MindWorX
Hehe... Too late...

This is a easy to implent Item Creation system, only works with 2 items per combination right now, but i'm working on making it better...

Haven't found any bugs my self...

MindWorX, you are making the same Item Creation system that I made myself :)

The thing is you do not need 6 different triggers for each number of items required ... I found that out by accident which cuts your trigger requirements hugely ...

I posted it for download like a week ago ... Check it out. You will be amazed how similar they are.

http://www.wc3campaigns.com/showthread.php?t=67284
11-03-2004, 08:06 AM#30
MindWorX
lol... You right... That's scary... Hehe... Well, didn't invent the wheel after all... Hehe

BTW, did you like the weapon and Armor system in the map?

Quote:
Originally Posted by Ceo
Mindworx, if you're talking about what I think you're talking about look at about the fifth post or so, I posted it a longass time ago.
Hmmm... Our triggers doesn't look a like, so i geuss not, but they seem similar in some way...