• 🏆 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!

Adding items to inventory please

Status
Not open for further replies.
Level 4
Joined
Oct 12, 2004
Messages
59
If a unit buys or picks up say, scrap metal if the unit already has scrap metal how do you make it so it adds the scrap metal picked up to the amount already owned, and if you have an item “Blacksmiths Hammer” and try to pick up or buy another and it comes with 5 or theres one with a certain amount left on the ground how do you add the amount you have to what you try to pick up or buy even if you have a full inventory, same with the scrap metal, ill play around and see if i can figure it out. I got something but it removes both the items instead of adding it to one. thx
 
Level 8
Joined
Nov 20, 2005
Messages
372
Hey

You have to make two triggers

1st ( Unit gets an combo item ) :

Event: A unit gets an item
Conditions :
Action:
If then do else do
If All Conditons are true
item being manipulated equal to *itemtype1*
Triggering unit has an item of type *itemtype2*
equal to true
then do:
Remove items of type*itemtype1* from triggering
Unit
Remove items of type*itemtype2* from triggering
Unit
Add a item of type *comboitem1* to triggering
unit
Else do do nothing


Sorry I don't know how to make the 2nd trigger for you
 
Level 6
Joined
Feb 18, 2005
Messages
263
for the second trigger yopu can not use "aquites item" as an event. Obviously that even is not triggered, if the item is not put into the inventory -.- (hate that sometimes)
therefore you'd have to think of a way to check, whether a player wants to archieve an item, he already has, (that is stackable). I du not know whether that might be possible, but i guess if it is, it is not that easy o fa code.

for the rest you shall use the search function.
There is a tutorial in the tut section that does the "if i pick up a item it stacks towards others of the same kind" stuff.
 
Level 4
Joined
Oct 12, 2004
Messages
59
And aquires item does work if your inventory is full and you buy an item from i shop, i tested it out. I dont have time to test it picking up an item or to go to the tutorial now but i will tomorrow thx.
 
Status
Not open for further replies.
Top