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

[Trigger] One of specific item per unit

Status
Not open for further replies.
Level 2
Joined
Sep 25, 2006
Messages
14
well, i just got back into map making when i ran acrossed a problem. I made weapons and i noticed people just kept grabbing more of them when really you were only suppose to have one. So now i am trying to fix that little problem. I tried this trigger

Luger 2
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Matching item)) Equal to *****
Actions
If (((Matching item) is owned) Equal to True) then do (Hero - Drop (Item being manipulated) from (Triggering unit)) else do (Do nothing)







Nothing. he is not dropping the second item. Please help?
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
You cant use "Matching Item" in those cases, you better try the first time "Item being manipulated".

Maybe you try this trigger i wrote for you. It checks in a loop the amount of Items carried by the Hero, that picks up the item. Then it drops the Item, if there is already one.
If you want an item not to be affected by this trigger, then you have to add a general condtion for the trigger like this: "Item being manipulated is not equal to "your choice"

  • Events
    • Einheit - A unit aquires an Item
  • Conditions
  • Actions
    • Set i = 0
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Aktionen
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • 'IF'-Bedingungen
            • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Ankh der Reinkarnation
          • 'THEN'-Aktionen
            • Set i = (i + 1)
          • 'ELSE'-Aktionen
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • 'IF'-Bedingungen
        • i Greater than 1
      • 'THEN'-Aktionen
        • Held - Drop (Item being manipulated) from (Hero manipulating item)
      • 'ELSE'-Aktionen[/quote]
I translated the important things.

Greets
 
Level 2
Joined
Sep 25, 2006
Messages
14
Now i need it for not just one unit but a few more. what would i do then?

And i tried putting in the item being manipulated in the trigger but now the unit cant have the item at all.

Luger 2
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to *****
Actions
If (((Item being manipulated) is owned) Equal to True) then do (Hero - Drop (Item being manipulated) from (Triggering unit)) else do (Do nothing)



and notice this trigger is not for a hero, it is for any unit.

And also thanks for making the trigger, i cant read german, i only know a few words.
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
my trigger is one correct solution, i tried it, maybe you should have done this too before reposting -.-!

Hero doesnt mean Hero Unit, it only means a unit with an inventory, and of course your trigger solution doesnt work, you have the item, when you acquired it, so why dont you use my trigger?

There are any important German words anymore in it! or are there any?^^

PS: The Trigger i posted works for every unit with an inventory in your map, its absolutely Multiplayer useable^^
 
Level 2
Joined
Sep 25, 2006
Messages
14
ok, let me put it to you blatently, I have no idea what you put there. So even if it is a perfectly good trigger (thanks for the thought though, much appreciated) I wouldn't know what to put. The only thing i got out of that trigger is that it has a variable. I am not an expert trigger person.
 
Level 2
Joined
Sep 25, 2006
Messages
14
Let me put this to you blatently, I cannot understand your trigger. There is insufficient information there. For example i dont know what type of variable that is. I also can't understand the vital parts (mostly cause they're in german). so even if it is a good trigger (thanks for trying to help though, much appriciated) i cannot understand it.
 

x3m

x3m

Level 3
Joined
Apr 11, 2008
Messages
51
Just assign custom values to the weapons. Then check it by triggers. If there already is an item with that value, drop the aquired one.
 
Level 2
Joined
Sep 25, 2006
Messages
14
i am working on emma's trigger right now. I want to see if that could be solution.
Also how did you get the:
Held - Drop (Item being manipulated) from (Hero manipulating item)
Action?
Also should i make a second trigger for when the unit drops the gun?
 
Level 2
Joined
Sep 25, 2006
Messages
14
apperently your trigger worked itself out. I have no idea how it did because i thought one he picked up the pistol it would add, and not count when he dropped it and minus it then. I think i might be making this more complex then it is.
 
Status
Not open for further replies.
Top