What you can do is add the ability to the hero through the data editor and also make a button for it (just like normal).
With triggers you can then disable the ability button (there are "disable" and "disallow", careful about that).
When you pick up the item, just show the ability button.
Thx, i will have to try that,
but will there be enough space or what not, for adding 30 abilities to each hero unit doing it that way? Or is there a limit to how many abilities can be added to each unit in the data editor beforehand? (there was a whole mess of unique and different abilities received from picking up items totally roughly 30)
Also did any of u guys find equivalent wacraft3 "event - when unit acquires an item" "event - when unit loses an item"?
(the items are not preplaced on the map ground, they are dropped by other unit players inventories upon death or bought from shops)
When you set up an inventory ability, you set a bunch of ability commands for different item actions like Drop Take Move etc. You just check to see if a unit uses an ability and if the ability is the one for drop/take or whatever.
Ok i looked in my inventory ability in the data and see the drop, move, take, iteminstant, itemtarget commands,
but for the trigger event - any unit uses ability, I can select "inventoryslot" but I can't select any of the "drop, move, take, iteminstant, itemtarget" commands, so the event can't differentiate between dropping, targeting, or picking up items it seems?
there will be a separate ability for each of the item abilities. if you set patrol as the command for drop in the inventory ability, then there will be an ability in the list that says patrol - inventoryblahblah or something like that when you do the unit ablity event.
Ok i didn't have default buttons set for the commands in the inventory ability (drop, move, iteminstant, take) etc, and once i added default buttons, I could select them with the trigger event "Whenever a unit uses an ability " Pickup item button" Inventory Slot!, Thx
But now theres another problem...
For acquiring the item, its no problem, my trigger successfully registers an item acquire, at the precise time, and can display the unit-type of the item:
Event: Unit - Any Unit uses Pickup item button at Generic6 - Complete stage (Ignore shared abilities)
Condition: (Unit type of (Triggering ability target unit)) == Rocket
Action: Debug - Display "Pickupped" as debug output using Type 1, and Do display it in the game window
Action: Debug - Display (Name of (Unit type of (Triggering ability target unit))) as debug output using Type 1, and Do display it in the game window
That above trigger works completely fine to register picking up an item, however when dropping an item, trigger cannot return the unit-type of the item being dropped:
Events: Unit - Any Unit uses Drop item button at Generic6 - Complete stage (Ignore shared abilities)
Action: Debug - Display "Dropped" as debug output using Type 1, and Do display it in the game window
Action: Debug - Display (Name of (Unit type of (Triggering ability target unit))) as debug output using Type 1, and Do display it in the game window
Only the "dropped text" gets displayed, and not the unit-type of the item, perhaps because its out of the inventory and so its cant get what item was dropped? I have tried the event for dropping the item ability at all the stages (Generic 1 Any, Generic 2 Queue, Generic 3 Execute, Generic 4 Cancel, Generic 5 Prompt, Generic 6 Completion)
Yet none of the stages can register what exactly item was dropped
So...item acquired trigger works fine, can discern the item-type of item acquired correctly
However, item dropped trigger, cannot discern the item-type of item dropped, which is crucial for knowing what item was dropped
Anyone have ideas to make the "whenever an unit uses ability, item drop etc" be able to work and know what item was dropped? (also moving item to different slot trigger doesn't work either)
In my warcraft 3 map, a hero could go around and pick up items, upon picking up the item, an ability would be added to the hero
(the abilities are clickable, castable, like Psi storm etc)
The trigger in warcraft 3 was something like:
Event - Whenever a unit acquires an item
Condition - Item type of item equals rocket launcher
Action - Add ability rocket launcher to triggering unit
Event - Whenever a unit loses an item
Condition - Item type of item equals rocket launcher
Action - Remove ability rocket launcher to triggering unit
How would I do the same in starcraft 2 galaxy editor? The event, condition, and actions?
I can't find a way to add the abilities upon picking up an item via triggers...anyone know how?
What you can do is add the ability to the hero through the data editor and also make a button for it (just like normal).
With triggers you can then disable the ability button (there are "disable" and "disallow", careful about that).
When you pick up the item, just show the ability button.
Thx, i will have to try that, but will there be enough space or what not, for adding 30 abilities to each hero unit doing it that way? Or is there a limit to how many abilities can be added to each unit in the data editor beforehand? (there was a whole mess of unique and different abilities received from picking up items totally roughly 30)
Also did any of u guys find equivalent wacraft3 "event - when unit acquires an item" "event - when unit loses an item"? (the items are not preplaced on the map ground, they are dropped by other unit players inventories upon death or bought from shops)
When you set up an inventory ability, you set a bunch of ability commands for different item actions like Drop Take Move etc. You just check to see if a unit uses an ability and if the ability is the one for drop/take or whatever.
Ok i looked in my inventory ability in the data and see the drop, move, take, iteminstant, itemtarget commands,
but for the trigger event - any unit uses ability, I can select "inventoryslot" but I can't select any of the "drop, move, take, iteminstant, itemtarget" commands, so the event can't differentiate between dropping, targeting, or picking up items it seems?
there will be a separate ability for each of the item abilities. if you set patrol as the command for drop in the inventory ability, then there will be an ability in the list that says patrol - inventoryblahblah or something like that when you do the unit ablity event.
Ok i didn't have default buttons set for the commands in the inventory ability (drop, move, iteminstant, take) etc, and once i added default buttons, I could select them with the trigger event "Whenever a unit uses an ability " Pickup item button" Inventory Slot!, Thx
But now theres another problem...
For acquiring the item, its no problem, my trigger successfully registers an item acquire, at the precise time, and can display the unit-type of the item:
Event: Unit - Any Unit uses Pickup item button at Generic6 - Complete stage (Ignore shared abilities)
Condition: (Unit type of (Triggering ability target unit)) == Rocket
Action: Debug - Display "Pickupped" as debug output using Type 1, and Do display it in the game window
Action: Debug - Display (Name of (Unit type of (Triggering ability target unit))) as debug output using Type 1, and Do display it in the game window
That above trigger works completely fine to register picking up an item, however when dropping an item, trigger cannot return the unit-type of the item being dropped:
Events: Unit - Any Unit uses Drop item button at Generic6 - Complete stage (Ignore shared abilities)
Action: Debug - Display "Dropped" as debug output using Type 1, and Do display it in the game window
Action: Debug - Display (Name of (Unit type of (Triggering ability target unit))) as debug output using Type 1, and Do display it in the game window
Only the "dropped text" gets displayed, and not the unit-type of the item, perhaps because its out of the inventory and so its cant get what item was dropped? I have tried the event for dropping the item ability at all the stages (Generic 1 Any, Generic 2 Queue, Generic 3 Execute, Generic 4 Cancel, Generic 5 Prompt, Generic 6 Completion)
Yet none of the stages can register what exactly item was dropped
So...item acquired trigger works fine, can discern the item-type of item acquired correctly
However, item dropped trigger, cannot discern the item-type of item dropped, which is crucial for knowing what item was dropped
Anyone have ideas to make the "whenever an unit uses ability, item drop etc" be able to work and know what item was dropped? (also moving item to different slot trigger doesn't work either)