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

How to get that action?

Status
Not open for further replies.

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Hello guys! Does anyone have an idea how to detect the event where a unit is ordered to give an item to another unit? I am not asking for the moment when the item is given, but for the moment when the unit is ordered to give it, because if the unit is far away from the target, the order is given much earlier than the actual giving.

I have a unit on the map that has inventory (which is used for trigger purposes), so I basically want to interrupt any hero from giving items to that specific unit by ordering him to stop. Question is, how do I detect when the hero is ordered to give the item?

Thanks!
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Hmm, that works, except there is an issue. I want heroes not to be able to drop items on 1 specific unit only. With your suggestion, they won't be able to drop them anywhere since there is no way (it seems) to detect the target of the order. <Target unit of issued order> requires an order event and won't work with the periodic event. :/
 
Level 9
Joined
May 21, 2014
Messages
580
Currently not. It's created for the player when he picks a hero. The unit is stored in a variable though. Does it help if I preplace it? And yes, it is static, like a building. It does not move.

I am currently testing it using the easiest methods, then if I can make it work, then we'll find a way to get to a non-preplaced unit. Currently though, tests are going bad. I can't seem to really know which unit is which as you stated above.
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
-Each Hero is assigned a Building.
-Player 1 picks a Hero --> he gains a building from that type.
-Player 2 picks a Hero --> he gains a building from that type.
-etc
-I don't want heroes (or any units whatsoever) to be able to give items to the building, because the building has an inventory.
 
Level 9
Joined
May 21, 2014
Messages
580
-Each Hero is assigned a Building.
-Player 1 picks a Hero --> he gains a building from that type.
-Player 2 picks a Hero --> he gains a building from that type.
-etc
-I don't want heroes (or any units whatsoever) to be able to give items to the building, because the building has an inventory.

I mean in my tests. There is no way to detect the unit who is targeted to be given by a unit who has a dropitem order.
 
Level 9
Joined
May 21, 2014
Messages
580
I have tried everything. I guess it's not possible. I even used a trigger to order "give item" and then I have another trigger that listed down all the possible order issuing thing (both at specific unit and generic).

The trigger isn't fired at all, even with using a trigger "give item order"...
 
Level 18
Joined
Nov 21, 2012
Messages
835
I have a unit on the map that has inventory (which is used for trigger purposes)

the easiest way is to create trigger like below and when you want to do some actions on those special units with inventory then turn off trigger--> do your actions --> turn on trigger

  • it1 Copy
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Hero manipulating item)) Equal to specialUnit1
          • (Unit-type of (Hero manipulating item)) Equal to specialUnit2
    • Actions
      • Hero - Drop (Item being manipulated) from (Hero manipulating item)
 
Status
Not open for further replies.
Top