I have a unit with an inventory ability that gives it 2 containers, 1 for equipped items and 1 for storage.
In one of the equipped slots is a targeted item. It can be one of many items, so I don't know which is in it at any point in time. So, I wanted a trigger to grab that item so I could find out what it is. But, the Inventory Slot of Item function isn't being nice to me.
First off, even when I only have one container, Inventory Slot of Item didn't work.
Trigger 1 Actions
Unit - Create one Item (Inventory) - Grenade item in the inventory of unit
Variable - Set var_slot = (Inventory Slot of (Last created inventory item))
UI - Display (Text(var_slot)) for (All players) to Subtitle area
Trigger 2 Action
Unit - Order (Triggering unit) to (Order Use Item Targeting Point( Use Item Targeted, (Item carried by
(Triggering unit) in var_slot), (Triggering ability target point))) (Replace Existing Orders)
The important part of trigger 2 is (Item carried by (Triggering unit) in var_slot)
Trigger 1 will always print out 1, i.e. first slot.
When I run the 2nd trigger, using the var_slot variable, nothing happens, because the item is apparently in the wrong slot. Debugging showed that var_slot is indeed still 1 when its running.
When I manually set var_slot to 2, however, the ability works just fine. I figured maybe it was just a +1 error all around, and if I adjusted for that I'd be fine.
But the moment I added another container, it all broke again, and I have no idea how to reference the item now at all.
Does anybody have any idea what I can do to solve this?
You can't change the action your cursor is performing, (which is related to most things like the spell ui appearing), but given how much you can change the user UI, you could probably get a custom targeting cursor to appear in place of the mouse cursor, indicating you had really better click to use the ability.
You're referring to the library that I helped with, right? It should be able to handle this
From what I understand of your problem, you're not going about it correctly. You can't use triggers to 'click' an item once and get a targeting cursor. I don't believe triggers let you modify the player's cursor like that.
You can click the dialog button, then register a "mouse is clicked" event, and use the library to issue an order on the item and target the location the mouse was clicked.
I did it in GUI, with a couple bugs.
Your c_xp_abil variable seems to shift between an effect and a string. I don't think I can do that in GUI, so I used two variables, one string and one effect.
I couldn't find a UnitXPTotal function, just a Get Experience Level function. If it really doesn't exist, you'll have to set the curXP variable in HeroGetRequiredXP via custom script.
0
I have a unit with an inventory ability that gives it 2 containers, 1 for equipped items and 1 for storage. In one of the equipped slots is a targeted item. It can be one of many items, so I don't know which is in it at any point in time. So, I wanted a trigger to grab that item so I could find out what it is. But, the Inventory Slot of Item function isn't being nice to me.
First off, even when I only have one container, Inventory Slot of Item didn't work.
Trigger 1 Actions
Unit - Create one Item (Inventory) - Grenade item in the inventory of unit
Variable - Set var_slot = (Inventory Slot of (Last created inventory item))
UI - Display (Text(var_slot)) for (All players) to Subtitle area
Trigger 2 Action
Unit - Order (Triggering unit) to (Order Use Item Targeting Point( Use Item Targeted, (Item carried by (Triggering unit) in var_slot), (Triggering ability target point))) (Replace Existing Orders)
The important part of trigger 2 is (Item carried by (Triggering unit) in var_slot) Trigger 1 will always print out 1, i.e. first slot. When I run the 2nd trigger, using the var_slot variable, nothing happens, because the item is apparently in the wrong slot. Debugging showed that var_slot is indeed still 1 when its running. When I manually set var_slot to 2, however, the ability works just fine. I figured maybe it was just a +1 error all around, and if I adjusted for that I'd be fine. But the moment I added another container, it all broke again, and I have no idea how to reference the item now at all.
Does anybody have any idea what I can do to solve this?
0
Do you have an IM that you can be contacted by?
0
I think I might have made a mistake.
You can't change the action your cursor is performing, (which is related to most things like the spell ui appearing), but given how much you can change the user UI, you could probably get a custom targeting cursor to appear in place of the mouse cursor, indicating you had really better click to use the ability.
I have no idea if this is similar to what you want, since I can't watch the videos, but this topic claims to have a unique targeting method. http://forums.sc2mapster.com/resources/trigger-libraries/11481-library-realtime-mouse-tracking-system/#posts
0
You're referring to the library that I helped with, right? It should be able to handle this
From what I understand of your problem, you're not going about it correctly. You can't use triggers to 'click' an item once and get a targeting cursor. I don't believe triggers let you modify the player's cursor like that.
You can click the dialog button, then register a "mouse is clicked" event, and use the library to issue an order on the item and target the location the mouse was clicked.
0
I have no artistic talent, so I can't design, but I'm willing to help program.
0
Have the skill apply an effect set.
It will deal damage, deal 2s stun to units of type heroic, and 4s stun to units of type not heroic.
0
I'm in the middle of basically the exact same concept myself.
Do you have an IM or something where we could talk?
0
I'm working on an RPG that could use some help. Let me know if you're interested.
0
I did it in GUI, with a couple bugs. Your c_xp_abil variable seems to shift between an effect and a string. I don't think I can do that in GUI, so I used two variables, one string and one effect. I couldn't find a UnitXPTotal function, just a Get Experience Level function. If it really doesn't exist, you'll have to set the curXP variable in HeroGetRequiredXP via custom script.
0
Unfortunately, ICQ is about the only IM that I don't have.
0
I'm making an RPG that could use some help. Do you have an IM or something where I could talk to you about it?
0
I'm working on an RPG that could use some help.
Its still early enough in development that the system isn't too complex to learn yet.
0
I have an RPG that could use lots of help.
0
@Crockeo: Go
Alex 747
0
@Crockeo: Go
I'm currently working on one.
I need both terrain and more triggers.
Do you have an IM or something we could talk over?