• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Need help with Attchaments / item

Status
Not open for further replies.
Level 5
Joined
Nov 2, 2008
Messages
48
Hi, i have a small problem. I'm working with a new "rpg" map but i have one problem!

I'm using Attachments so that, when i ex pick up an Axe i will get it in my hand. BUT i can pick up more items at same time, like a spear, sword, Axe and all three are in the same hand.

Now, how can i fix this? i want that i only can pick up one weapon and one shield, how in the h*ll does i fix that? ^^

+rep for solving answer :p

Sorry for bad language. I'm from Sweden. My English is like. BAD! ^^
 
Level 8
Joined
Aug 21, 2009
Messages
333
o_O I know a great way of doing this.

choose a level for each item class.

ie. shields can be lvl 5, weapons can be lvl 6, helmets can be lvl 7, boots can be lvl 8

and write a trigger that triggers on a unit picking up an item and just have it go through and make the hero drop any items that have duplicate levels (for example, if your trigger finds 2 items that are lvl 5, you know they have 2 shields and you can make the old one drop)

Hope that answers your question.

I suppose i can write out the trigger if you need me to :D
 
Level 5
Joined
Nov 2, 2008
Messages
48
o_O I know a great way of doing this.

choose a level for each item class.

ie. shields can be lvl 5, weapons can be lvl 6, helmets can be lvl 7, boots can be lvl 8

and write a trigger that triggers on a unit picking up an item and just have it go through and make the hero drop any items that have duplicate levels (for example, if your trigger finds 2 items that are lvl 5, you know they have 2 shields and you can make the old one drop)

Hope that answers your question.

I suppose i can write out the trigger if you need me to :D

Thx m8, but that was not exactly what i wanted. In your description are you losing your old wep. I want it more like, you cant pick up another we at all, the showing the text ex, "You can only have one wep"

But thanks för trying m8, will have this if there is no way to do it like i want it ;P

Yeah, and one thing more. How? ^^ Bainstatic, how does i do that? what triggers etc. ^^
 
Last edited:
Level 8
Joined
Aug 21, 2009
Messages
333
yeah, that is easy enough.

actually it would be easier to do it that way.

I'm at work, so I don't know if these triggers will be named exactly right:

  • Prevent Duplicate Items
    • Events
      • Unit - a unit (acquires an item)
    • Condition
      • (Level of (Item being manipulated) is greater than 2)
    • 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 carried by (Hero manipulating item) in slot (Integer A) not equal to (Item being manipulated)
              • (Level of (Item being manipulated)) is equal to (Level of (Item carried by (Hero manipulating item) in slot (Integer A))
            • Then - Actions
              • Hero - drop (Item being manipulated)
              • Quest - Message to player (Owner of (Hero manipulating item)) "You can't carry another one."
            • Else - Actions
And then make sure that set the level to 2 or less for all items that you DO want the heroes to be able to carry more than 1 of (for example: potions, scrolls, etc.)
 
Last edited:
Level 5
Joined
Nov 2, 2008
Messages
48
yeah, that is easy enough.

actually it would be easier to do it that way.

I'm at work, so I don't know if these triggers will be named exactly right:

  • Prevent Duplicate Items
    • Events
      • Unit - a unit (acquires an item)
    • Condition
      • (Level of (Item being manipulated) is greater than 2)
    • 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 carried by (Hero manipulating item) in slot (Integer A) not equal to (Item being manipulated)
              • (Level of (Item being manipulated)) is equal to (Level of (Item carried by (Hero manipulating item) in slot (Integer A))
            • Then - Actions
              • Hero - drop (Item being manipulated)
              • Quest - Message to player (Owner of (Hero manipulating item)) "You can't carry another one."
            • Else - Actions
And then make sure that set the level to 2 or less for all items that you DO want the heroes to be able to carry more than 1 of (for example: potions, scrolls, etc.)

OK, i will try it when i come home =) if it works i give you +rep ;D


OKAY! :D it worked! Thx m8, +rep for you ^^
 
Last edited:
Status
Not open for further replies.
Top