Hello, I have found an interesting bug regarding the camera mouse relative mode permanently hiding the mouse cursor.
If you apply the "Camera - Lock camera mouse relative mode On for player #" coupled with "General - Wait" statement, it will hide the mouse cursor indefinitely for the player. There is no way to get the mouse cursor back and it remains hidden even if you exit the map; you must shut down and restart the application. Turning the "Lock mouse relative mode Off" or using "Show Mouse Cursor" will not bring back the cursor.
This library obtains the player's resolution, UI resolution, and scale value with a mouseclick.
Changelog
New from v1.10
Works better on battle.net (No longer have to ask the player to hold while clicking)
Screen flips due to the validation trigger removed
Able to check if the player's resolution has changed with the use of a dialog
Incorrect numbers clicking while moving the mouse fixed
New from v1.00
Will now work with ANY resolution
Retrieves the player's UI screen size (Essential for creating dialogs)
Now works in Windowed Mode
Nearly half the size of v1.00 (5.30KB compressed)
Ability to check resolution to ensure its validity
Able to initiate the system for individual players
No longer required to enter Camera bounds
How to use
There are two functions that can be used:
Player Resolution, UI Resolution, Scale Value
Use this function to initiate the system and obtain the selected player's resolution information.
Check Resolution
Use this function to check if the player's resolution has changed. It will display an invisible dialog button at the location of their mouse relative to the UI resolution of what it has stored. If the mouse does not enter the dialog then the resolution has been changed. The system will then be reinitialized for that player.
Creating Dialogs/Screen objects
After the system has been initiated for the selected player, the information obtained will be stored in three variables:
getResolution_PlayerResolution[15][1]
getResolution_PlayerUIResolution[15][1]
getResolution_PlayerScaleValue[15]
The first dimension of the arrays are the player's number (0-15). The second dimension of the resolution variables are the Width(0) and Height(1).
When creating dialog or screen objects, you use the PlayerUIResolution variable. You multiply this variable from a range of 0 to 1. 1 being 100%. Here is an example dialog that takes up 25% of the player's screen.
If the player's UI resolution were 1600x1200, then the above example dialog would translate to:
SetsizeofExampleDialogto((1600*.5),(1200*.5))
which is 25%.
With this, you can setup dialogs to be exact sizes and at exact positions on the player's screen.
Is there a way to assign a comparison operator to a variable? I tried creating a variable of 'Preset - Any Comparison Operator' but it only has the '==' and '!=' operators both of which result in syntax errors if assigned to the variable.
I then noticed Integers have a huge list of presets including all of the comparison and arithmetic operators but unfortunately result in syntax errors if used.
So, Is there any other way or do we just have to wait for Blizz to fix?
Does anybody know of any tricks to make the editor math for reals more accurate? I need precise numbers and the editor is giving me numbers that are too inaccurate. For example:
Variable-Settest[0]=(121.9048*0.0082)
The editor returns 1.01172 which is incorrect. The number should be .99961936. I know that it isn't possible for it to be that accurate due to the editor using fixed points and not floats, but I would like to get it to at least .99~
I read from another post to multiply both numbers by 4096 and then divide by 4096 but the returned value was, 48.7627, which is obviously way too large.
I know. But, how would you retrieve the UI coordinates of the image bounds if it is different at each resolution? As far as I know, there is no way to retrieve in-game values of a dialog from a player's perspective.
There is problem with that though. How do you know if they user has clicked on the image compared to just clicking randomly on the screen? There are no events/conditions to use for this scenario to fire a trigger except "If user clicks mouse". You cannot use a dialog image with a "dialog item is used" event or "used dialog item" condition. I thank you for helping me though. I think I'm just going to wait until patch 1.2 and see how the real-time mouse tracking goes. If that mouse tracking does record GUI-coordinates then what I'll do is create an array of size 10 that records the coordinates every .1 seconds and when the user clicks on the button and it returns (0,0), the 'fired' trigger will just cycle through the array for last known greater than 0 coordinates and use that. That would work.
I think the closest you can get it grabbing the x/y positions of the clicked button.
Or if you really want that button and the exact x/y position then you can place a dialog image above the button and make it transparent. You will then click on the dialog image (because the button is stuck underneath it) and this returns valid X/Y coordinates and triggers the UI click event (which you have to use then).
Sorry to re-bump this thread but I tried this and it doesn't return any values unless I'm doing something wrong.
Set up Dialog, button, image
EventsGame-MapinitializationLocalVariablesConditionsActions------- DialogDialog-CreateaModaldialogofsize(256,256)at(0,0)relativetoCenterofscreenVariable-Setdialog=(Lastcreateddialog)------- ButtonDialog-Createabuttonfordialogdialogwiththedimensions(128,128)anchoredtoCenterwithanoffsetof(0,0)settingthetooltipto""withbuttontext"Button"andthehoverimagesetto""Variable-Setbutton=(Lastcreateddialogitem)Dialog-Set(Lastcreateddialogitem)RenderPriorityto0for(Allplayers)------- ImageDialog-Createanimagefordialog(Lastcreateddialog)withthedimensions(128,128)anchoredtoCenterwithanoffsetof(0,0)settingthetooltipto""usingtheimageAssets\Textures\white32.ddsasaNormaltypewithtiledsettotruetintcolorWhiteandblendmodeAlphaVariable-Setimage=(Lastcreateddialogitem)Dialog-Set(Lastcreateddialogitem)RenderPriorityto512for(Allplayers)------- Show allDialog-Showdialogfor(Allplayers)Dialog-Showbuttonfor(Allplayers)Dialog-Showimagefor(Allplayers)
0
I know this is a bit of a late response but:
To fix this, press Ctrl+T or View -> Show Terrain -> Show Hidden Terrain Cells
0
Hello, I have found an interesting bug regarding the camera mouse relative mode permanently hiding the mouse cursor.
If you apply the "Camera - Lock camera mouse relative mode On for player #" coupled with "General - Wait" statement, it will hide the mouse cursor indefinitely for the player. There is no way to get the mouse cursor back and it remains hidden even if you exit the map; you must shut down and restart the application. Turning the "Lock mouse relative mode Off" or using "Show Mouse Cursor" will not bring back the cursor.
The following will work.
The following will not work.
EDIT: This also locks the Camera.
0
getResolution v1.20
About
This library obtains the player's resolution, UI resolution, and scale value with a mouseclick.
Changelog
New from v1.10
New from v1.00
How to use
There are two functions that can be used:
Use this function to initiate the system and obtain the selected player's resolution information.
Use this function to check if the player's resolution has changed. It will display an invisible dialog button at the location of their mouse relative to the UI resolution of what it has stored. If the mouse does not enter the dialog then the resolution has been changed. The system will then be reinitialized for that player.
Creating Dialogs/Screen objects
After the system has been initiated for the selected player, the information obtained will be stored in three variables:
The first dimension of the arrays are the player's number (0-15). The second dimension of the resolution variables are the Width(0) and Height(1).
When creating dialog or screen objects, you use the PlayerUIResolution variable. You multiply this variable from a range of 0 to 1. 1 being 100%. Here is an example dialog that takes up 25% of the player's screen.
If the player's UI resolution were 1600x1200, then the above example dialog would translate to:
which is 25%.
With this, you can setup dialogs to be exact sizes and at exact positions on the player's screen.
Debug
Here is with debugging enabled:
Download
Library
http://www.sc2mapster.com/media/files/543/832/getResolutionv120_GUI.SC2Lib
Map
http://www.sc2mapster.com/media/files/543/831/getResolution_v1.20_GUI.SC2Map
0
Is there a way to assign a comparison operator to a variable? I tried creating a variable of 'Preset - Any Comparison Operator' but it only has the '==' and '!=' operators both of which result in syntax errors if assigned to the variable.
I then noticed Integers have a huge list of presets including all of the comparison and arithmetic operators but unfortunately result in syntax errors if used.
So, Is there any other way or do we just have to wait for Blizz to fix?
Thanks.
0
@ResolveHK: Go
It completely depends on the players resolution and their aspect ratio. For each aspect ratio, there is a set UI size. From there, the player's resolution is divided by the aspect ratio's UI size to determine what value to scale down the dialogs. Take a look at my tutorial: http://forums.sc2mapster.com/resources/tutorials/16364-trigger-how-to-find-actual-size-of-a-dialog-in-game/
So, if the player's resolution is 1680x1050 and you create a dialog of size 512x384 then its actual size in-game for that player would be:
(1680/1900) * dialogWidth = 448
(1050/1200) * dialogHeight = 336
This also applies to Offsets.
0
Well I think I got it as close as its going to get.
So, I am off by .00049.
0
@dgh64: Go
Hm, I tried:
But, in-game, it says cannot divide by 0. When I input in my calculator, I get the correct number, .99961936.
Edit: Ah, because 4096^2 > 524288 (max size for real)
So, I tried:
and got value: .0117188
0
Hello,
Does anybody know of any tricks to make the editor math for reals more accurate? I need precise numbers and the editor is giving me numbers that are too inaccurate. For example:
The editor returns 1.01172 which is incorrect. The number should be .99961936. I know that it isn't possible for it to be that accurate due to the editor using fixed points and not floats, but I would like to get it to at least .99~
I read from another post to multiply both numbers by 4096 and then divide by 4096 but the returned value was, 48.7627, which is obviously way too large.
So, how can I improve accuracy? Thanks.
0
@s3rius: Go
Thanks.
0
Hello,
What is the current memory cap for triggers? Is the cap for uncompressed or compressed?
Thanks.
0
(removed)
0
@s3rius: Go
I know. But, how would you retrieve the UI coordinates of the image bounds if it is different at each resolution? As far as I know, there is no way to retrieve in-game values of a dialog from a player's perspective.
0
@s3rius: Go
To check to see if the mouse position is in the image bounds, I have to get the world coordinates of the mouse click relative to the dialog box?
0
@s3rius: Go
There is problem with that though. How do you know if they user has clicked on the image compared to just clicking randomly on the screen? There are no events/conditions to use for this scenario to fire a trigger except "If user clicks mouse". You cannot use a dialog image with a "dialog item is used" event or "used dialog item" condition. I thank you for helping me though. I think I'm just going to wait until patch 1.2 and see how the real-time mouse tracking goes. If that mouse tracking does record GUI-coordinates then what I'll do is create an array of size 10 that records the coordinates every .1 seconds and when the user clicks on the button and it returns (0,0), the 'fired' trigger will just cycle through the array for last known greater than 0 coordinates and use that. That would work.
0
@s3rius: Go
Sorry to re-bump this thread but I tried this and it doesn't return any values unless I'm doing something wrong.
Set up Dialog, button, image
If player clicks mouse