well the easiest to implement solution is just to make duplicates of the inventory for each hero, and duplicates of the ability as well. so each hero has it's own inventory and ability.
now the hard way to do this is using catalogs to set the value correctly per player.
well you've actually got it there already: Catalog Set Value of Item Containers for EquipmentContainer Model Model of Triggering Unit.
It will prolly end up like this though:
Catalog - Set value of Item Containers "EquipmentContainer" "Model" for player (Triggering player) to (String((Unit type of (Triggering unit))))
I haven't gotten right click events to work. but what I do have working are left click and double click events.
left click is move around, double click is use item if possible.
you can get the default minimap and commandcard outside of the default UI using Dialog Items.
Yes, many people have made their own minimap designs, command card designs.
I on the other hand didn't bother with that, and found a way to get the minimap working outside of the default UI.
Here is the Minimap line:
Dialog - Create a Image for dialog (Last created dialog) using the template "MinimapPanel/MinimapPanelTemplate"
And here the CommandCard one:
Dialog - Create a Image for dialog (Last created dialog) using the template "CommandPanel/CommandPanelTemplate"
and here is an image with them outside there UI:
ok now for some more code to make it completely copy&paste stuff.
I've created a custom inventory but I still need some of the default inventory functionality for several of my items.
So what I want is to hide the inventory button.
You see the little square standing above the command card, that's the one that I want to get rid off.
Yes I know it ain't there when the unit is not selected, but when the unit is selected I don't want it to be there either.
For those who want to know how I created that Commandcard and Minimap I'll post it somewhere the coming week on the forums, or you can ask me on IRC and I'll give it to you.
ok, just tested it and it was giving an error, as you said.
I've included my test map here.
If you run it and type -spawn <UnitName> then it will create an unit and also display the last created unit in the leaderboard, with text and icon.
example: -spawn Marine
Although I can't see what is wrong with what I typed earlier, I've made it into a function that you can copy from the included map and paste in your map. you can then just call that function to retrieve the UnitIcon.
This only works when the Actor is the same as the Unit, It might need some altering when that isn't the case. But for all default units it will work.
Players are numbers. so you can simply use arrays like:
Set PlayerUnit[Triggering Player] = Last Created Unit.
or if you create an unit per player:
Set PlayerUnit[1] = Elf(123,123)
The Elf at coördinates 123,123 is used for player 1
then you can use that PlayerUnit variable in other triggers where you have a player.
for example:
Event - Any Player presses W down
Action - Issue order (Halt Position) to PlayerUnit[Triggering Player] (you get the idea XD)
I'd suppose a customscript like this would work:
SetVariable(lv_unitIcon, (CatalogFieldValueGet(c_gameCatalogActor, (StringToText2((UnitGetType(lv_unit)))), "UnitIcon", c_playerAny)))
I haven't tested that line though, it might give some errors.
A Translation of what it does:
SetVariable ==> the Set Variable function
lv_unitIcon ==> the local variable named unitIcon (the type of this variable is Image(File) )
CatalogFieldValueGet ==> this retrieves info from what you can set in the data editor.
c_gameCatalogActor ==> this tells the CatalogFieldValueGet to look in the Actors catalog.
StringToText2 ==> This one is a bit confusing. what it does isn't transforming a string to a text, but it transforms a gamelink to a string.
UnitGetType ==> It retrieves the Unit Type gamelink of the given unit.
lv_unit ==> the local variable named unit (the type of this variable is Unit)
"UnitIcon" ==> the field that is read from the catalog. in this case it retrieves the UnitIcon.
c_playerAny ==> which player's catalog should be read?, in this case it doesn't matter since all the players have the same data for what we're trying to retrieve.
You'll need to customcode it because you want it to return a type of Image(File), and there is no conversion from string to Image(File), even though they're both just strings.
0
@InfamousBus: Go
well the easiest to implement solution is just to make duplicates of the inventory for each hero, and duplicates of the ability as well. so each hero has it's own inventory and ability.
now the hard way to do this is using catalogs to set the value correctly per player.
well you've actually got it there already: Catalog Set Value of Item Containers for EquipmentContainer Model Model of Triggering Unit.
It will prolly end up like this though:
Catalog - Set value of Item Containers "EquipmentContainer" "Model" for player (Triggering player) to (String((Unit type of (Triggering unit))))
0
@s3rius: Go
http://www.sc2mapster.com/assets/dialog-item-templates/ <== now as an asset with more then what I've listed above.
0
@MisterTeaRealOne: Go
I haven't gotten right click events to work. but what I do have working are left click and double click events. left click is move around, double click is use item if possible.
0
you can get the default minimap and commandcard outside of the default UI using Dialog Items.
Yes, many people have made their own minimap designs, command card designs.
I on the other hand didn't bother with that, and found a way to get the minimap working outside of the default UI.
Here is the Minimap line:
Dialog - Create a Image for dialog (Last created dialog) using the template "MinimapPanel/MinimapPanelTemplate"
And here the CommandCard one:
Dialog - Create a Image for dialog (Last created dialog) using the template "CommandPanel/CommandPanelTemplate"
and here is an image with them outside there UI:
ok now for some more code to make it completely copy&paste stuff.
now for the galaxy code
There are more Templates available and I might be adding them at some other time to this post.
0
I've created a custom inventory but I still need some of the default inventory functionality for several of my items.
So what I want is to hide the inventory button.
You see the little square standing above the command card, that's the one that I want to get rid off.
Yes I know it ain't there when the unit is not selected, but when the unit is selected I don't want it to be there either.
For those who want to know how I created that Commandcard and Minimap I'll post it somewhere the coming week on the forums, or you can ask me on IRC and I'll give it to you.
0
No problem :)
0
you can enable a trigger debugger at:
File ==> Preferences ==> Test Document.
[v] Run Game In A Window
[v] Show Trigger Debugging Window
Next you can use Debug Message to throw messages to that window when testing XD.
This might help you find it out faster next time.
0
ok, just tested it and it was giving an error, as you said.
I've included my test map here.
If you run it and type -spawn <UnitName> then it will create an unit and also display the last created unit in the leaderboard, with text and icon.
example: -spawn Marine
Although I can't see what is wrong with what I typed earlier, I've made it into a function that you can copy from the included map and paste in your map. you can then just call that function to retrieve the UnitIcon.
This only works when the Actor is the same as the Unit, It might need some altering when that isn't the case. But for all default units it will work.
0
@thewightnish: Go
hmmm I'll go test it out, I'll throw in a map with my next reply, so you can see what I did.
0
@Fropper: Go
Leaderboard - Sort (Last created leaderboard) by column 1, in Ascending order, with priority 1 <== that action would suffice I'd say.
0
@DirtyDevious: Go
it didn't disappear, your order is: order without a target.
change the order to "Order targeting point" and the move order will be there.
0
@Sumsin: Go
Players are numbers. so you can simply use arrays like:
Set PlayerUnit[Triggering Player] = Last Created Unit.
or if you create an unit per player:
Set PlayerUnit[1] = Elf(123,123)
The Elf at coördinates 123,123 is used for player 1
then you can use that PlayerUnit variable in other triggers where you have a player.
for example:
Event - Any Player presses W down
Action - Issue order (Halt Position) to PlayerUnit[Triggering Player] (you get the idea XD)
0
@thewightnish: Go
You'll have to do some catalog work for it.
I'd suppose a customscript like this would work:
SetVariable(lv_unitIcon, (CatalogFieldValueGet(c_gameCatalogActor, (StringToText2((UnitGetType(lv_unit)))), "UnitIcon", c_playerAny)))
I haven't tested that line though, it might give some errors.
A Translation of what it does:
SetVariable ==> the Set Variable function
lv_unitIcon ==> the local variable named unitIcon (the type of this variable is Image(File) )
CatalogFieldValueGet ==> this retrieves info from what you can set in the data editor.
c_gameCatalogActor ==> this tells the CatalogFieldValueGet to look in the Actors catalog.
StringToText2 ==> This one is a bit confusing. what it does isn't transforming a string to a text, but it transforms a gamelink to a string.
UnitGetType ==> It retrieves the Unit Type gamelink of the given unit.
lv_unit ==> the local variable named unit (the type of this variable is Unit)
"UnitIcon" ==> the field that is read from the catalog. in this case it retrieves the UnitIcon.
c_playerAny ==> which player's catalog should be read?, in this case it doesn't matter since all the players have the same data for what we're trying to retrieve.
You'll need to customcode it because you want it to return a type of Image(File), and there is no conversion from string to Image(File), even though they're both just strings.
0
@MisterTeaRealOne: Go
Well if I understand you correctly, you want to have items which are not 1x1 sized.
See this youtube movie as to what I think you mean:
That inventory system is made with Dialog Items.
I don't know of any way to make the default SC2Inventory slots larger.
0
@HeyRevolver: Go
1) owner of triggering unit != Number of Neutral player <== condition
2) use last created unit instead.