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

[General] Items undropabble, but still sellable

Status
Not open for further replies.
Level 8
Joined
Oct 2, 2013
Messages
288
Is there a way through triggers to make items undroppable, but still sellable and able to move it around in your inventory?

I tried to test around with Unit - Loses an item, where the item would dissapear if you dropped it, and you would recieve a copy in replacement. But that messed up a lot of things when buying items from shops.

If I change the droppable option in the object editor, the item is not even sellable, all left-clicks are forbidden.
 
when the unit drops the item just get it back to the hero like this
  • Events
    • Unit - A Unit dropped an Item
  • Actions:
    • Hero - Give (Dropped Item) to (Dropping Hero)
I THINK

There is no dropped an item event.

This is really strange, I've attached a map so people can see the error he is talking about. Maybe there is some option in the object editor I didn't see, but when buying an item from the goblin merchant the item is given to the unit with the red arrow above them. Another thing is that the shop gets a copy of the item for some reason.

I've tried this trigger and many other combinations of conditions and actions (this was my last attempt).

  • Untitled Trigger 004
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Not equal to Goblin Merchant
    • Actions
      • Wait 0.10 seconds
      • Hero - Give (Item being manipulated) to (Hero manipulating item)
Maybe there's something I'm missing here o_O
 

Attachments

  • hive.w3x
    14.7 KB · Views: 32
Level 8
Joined
Oct 2, 2013
Messages
288
Thank you both for your replies. Especially you TriggerHappy, thanks for looking into this :)

Your last attempt was indeed what I was looking for. I tried without the "wait" but the map crashed so I guess it was there for a reason^^
Now I just need to find a way to perfect the trigger in case two players drops an item at the same time. But for now I consider my problem to be fixed. Thanks a lot :)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240

  • Untitled Trigger 004
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Not equal to Goblin Merchant
    • Actions
      • Set ItemDropUnit[ItemDropCount] = (Triggering unit)
      • Set ItemDropItem[ItemDropCount] = (Item being manipulated)
      • If (ItemDropCount Equal to 0) then do (Countdown Timer - Start ItemDropTimer as a One-shot timer that will expire in 0.00 seconds) else do (Do nothing)
      • Set ItemDropCount = (ItemDropCount + 1)
  • Untitled Trigger 002
    • Events
      • Time - ItemDropTimer expires
    • Conditions
    • Actions
      • For each (Integer A) from 0 to ItemDropCount, do (Actions)
        • Loop - Actions
          • Hero - Give ItemDropItem[(Integer A)] to ItemDropUnit[(Integer A)]
      • Set ItemDropCount = 0
 

Attachments

  • hive.w3x
    15.6 KB · Views: 31
Level 8
Joined
Oct 2, 2013
Messages
288
This is interesting. I tried it out and it seems to work perfectly. Thanks a lot!

It's the first time I have seen this kind of trigger. Would it make a difference if you used "Run Trigger - Untitled Trigger 002" without the event?
 
Status
Not open for further replies.
Top