So I'm new to the starcraft world editor, but I was pretty good at the warcraft editor and they are pretty similar. My problem is there doesn't seem to be a lot of functions supporting inventories/items, before I read how inventories worked, I built one out of dialog items with buttons for slots. It all worked fine until I needed to get the actual item information..heres what I have so far..
[NYI] Standard item pickup
EventsUnit-AnyUnitPicksUpAnyItemLocalVariablesConditionsActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfInventorySlotinuse[(Ownerof(Triggeringunit))][Itemslotchecker[(Ownerof(Triggeringunit))]]==FalseThen------- slots 1-5General-If(Conditions)thendo(Actions)elsedo(Actions)IfItemslotchecker[(Ownerof(Triggeringunit))]<=5ThenDialog-DestroyInventoryslot[(Ownerof(Triggeringunit))][Itemslotchecker[(Ownerof(Triggeringunit))]]Dialog-CreateanimagefordialogInventory[(Ownerof(Triggeringunit))]withthedimensions(76,76)anchoredtoTopLeftwithanoffsetof(50,50)settingthetooltipto""usingtheimageAssets\Textures\white32.ddsasaNormaltypewithtiledsettoTruetintcolorWhiteandblendmodeNormalDialog-CreateabuttonfordialogInventory[(Ownerof(Triggeringunit))]withthedimensions(76,76)anchoredtoTopLeftwithanoffsetof(((((Itemslotchecker[(Ownerof(Triggeringunit))]-1)*10)+(76*(Itemslotchecker[(Ownerof(Triggeringunit))]-1)))+50),50)settingthetooltipto(Nameof(Unittypeof(Itemcarriedby(Triggeringunit)in1)))withbuttontext""andthehoverimagesetto""Unit-Removeinventoryitem(Itemcarriedby(Triggeringunit)in1)Else------- slots 6-10General-If(Conditions)thendo(Actions)elsedo(Actions)IfAndConditionsItemslotchecker[(Ownerof(Triggeringunit))]>=6Itemslotchecker[(Ownerof(Triggeringunit))]<=10ThenDialog-DestroyInventoryslot[(Ownerof(Triggeringunit))][Itemslotchecker[(Ownerof(Triggeringunit))]]Dialog-CreateabuttonfordialogInventory[(Ownerof(Triggeringunit))]withthedimensions(76,76)anchoredtoTopLeftwithanoffsetof(((((Itemslotchecker[(Ownerof(Triggeringunit))]-1)*10)+(76*(Itemslotchecker[(Ownerof(Triggeringunit))]-1)))+50),136)settingthetooltipto"YIPEE"withbuttontext""andthehoverimagesetto""Unit-Removeinventoryitem(Itemcarriedby(Triggeringunit)in1)Else------- slots 11-15General-If(Conditions)thendo(Actions)elsedo(Actions)IfItemslotchecker[(Ownerof(Triggeringunit))]>=11ThenDialog-DestroyInventoryslot[(Ownerof(Triggeringunit))][Itemslotchecker[(Ownerof(Triggeringunit))]]Dialog-CreateabuttonfordialogInventory[(Ownerof(Triggeringunit))]withthedimensions(76,76)anchoredtoTopLeftwithanoffsetof(((((Itemslotchecker[(Ownerof(Triggeringunit))]-1)*10)+(76*(Itemslotchecker[(Ownerof(Triggeringunit))]-1)))+50),222)settingthetooltipto"YIPEE"withbuttontext""andthehoverimagesetto""Unit-Removeinventoryitem(Itemcarriedby(Triggeringunit)in1)ElseVariable-SetInventorySlotinuse[(Ownerof(Triggeringunit))][Itemslotchecker[(Ownerof(Triggeringunit))]]=TrueVariable-SetItemslotchecker[(Ownerof(Triggeringunit))]=1ElseVariable-SetItemslotchecker[(Ownerof(Triggeringunit))]=(Itemslotchecker[(Ownerof(Triggeringunit))]+1)Trigger-RunStandarditempickup(CheckConditions,Don't Wait until it finishes)
There are 3 things I'm not sure how to do. 1. Pull the item image off of the item and 2. Pull the tooltip off of the item. 3. Check button for right click instead of left. Is this possible? I do realize there is a much easier way to do an inventory but side by side I think this one looks a lot better (assuming its possible)
Should be possible to check for button clicking using a mouse click event, then a condition to check what button it was on question #3. I'm sure what you are trying to do is possible, just going to spend a LONG time to make it work, so hope time consuming isn't an issue. It does let you define your own events as well, might be worth looking into.
So, while trying to set up my right click event for dialog I noticed something strange, I created a simple trigger Display text: Y pos: {current y pos} X pos: {current x pos}. its simple and it works, BUT when I right click one of the buttons it does not display the text like it would have if I had right clicked nothing, does this mean that the button is interfering with this trigger making it not work?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I'm new to the starcraft world editor, but I was pretty good at the warcraft editor and they are pretty similar. My problem is there doesn't seem to be a lot of functions supporting inventories/items, before I read how inventories worked, I built one out of dialog items with buttons for slots. It all worked fine until I needed to get the actual item information..heres what I have so far..
[NYI] Standard item pickup
There are 3 things I'm not sure how to do. 1. Pull the item image off of the item and 2. Pull the tooltip off of the item. 3. Check button for right click instead of left. Is this possible? I do realize there is a much easier way to do an inventory but side by side I think this one looks a lot better (assuming its possible)
Should be possible to check for button clicking using a mouse click event, then a condition to check what button it was on question #3. I'm sure what you are trying to do is possible, just going to spend a LONG time to make it work, so hope time consuming isn't an issue. It does let you define your own events as well, might be worth looking into.
I believe you can use library created by Heral: http://www.sc2mapster.com/assets/easy-catalog/
Check it out. It will give you functions you need.
Wow, thats very helpful...Thank you so much.
So, while trying to set up my right click event for dialog I noticed something strange, I created a simple trigger Display text: Y pos: {current y pos} X pos: {current x pos}. its simple and it works, BUT when I right click one of the buttons it does not display the text like it would have if I had right clicked nothing, does this mean that the button is interfering with this trigger making it not work?