• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[REQUEST] Item Combination system

Status
Not open for further replies.
Level 3
Joined
Aug 13, 2006
Messages
18
I hope you know what I mean by this 1[item] + 1[item] = 2[new items]
1[item] is in inventory 1[item] is put in inventory with first item these create
2[new item]

Don't forget The others are deleted when new item is created it isn't 1 + 1 = 1,1,2

Also this must be done in GUI!

Can I get a sample trigger please and thank you :infl_thumbs_up:
 
Level 1
Joined
Dec 25, 2007
Messages
2
I can do it but specify when the combining happens? For example when unit casts a spell or instantly when he has both items in the inventory? Or other kind of way?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Answerd this before like 3 days >.<

Here is a shorter trigger for this.
2 big bonuses of this are:

• Smaller code
• You can put those items in any inventory slot you wanted

If you wanted it to be only in slots 1 & 2, you can just make the same condition as humpadumpa made.

  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Item_Type[0] = Claws of Attack +6
      • Set Item_Type[1] = Claws of Attack +9
      • Set Item_Type[2] = Claws of Attack +12
  • Naga Pwnz
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Not equal to Item_Type[3]
              • (Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Triggering unit) of type Item_Type[(Integer A)]))
            • Then - Actions
              • Item - Remove (Item being manipulated)
              • Item - Remove (Item carried by (Triggering unit) of type Item_Type[(Integer A)])
              • Hero - Create Item_Type[((Integer A) + 1)] and give it to (Triggering unit)
            • Else - Actions

[Offtopic] humpadumpa, I remember you saying you don't know how to use Integer[A/B] loops.
You should learn, they are really usefull at shortening codes :)
It isn't hard really, and if you want a explaination I would be glad to make a thread for it so people can learn how to use them.


Oh I forgot that this is for same item type.
If you need for diffrent types just do the same thing but set it in a way that it'll be "if item has Item_Type[1] and Item_Type[2], then ...".
Do this in a "And - multiple actions" of course.

For example,
  • (Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Triggering unit) of type Item_Type[(Integer A) -/+ 1])
It will be a minus ( - ) if the item the unit aquired is the second item, it will be a plus ( + ) if the item the unit aquired is the first.
 
Status
Not open for further replies.
Top