Hi, this might be impossible but I need to make a unit use an ability it gains from an item when the mouse is pressed, I have to go so I don't have much time to explain, if you need more info ask. (please answer by giving a map, using screenshots or explaining well as I am fairly new to the editor).
I know I saw (thats why i asked this) but i still want my hero to be selected so i can see inventory and i want to be able to use (by right clicking) an ability that an item gave me and if I swich item, ill get a new one instead (ex i got sniper item give me snipe and staff gives me psi storm, if i equip staff i can use psi storm by left clicking and if I equip sniper I can use snipe by left clicking)
the trigger would do (some of these actions are not real just to show what it might look like):
event
-the left mouse button is pressed
action
-look for item in bag weapon (row 0, column 0) and use that item for (unit (war pig) at position of mouse cursor.
I am not sure if this is possible to do but if it is please help me.
I would go about setting vaariable which defines the carried item. Just use an int and go sth like this:
global variable integer 'carried item' = 0 the number of this variable defines the carried item
Then a trigger which sets the variable according to the carried item when an item is pickted up
event - "player collects item" I don't exactly know how ur items work, so u'll need to figure the event out urself
actions - switch "collected item"
case (sniper item) - set 'carried item' = 1
case (staff) - set 'carried item' = 2
and so on
and then the trigger that triggers the items effect
event - player presses right mouse button down (or however this is described...)
actions - switch ('carried item')
case (0) sth like create text messag or a text tag near the hero "you don't carry an item"
case (1) - use ability with target and then just put psy storm or whatever with target clicked mouse position
This way it should work. I cannot recheck on the exact texts for the events and functions right now as I am currently not at home but you get the idea of the triggers. I am sure you will make it work.
If you don't understand sth, let me know and ill try to explain in more detail
Hi, this might be impossible but I need to make a unit use an ability it gains from an item when the mouse is pressed, I have to go so I don't have much time to explain, if you need more info ask. (please answer by giving a map, using screenshots or explaining well as I am fairly new to the editor).
Thanks
@pokenoufl: Go
Try using OneTwoSC's Diablo scheme. That might help :)
I know I saw (thats why i asked this) but i still want my hero to be selected so i can see inventory and i want to be able to use (by right clicking) an ability that an item gave me and if I swich item, ill get a new one instead (ex i got sniper item give me snipe and staff gives me psi storm, if i equip staff i can use psi storm by left clicking and if I equip sniper I can use snipe by left clicking)
the trigger would do (some of these actions are not real just to show what it might look like): event -the left mouse button is pressed action -look for item in bag weapon (row 0, column 0) and use that item for (unit (war pig) at position of mouse cursor.
I am not sure if this is possible to do but if it is please help me.
Thanks
This is totally possible.
I would go about setting vaariable which defines the carried item. Just use an int and go sth like this: global variable integer 'carried item' = 0 the number of this variable defines the carried item
Then a trigger which sets the variable according to the carried item when an item is pickted up
event - "player collects item" I don't exactly know how ur items work, so u'll need to figure the event out urself
actions - switch "collected item" case (sniper item) - set 'carried item' = 1 case (staff) - set 'carried item' = 2 and so on
and then the trigger that triggers the items effect
event - player presses right mouse button down (or however this is described...)
actions - switch ('carried item') case (0) sth like create text messag or a text tag near the hero "you don't carry an item" case (1) - use ability with target and then just put psy storm or whatever with target clicked mouse position
This way it should work. I cannot recheck on the exact texts for the events and functions right now as I am currently not at home but you get the idea of the triggers. I am sure you will make it work.
If you don't understand sth, let me know and ill try to explain in more detail