• 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.

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

Status
Not open for further replies.
Level 10
Joined
Mar 30, 2007
Messages
447
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?
 
Level 12
Joined
Feb 1, 2007
Messages
1,092
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.
 
Level 10
Joined
Mar 30, 2007
Messages
447
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: 69
Level 6
Joined
Mar 2, 2006
Messages
306
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]
 
Level 17
Joined
Apr 24, 2005
Messages
762
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
 
Level 18
Joined
May 27, 2007
Messages
1,689
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: 77
Level 10
Joined
Mar 30, 2007
Messages
447
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.
 
Status
Not open for further replies.
Top