[Trigger]One item of item type (Trigger Problem)

Status
Not open for further replies.

Arab4life

Level 10
So i have this problem. I made this trigger for the map im making.

• Events
• Unit - A unit Acquires an item
• 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-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A)))
• Then - Actions
• Hero - Drop (Item being manipulated) from (Hero manipulating item)
• Else - Actions
This trigger is supposed to allow a hero to only carry one item of any given type. (E.G One artifact type item at any time)

But every time my hero try's to pick up the item he just drops it instantly, even when his inventory is empty.

Whats wrong with the trigger?

Chaos Overlord

Level 12
Well he acquires the item, then it checks the type and compares it to what is in the slots. Let me explain more: Unit picks up an artifact. Artifact goes to slot one. Trigger checks type of all items, including the one in slot one (the one we just picked up). Ok... trigger now knows the item in slot one is an artifact. Now checks the item it picked up... artifact. Trigger sees the type in the slot is the same as we picked up, so it says, dang it, time to drop.

That is what I saw ans what I think may be wrong.

sonkan1

Level 8
there is a good sys for this, look at spells->Systems and then for a item classification system(thi8nk its that). and i beleiv its N00by_stance whos the creator.

Chaos Overlord

Level 12
sonkan, I looked through the spell section and could not locate what you are talking about. Could you please link directly to it?

johannesr

Level 17
try adding these lines to the if conditions
(Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))

and

(Item-class of (Item being manipulated)) Equal to Artifact

Arab4life

Level 10
Tried that, still doesnt work.

Should i just upload the map and see if anyone can fix it?

johannesr

Level 17
weird but the excact same trigger(with the conditions i posted of course) works fine for me.

Arab4life

Level 10
Alright... im not sure what the problem is, although i dont want to do this, ill post the map that im making.

Dont really do anything to it, just look in the trigger section under the folder named Weapon Limits

Also the (Weapon) Drop triggers in the Weapons folder also have a relation to the trigger.

Attachments

• Gunslingers.w3x
358.7 KB · Views: 68

edge[d1]

Level 6
make your condition (within if statement) look like this:
• If - Conditions
• (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) [color=blue][b]and[/b] ( Item being manipulated not equal to Item carried by (Hero manipulating item) in slot (Integer A))[/color]

johannesr

Level 17
U added the lines i gave u to the wrong place. Here ill post my trigger:
• Stacking
• 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-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A)))
• (Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))
• (Item-class of (Item being manipulated)) Equal to Artifact
• Then - Actions
• Quest - Display to (All players) the New Item Received message: You cannot own two ...
• Wait 0.50 seconds
• Hero - Drop (Item being manipulated) from (Hero manipulating item)
• Else - Actions

FamousPker49

Level 18
here is ur map with the right trigger, but there are some other problems that i noticed that when ur "Gunslinger" picks up like dual pistols or short swords that the unit goes into some sort of frenzy in which i think it is switching from one unit to the other or somthing not quite sure cus i cannot select it and other times it will create two or three like two that are a gunslinger weaponless one that has the weapon picked up idk its weird i would recommend some sort of "Item Ability" with like the Illidian metamorphosis or something rather than replace unit cus idk if thats the problem but its not working that way

Attachments

• Gunslingers.w3x
358.4 KB · Views: 76

Arab4life

Level 10
here is ur map with the right trigger, but there are some other problems that i noticed that when ur "Gunslinger" picks up like dual pistols or short swords that the unit goes into some sort of frenzy in which i think it is switching from one unit to the other or somthing not quite sure cus i cannot select it and other times it will create two or three like two that are a gunslinger weaponless one that has the weapon picked up idk its weird i would recommend some sort of "Item Ability" with like the Illidian metamorphosis or something rather than replace unit cus idk if thats the problem but its not working that way

Thanks, and no thats not a problem, its an unfinished trigger.

I orginally made the trigger to be that if a unit picks up an item he instantly changes to another unit. But i changed it.

But, as i was only testing the map, i only changed the trigger for the pistol. So i need to fix the rest of the weapons.

YES IT FINNALY WORKS.

Thanks man.

FamousPker49

Level 18
no problem lol i guess i should have tested the pistol one instead

Status
Not open for further replies.

Replies
22
Views
2K
Replies
5
Views
969
Replies
6
Views
897
Replies
35
Views
11K
[Trigger] Anti Item Stack?
Replies
8
Views
910