• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Item Problem!! Please help me.

Status
Not open for further replies.
Level 1
Joined
May 11, 2005
Messages
3
I don't know how to make like this:

You are out and killing like wolfs
then the wolf drops a Meat.
you pick up the meat and keep killing.

The problem:
Now i killed a wolf more and 1 more meat was dropped, i take it up and now i have 2 meats in to inventory slots, i want it to be so when you pick up a item of the same kind then the items "stocks/Groups" so instead of 2 meats in to slots it will be 2 meats on 1 slot. understanding my problem?

---> Kaijin...
 
Level 1
Joined
May 11, 2005
Messages
3
Thx for trying, but i tried the shadow orb +1 and all other Shadow Orbs, none worked they just filled my inventory as big rocks...

Please, if you know how to do some one, really help me...


---> Kaijin...
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Yes making it on a shadow orb would be a good idea. Or maybe use triggers. But you must have more than one item of type "Meat".

Meat - contains 1 charge
Meat - contains 2 charges
Meat - conatins 3 charges
Etc Etc

Then I think using this triggers would work

Events:
Boolean Comparison/Unit/Generetic Unit Event: A unit adquires an item

Conditions:
Item Comparison: Picked Item equal to Item Carried by "Unit" of type Meat (1 charge)

Boolean Comparison/Hero/Hero has item of type: "Unit" has item of type Meat (1 charge)

Actions:
Item/Remove: Remove picked item

Hero/Create item for hero: Create Meat (2 charges) and give it to "Unit".


Try this, and post here if it works or not. Good Luck :wink:

-Rui
 
Level 4
Joined
Jan 3, 2005
Messages
91
Gnaa it works of course with only one item type. You will need a dummy integer variable for this (I'll call it dInteger):

Code:
Events:
- A Unit Aquires an Item

Conditions:
- Item-type of(Item Being Manipulated) == *Meat*
- (Triggering Unit) has an item of type (*Meat*)

Actions:
- Set dInteger = 0
- For each (Integer A) from 1 to 6 do(Actions): 
  - IF
    - Item-type of (Item carried by (Triggering Unit) in slot (Integer A) ) == *Meat*
  - THEN
    - Set dInteger = dInteger + Charges remaining in (Item carried by (Triggering Unit) in slot (Integer A) )
    - Remove (Item carried by (Triggering Unit) in slot (Integer A) )
  - ELSE
     (nothing)

- Create (*Meat*) and give it to (Triggering Unit)
- Set charges remaining for (Last Created Item) to (dInteger)

Ok what we do: whenever a hero picks up or recieves a *meat* (or however you named it) we "scan" all slots of the hero for *meat* and sum up the charges of the items we find there. additionally, every meat is being removed. after we did this, we create a new *meat* and set the charges to the number we summed up before. This also supports picking up a *meat* with more than one charge which might be useful.

Good luck,

klovadis
 
Level 4
Joined
Jan 3, 2005
Messages
91
well not really ^^ your trigger doesn't work, starting from here:

.) "Picked Item" refers to the item in the "pick every item in ..." loop. "Item Being Manipulated" is what you are looking for.

.) As far as I understand, you want to make one item for each charge, thus one meat with 1 charge, one meat with 2 charges, etc. this is not necessary since you can manipulate the charge count.

.) What if the player picks up more than 2 "meats"? what if he gathers more than 10 meats? 100? a lot of triggering work. what if the player picks up a meat with 2 charges? And so on..

I am quite shure that my code works with any combinations and any number of charges remaining on different "meats".

klovadis
 
Status
Not open for further replies.
Top