• 0

    posted a message on clicked dialog button returns (0,0) UI coords

    @A1win: Go

    I read the patch notes and there wasn't anything regarding them removing the 'Mouse Click' trigger. I found the part you are talking about:

    "New trigger event: Mouse Moved, sent in response to the mouse being moved in the game world."

    The only part about that is how they say "...in the game world." This leads me to believe the trigger is intended for retrieving World coordinates and not UI coordinates. But, I hope I'm wrong, mouse tracking for the UI and World would be amazing.

    Posted in: Triggers
  • 0

    posted a message on clicked dialog button returns (0,0) UI coords

    @A1win: Go

    What do you mean? They are removing the ability to get UI coordinates via mouse click? If so, why would they do that?

    Posted in: Triggers
  • 0

    posted a message on clicked dialog button returns (0,0) UI coords

    @Abion47: Go

    Hm, I'm not sure I understand. When you say AbsoluteMouseX, are you referring to the Absolute Value of Mouse X? Here is how I have my 'if button is clicked' trigger set up. Just testing 'x' for now.

        Events
            Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
        Local Variables
            x = 0 <Integer>
        Conditions
            (Used dialog item) == button
        Actions
            Variable - Set x = ((Abs((Mouse X position clicked in the UI))) - (dialog width))
            Debug - Display ("x: " + (Text(x))) as debug output using Type 1, and Do display it in the game window
    

    Thanks for helping

    Posted in: Triggers
  • 0

    posted a message on player resolution?

    I found that the players resolution is stored inside the variables.txt file in their documents folder. Is there anyway to load this file and retrieve the "width" and "height" values? I spent hours searching through sc2data files and found a couple interesting lines: UI/Resolution_Colon=Resolution: UI/VideoResolution_Colon=Resolution:

    But, How do you load the values into an int?

    Thanks.

    Posted in: Triggers
  • 0

    posted a message on [Trigger] How to find actual size of a dialog in-game

    Dialogs are scaled depending on the user's resolution and UI size. The UI's size is set depending on the aspect ratio of the user's resolution. For example, If the user has a resolution with aspect ratio 4:3 (1024x768, 1152x768, etc) set in-game then the UI size will be 1600x1200. Take a look at the following chart I have created:

    Chart Please note these are the only resolutions that I am able to view from my computers. There may be missing resolutions from the chart.

    The percentages are what are multiplied to all dialogs to correctly scale them to the user's resolution. They are found by dividing either the width or height of the user's resolution with the UI size.

    ( User resolution Width  / UI Size Width  ) = Percentage;
    ( User resolution Height / UI Size Height ) = Percentage;
    

    Example :

    ( 1024 /  1600 ) = .64
    ( 768  /  1200 ) = .64
    

    To find the size of a dialog in-game, multiply the dialog size with the percentage value.

    Example:

    Dialog size is set to 256x256 in the editor. Resolution in-game is 1024x768 which has an aspect ratio of 4:3 and therefore sets the UI size to 1600x1200.

    ( 256 * .64 ) = 163.84
    

    example

    To find the value that was set in the editor, do the opposite.

    ( 163.84 / .64 ) = 256
    

    And this concludes my first tutorial! :) Thanks for reading.

    Posted in: Tutorials
  • 0

    posted a message on What is the foruma for finding UI coordinates?

    I figured it out, woot. After hours of trial and error, I found out that the screen UI resolution is set depending on the aspect ratio of the user's resolution. There is one resolution per aspect ratio. I'm in the process of making an excel spreadsheet that will list all the aspect ratios and resolutions Starcraft 2 supports.

    Here is my WIP spreadsheet: UI Screen Resolutions

    All of this is to find the exact size of a dialog via UI screen coordinates.

    Here is the formula for finding how big a dialog is with the user's resolution:

    ( User Resolution Width  / UI Screen Resolution Width )  * Dialog Width  = Dialog Size;
    ( User Resolution Height / UI Screen Resolution Height ) * Dialog Height = Dialog Size;
    

    My minimap for example: My resolution is 1024x768 which is 4:3 aspect ratio. Therefor the UI screen resolution is 1600x1200. My minimap dialog size is set to 256x256.

    ( 1024 / 1600 ) * 256 = 163.84
    ( 768  / 1200 ) * 256 = 163.84
    

    The actual size of my minimap dialog in-game is 163.84 x 163.84.

    I tried it with all the resolutions and it works.

    Posted in: Triggers
  • 0

    posted a message on What is the foruma for finding UI coordinates?

    I am creating a custom minimap for my map and I am currently trying to implement the feature that if the user clicks on a certain point on the minimap it will pan the user's camera to that point in the world. I am having trouble finding the screen coordinates of the minimap dialog. I need to know the max of X and Y of the dialog. I read somewhere that the resolution being used for all dialogs to be 1:1 from editor to game is 1920x1280. That means a dialog of 256x256 in the editor is 256x256 in game at 1920x1280 resolution.

    My dialog size is 256x256 and I am running at resolution 1024x768.

    (1 / 1920) * 1024 = .5333333333

    (1 / 1280) * 748 = .6

    Minimap Dialog max X coordinate should be: 256 * .5333333333 = 136.5333333

    Minimap Dialog max Y coordinate should be: 256 * .6 = 153.6

    That would make it a rectangle and not a square.

    Ingame the size is 164x164, a square. Dialog

    This is where I am stuck, how do I find out what the dialog size is going to be ingame while taking resolution into account?

    Posted in: Triggers
  • 0

    posted a message on clicked dialog button returns (0,0) UI coords

    @s3rius: Go

    How do you get the x/y positions of the button or any dialog item for that matter? The only thing I can find are size and offset, which only return the values assigned in the editor.

    I tried putting an image over the button and setting it to have a higher priority but I couldn't get it to work. How do you know if the user has clicked on the dialog image? I had it set up like this:

    Button Clicked
        Events
            Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
        Local Variables
            ButtonX = 0 <Integer>
            ButtonY = 0 <Integer>
        Conditions
            (Used dialog item) == Dialog[Welcome]::DialogItem[InvisibleImage]
        Actions
            ------- Retreive X and Y coordinates of 'clicked' image.
            Variable - Set ButtonX = (Mouse X position clicked in the UI)
            Variable - Set ButtonY = (Mouse Y position clicked in the UI)
    

    The trigger never initiates because images cannot be interacted with, I'm assuming. If I swap the conditions to point to the button, I simply get (0,0) returned.

    Posted in: Triggers
  • 0

    posted a message on clicked dialog button returns (0,0) UI coords

    Hello,

    I'm trying to retrieve the UI coordinates of X and Y from a clicked dialog button. Every time I click the button, it returns (0, 0). I tried moving the button around the screen as well and it still returns (0,0). I need this button to find out the X and Y coordinates of the button so I can find what resolution the user has it set to and then adjust the map's custom UI accordingly. If I cannot use a button and have to use a image instead, how will I know that the user has clicked on the image?

    Thanks.

    Posted in: Triggers
  • 0

    posted a message on Dialog background is transparent

    Hello, I created a dialog and set it's background to 'ui_battle_metalframe_inner' and it works great but the middle part of the dialog is completely transparent. How would I go about making this area black and opaque? Thanks.

    Posted in: Triggers
  • 0

    posted a message on Play animation for monlyth light bridge

    Thank you BorgDragon.

    Posted in: Data
  • 0

    posted a message on Play animation for monlyth light bridge

    If that isn't possible, is there a way to select all units that use X actor in the trigger editor and then tell them to play an animation?

    Posted in: Data
  • 0

    posted a message on Play animation for monlyth light bridge

    I'm using the monlyth light bridge in my map. I was wondering if there was a way to automatically start the "Stand" and "Work" animations via the data editor instead of using the play animation for actor trigger.

    Posted in: Data
  • 0

    posted a message on Hive Keeper - Dungeon Keeper Mod

    Incredible job so far. Dungeon keeper is one of my favorite games of all time and it is shame they never made a third one. I am really looking forward to playing this. I have a question though if you don't mind answering. How did you do the square terrain blocks?

    Posted in: Project Workplace
  • 0

    posted a message on glowing aura doodad?

    Doodads -> Props -> Light Omni...

    Posted in: Miscellaneous Development
  • To post a comment, please or register a new account.