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.
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.
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:
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:
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.
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
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.
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:
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:
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 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.
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?
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:
ButtonClickedEventsDialog-AnyDialogItemisusedbyPlayerAnyPlayerwitheventtypeClickedLocalVariablesButtonX=0<Integer>ButtonY=0<Integer>Conditions(Useddialogitem)==Dialog[Welcome]::DialogItem[InvisibleImage]Actions------- Retreive X and Y coordinates of 'clicked' image.Variable-SetButtonX=(MouseXpositionclickedintheUI)Variable-SetButtonY=(MouseYpositionclickedintheUI)
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.
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?
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.
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.
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?
0
@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.
0
@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?
0
@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.
Thanks for helping
0
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.
0
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:
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.
Example :
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.
To find the value that was set in the editor, do the opposite.
And this concludes my first tutorial! :) Thanks for reading.
0
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:
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:
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.
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.
0
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.
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?
0
@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:
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.
0
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.
0
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.
0
Thank you BorgDragon.
0
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?
0
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.
0
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?
0
Doodads -> Props -> Light Omni...