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

Detect Item Drop (or transfer?)

Status
Not open for further replies.
Unit loses an item
Unit acquires an item

Tried Event - Unit loses an item, it will not respond (i think it set to work when the hero dies while carring droppable items like Gem).
Edit: Tried Event - Unit acquires an item, it will apply to the hero given the item, not the hero who gives the item to another hero.
Is there an event to detect this to begin with?
 
Last edited:
  • lose
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • Game - Display to (All players) the text: item lost
Works fine for me when I
- drop an item on the ground
- drop an item on another hero
^ APPROVED, but:
  • Special cases
    • Events
      • Unit - A unit Acquires an item
      • Unit - A unit Loses an item
      • Unit - A unit Uses an item
      • Unit - A unit Pawns an item (to shop)
    • Conditions
    • Actions
      • Set SentUnit = (Hero manipulating item)
      • Trigger - Run Update for hero <gen> (ignoring conditions)
So it must mean "hero manipulating item" is not good. I give you rep for helping this far, thanks.
 
You could try (previous owner of item)

Wow that is smart! the point is I try to make an ability that set accordingly to the hero attributes with bonuses but I just realized that when an hero drops an item he still count as hero with the item (in matter of attributes) I try add 0.01 second delay and I will post if it worked out.
Edit: it was indeed the solution but there is one more thing: when hero gives an item to another hero, the given hero is updated but the giving hero is not updated, I try to make it myself but if you know it would help
*** attached: the fail attemp on item swap
 

Attachments

  • Skills.w3x
    1 MB · Views: 63
Wow that is smart! the point is I try to make an ability that set accordingly to the hero attributes with bonuses but I just realized that when an hero drops an item he still count as hero with the item (in matter of attributes) I try add 0.01 second delay and I will post if it worked out.
Edit: it was indeed the solution but there is one more thing: when hero gives an item to another hero, the given hero is updated but the giving hero is not updated, I try to make it myself but if you know it would help
*** attached: the fail attemp on item swap
*** Attached: 2nd fail on item swap, but allow to see the problam more clear
 

Attachments

  • Skills 2.w3x
    1 MB · Views: 55
I'm struggling to read through your triggers, so I think I'll make a test map quick.

How about this version then? it just simple: STR = cleave% AGL= evasion% and Int=crit%
in this particular try the map couldn't look more simple:
***Attached: easy to understand map
Edit: in essense, the act of giving item counts as selling the item with the selling unit = the unit who got the item, this is getting complecated there hence making all this chaos
 

Attachments

  • Skills 3.w3x
    1 MB · Views: 60
Level 25
Joined
Jul 10, 2006
Messages
3,315
If you only have 1 hero per player, you could use this method:
  • Set Owner
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (Name of (Owner of (Item being manipulated)))
      • Item - Change ownership of (Item being manipulated) to (Owner of (Triggering unit)) and Change color
      • Game - Display to (All players) the text: (Name of (Owner of (Item being manipulated)))
And the just refer to Hero[player number of player]
 
If you only have 1 hero per player, you could use this method:
  • Set Owner
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (Name of (Owner of (Item being manipulated)))
      • Item - Change ownership of (Item being manipulated) to (Owner of (Triggering unit)) and Change color
      • Game - Display to (All players) the text: (Name of (Owner of (Item being manipulated)))
And the just refer to Hero[player number of player]

Its a single player map with 4 heroes controlled at all times (or more)
Edit: and netural has 100 heroes (or more)
 
Its a single player map with 4 heroes controlled at all times (or more)
Edit: and netural has 100 heroes (or more)
It really sad to give up like this! but in worst case I will set unit group = each and any hero on the battlefield , without illusions. Then: I will check each and any hero and set this for each one of them, making lag if not any other way is approved. :(
Edit: ofc course that would mean 4 un-needed massages for the player...
 
Freaking hell I think I GOT IT but I need to test first: maybe giving the item actually send both units: the giving unit and the given unit but due to some bug it refer the giving unit 2 times? I will need to check and I will post complete solution

Final Post: The Absolute Solution (Fucking world editor bugs):
1) Power ups count as item that was acuired, then item that was lost.
2) Dropping item counts as giving it to another hero, but if used on same trigger, they are crush between, since the giving item has (probably) 0.01 second delay or hardcoded failure.

The solution:
1) 2 triggers, for the giving and the given
2) conditions to split among powerup and non-power ups

Editor note: BULLSHIT FUCK THIS EDITOR SUX LIKE HELL :ogre_rage:

LEARN FROM IT! :thumbs_up:
 

Attachments

  • Skills 4.w3x
    1 MB · Views: 51
Status
Not open for further replies.
Top