Will this change the dialog for all players?

X-maul

AKA: Demtrod
Reaction score
201
Code:
Preview Hero
    Events
        Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
    Local Variables
    Conditions
        Or
            Conditions
                (Used dialog item) == ButtonKarass
                (Used dialog item) == ButtonSchlar
                (Used dialog item) == ButtonHrun
                (Used dialog item) == ButtonTinker
                (Used dialog item) == ButtonMalqi
                (Used dialog item) == ButtonGunnar
                (Used dialog item) == ButtonXenon
                (Used dialog item) == ButtonEnzi
                (Used dialog item) == ButtonZetax
                (Used dialog item) == ButtonHelios
                (Used dialog item) == ButtonKrain
                (Used dialog item) == ButtonBalthu
    Actions
        General - Switch (Actions) depending on (Used dialog item)
            Cases
                General - If (ButtonKarass)
                    Actions
                        Dialog - Destroy Hero Image[(Triggering player)]
                        Dialog - Create an image for dialog Hero Dialog with the dimensions (200, 300) anchored to Top Right with an offset of (222, 150) setting the tooltip to "" using the image Assets\Textures\karassportrait_static.dds as a Normal type with tiled set to False tint color White and blend mode Normal
                        Variable - Set Hero Image[(Triggering player)] = (Last created dialog item)
                General - If (ButtonSchlar)
                    Actions
                        Dialog - Destroy Hero Image[(Triggering player)]
                        Dialog - Create an image for dialog Hero Dialog with the dimensions (200, 300) anchored to Top Right with an offset of (222, 150) setting the tooltip to "" using the image Assets\Textures\hydraliskportrait_static.dds as a Normal type with tiled set to False tint color White and blend mode Normal
                        Variable - Set Hero Image[(Triggering player)] = (Last created dialog item)
            Default
I asume this will change the dialog for all players - will I need to create a seperated dialog for all players if i want it to be unique for each player?
 

Dave312

Censored for your safe viewing
Reaction score
269
This this will change the dialog for every player. But instead of destroying the dialog item, try hiding it instead. You can hide dialog items per player.
 

X-maul

AKA: Demtrod
Reaction score
201
Okay, will just create it with a loop for each player, wont take that long from what I got now. The image is suposed to be changed every time you swap between a hero, so hiding it will create a huge load of images?
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I would do it the other way around. Right now you're creating and destroying images every time the buttons are clicked. What you should do is create the images when the map starts and then just show/hide it for different players. It's easy to accomplish and it should be more efficient as well.
 

X-maul

AKA: Demtrod
Reaction score
201
I would do it the other way around. Right now you're creating and destroying images every time the buttons are clicked. What you should do is create the images when the map starts and then just show/hide it for different players. It's easy to accomplish and it should be more efficient as well.
You mean to create all images and dialog items from map initialization and hide then untill i need them?
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Yes. That way you only have to create one image for each hero and then all players can use the same image you just hide it for everyone that are not supposed to see it yet.
 

X-maul

AKA: Demtrod
Reaction score
201
Yes. That way you only have to create one image for each hero and then all players can use the same image you just hide it for everyone that are not supposed to see it yet.
Okay, thanks for the idea, it worked just fine :)

BTW: I can't rep, as it is mostly you two who are helping me, so I'm not spreadig much rep.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top