• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[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: 68
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: 76
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