Staredit Network > Forums > SC2 Assistance > Topic: Custom Inventory Dialogs...
Custom Inventory Dialogs...
Nov 20 2010, 5:18 pm
By: NicholasBeige  

Nov 20 2010, 5:18 pm NicholasBeige Post #1



So, here's the scoop.

I want to create an inventory system using Dialogs.

Problem: Everything.

I want to be able to do something like this:
  • events
    • Any unit picks up any item.
  • actions
    • Set 'variable 1' == The Button ICON field in the data editor of the Item.
    • Set 'variable 2' == String(Name of Unit Type(Manipulated Item))
    • Set 'variable 2' == Text(The Tool-tip TEXT field in the data editor of the item.

Basically.. I am failing with the Catalog Field Value Set/Get actions. Can anyone explain, in detail, how they work and what variables are best to use when doing the above?



None.

Nov 21 2010, 7:38 pm Roy Post #2

An artist's depiction of an Extended Unit Death

Well, since nobody else is biting, I'll tell you what I fear to be the truth:

The Galaxy Editor does not have support for what you are requesting at this point in time. For example, an icon cannot be stored into a variable. Of the variables you wish to access directly, only one is seemingly possible (variable 2). Therefore, much of what you're asking is going to need to be hardcoded. Here's an example of what you would need to do:

Inventory
  Events
    Unit - Any Unit Picks Up Any Item
  Local Variables
    unitType = (Unit type of (Triggering inventory item)) <Game Link - Unit>
  Conditions
  Actions
    Dialog - Create a Label for dialog MyGlobalDialog
    SetIcon((Last created dialog item), unitType)
    Dialog - Set (Last created dialog item) text to (Name of unitType) for (All players)
    SetTooltip((Last created dialog item), unitType)


SetIcon
  Options: Action
  Return Type: (None)
  Parameters
    Dialog Item = No Dialog Item <Dialog Item>
    Unit Type = No Game Link <Game Link - Unit>
  Grammar Text: SetIcon(Dialog Item, Unit Type)
  Hint Text: Sets the Dialog Item's icon to the icon of the Unit Type
  Custom Script Code
  Local Variables
  Actions
    General - If (Conditions) then do multiple (Actions)
      If Then Else
        General - Else if (Conditions) then do (Actions)
          Else If
            Unit Type == Marine
          Then
            Dialog - Set Dialog Item image to Assets\Textures\marine_normal.dds for (All players)
        General - Else if (Conditions) then do (Actions)
          Else If
            Unit Type == Ghost
          Then
            Dialog - Set Dialog Item image to Assets\Textures\normals_ghost_portrait.dds for (All players)


SetTooltip
  Options: Action
  Return Type: (None)
  Parameters
    Dialog Item = No Dialog Item <Dialog Item>
    Unit Type = No Game Link <Game Link - Unit>
  Grammar Text: SetTooltip(Dialog Item, Unit Type)
  Hint Text: Sets the Dialog Item's icon to the icon of the Unit Type
  Custom Script Code
  Local Variables
  Actions
    General - If (Conditions) then do multiple (Actions)
      If Then Else
        General - Else if (Conditions) then do (Actions)
          Else If
            Unit Type == Marine
          Then
            Dialog - Set (Last created dialog item) tooltip to "This is the tooltip for the marine." for (All players)
        General - Else if (Conditions) then do (Actions)
          Else If
            Unit Type == Ghost
          Then
            Dialog - Set (Last created dialog item) tooltip to "This is the tooltip for the ghost." for (All players)


You would have to make an if/else statement for each item and manually find the icon and type in the tooltip. I know this sounds ridiculous, and I hope someone will post saying that I'm wrong and these fields can be accessed directly.

Also, I haven't tested this, so I don't know if creating a Label item for the dialog is the right choice.

Hope this helped in one way or another!




Nov 21 2010, 8:49 pm Temp Post #3



I don't think doing what he wants is impossible but it may be more effort then it is worth. Everything from the catalog should be returned as strings so you should be able to use this to your advantage. Tooltips would be easy to get that way.

For the button icons the only improvement I can give over Roy's implementation is use an array of pre-inputted data to do a lookup rather then have a giant trigger full of ifs.

Edit: You may be able to do better with the icons by doing some of it with galaxy code instead of triggers, I will need to look into it

Edit 2: Ok this is stupid. The variable that holds icon information (File->image type) is really just a string in galaxy which means when you use something like create dialog button and set the hover image in galaxy really your just passing it a string but in the triggers it will only accept the File->Image type. This means that it should be really simple to get the info from the catalog keep it all in strings and use it whenever you want. You can refer to this for info on how to use the catalog stuff.

Post has been edited 1 time(s), last time on Nov 21 2010, 9:58 pm by Temp.



None.

Nov 23 2010, 3:34 pm DevliN Post #4

OVERWATCH STATUS GO

I already told Cardinal this (because I think I gave him the idea), but to everyone else: Blizzard DotA's inventory was done through Triggers, and the end result is below.


I remember being able to buy items from a vendor (like you normally would when using the data editor) and then having them appear on that 6-button bar. I don't think you were able to move them around, but I do remember that you could upgrade them. Also, some of them had charges (which I didn't know you could display through Triggers, unless that's well-placed text in the dialog).



\:devlin\: Currently Working On: \:devlin\:
My Overwatch addiction.

Nov 23 2010, 6:00 pm NicholasBeige Post #5



Awesome Tempz! I knew it was possible... I also made the mistake once of asking Temp a pr0 map making question thinking it was you. The funny part was I meant to send the message to Ahli... don't think I had my pills coffee that day.

Gonna maybe start working on my custom UI sometime this week.

If someone wants to write the (boring) data editor inventory system wiki feel free to do so.



None.

Nov 23 2010, 11:36 pm DevliN Post #6

OVERWATCH STATUS GO

I'll do the Data one, since I just dealt with all that on my own map. :)



\:devlin\: Currently Working On: \:devlin\:
My Overwatch addiction.

Nov 24 2010, 12:26 am NicholasBeige Post #7



Well, as far as I am aware - the custom dialog inventory is going to need the Data Editor inventory so that your hero can pick up items.

You can hide the fact that a unit has an inventory quite easily by just hiding the UI Frame 'inventory panel' with triggers. So that worked out nicely.

Got an assignment (two actually), due in less than 12 hours... so I need to write about 5,000 words... yawn :D i'll get working on the custom inventory sometime



None.

Nov 24 2010, 2:05 am Jack Post #8

>be faceless void >mfw I have no face

Quote from name:Cardinal
Well, as far as I am aware - the custom dialog inventory is going to need the Data Editor inventory so that your hero can pick up items.

You can hide the fact that a unit has an inventory quite easily by just hiding the UI Frame 'inventory panel' with triggers. So that worked out nicely.

Got an assignment (two actually), due in less than 12 hours... so I need to write about 5,000 words... yawn :D i'll get working on the custom inventory sometime
If you use solely triggers then you don't need to have the whole data editor inventory with heroes picking up items. Instead, use variables and just remove or move the item instead.



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Nov 25 2010, 3:52 am Temp Post #9



Quote from Jack
If you use solely triggers then you don't need to have the whole data editor inventory with heroes picking up items. Instead, use variables and just remove or move the item instead.

Harder to make sure the effects of the items are applied to a unit this way. Easier to just use the data editor.



None.

Nov 25 2010, 4:12 am NicholasBeige Post #10



Yeah, the data editor is my module.. the Trigger editor can go suck donkeys for all I care...

I'm still testing the concept of this out using text and strings etc... working, so far... I'll keep tinkering around with it tomorrow.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2022-6-29. : 8:18 am]
GGmano -- I would have released my New map yesterday if scmdraft didnt fail on saving the merged file
[2022-6-29. : 8:17 am]
GGmano -- Not cool when I made such Nice system and I could make it even better if more trigger allowed
[2022-6-29. : 8:16 am]
GGmano -- Damn now I have reduce trigger amount impossible to save fil
[2022-6-27. : 11:03 pm]
jjf28 -- GGmano
GGmano shouted: its not possible to move around a p12 owned preplaced a
when I tried - ya not possible
[2022-6-27. : 11:02 pm]
Zoan -- idk, maybe if you change a setting with euds you can do it. Something like the Unit List and Palletes thing or whatever it's called
[2022-6-27. : 9:42 pm]
GGmano -- i thought that would be easy but dont work on my test
[2022-6-27. : 9:42 pm]
GGmano -- its not possible to move around a preplaced p12 owned dark swarm?
[2022-6-27. : 9:41 pm]
GGmano -- dark swarm
[2022-6-27. : 9:41 pm]
GGmano -- its not possible to move around a p12 owned preplaced a
[2022-6-27. : 1:08 pm]
jjf28 -- having played the architect just fine - no not necessarily
Please log in to shout.


Members Online: Roy, X405