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

Help with a "simple" trigger

Status
Not open for further replies.
Level 12
Joined
Oct 28, 2019
Messages
475
It appears simple, but im not gettin...

event
a unit drops an item
condition
item type equal to..
action
set point in position of last dropped item ..

how can i do this

  • DropMine
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Target item of issued order) Equal to (Last dropped item)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntegerMine Equal to 0
        • Then - Actions
          • Set VariableSet IntegerMine = (IntegerMine + 1)
          • Set VariableSet PointMine = (Target point of issued order)
          • Unit - Create 1 Satchel Charge (Mine) for Player 24 (Peanut) at PointMine facing Default building facing degrees
          • Set VariableSet UnitMine[1] = (Last created unit)
          • Item - Create Satchel Charge at PointMine
          • Set VariableSet ItemMine[1] = (Last created item)
          • Custom script: call RemoveLocation(udg_PointMine)
this is NOT working
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,014
(Last dropped item) is an event response, and thus only has a value when an event about a unit dropping an item is triggered. Your event is about issued orders, which does not set that event response properly and therefore it likely has the value of null when the DropMine trigger runs. Instead you can use this event:
  • Events
    • Unit - A unit loses an item
  • Conditions
    • (Item-type of (Last dropped item)) equal to ITEM_TYPE_THAT_THIS_SHOULD_TRIGGER_FOR //if it should only happen when a specific item type is dropped
The trigger you posted would need to filter out non-item-related events by using: (Target item of issued order) not equal to No Item. This would still trigger when a unit right clicks an item to swap it to a new slot in their inventory, I believe, as those are orders that target the items directly.

When the event trigger is "issued an order targeting an item" there will be no (Target point of issued order) because the unit was not given a point order. It was given an item order. You would use Position of (Target item of issued order) instead.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
You want to use the Event Response (Item being manipulated) in response to Unit - A unit Loses an item. (Last dropped item) is an Event Response to the Drop Item action. Makes a lot of sense, I know.

Also, there is no Event for specifically targeting an item, you need to use this:
  • Unit - A unit Is issued an order targeting an object
Then determine that the object is an item.

Edit: Actually, neither of these Event Responses work properly...
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
I'm not 100% sure what you're trying to achieve Herod, but I attached a map with what I think you wanted. At the very least you can customize it to work.

What I suggested in my last post does work, it's just that a delay in time is needed to get the Item's actual position. In my map I use a 0.00 second Timer which does the trick.

You could also use a Wait and a local variable for the Item (assuming that Item Being Manipulated isn't Wait-safe) instead of the Timer system I incorporated, it'll just have a longer delay.
 

Attachments

  • Satchel Charge 1.w3m
    26.7 KB · Views: 0
Last edited:
Status
Not open for further replies.
Top