Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Kewun on Jul 06, 2016, 09:06 AM

Title: Resolution?
Post by: Kewun on Jul 06, 2016, 09:06 AM
How to check a players resolution? I tried with vector screens but i failed :/
Title: Re: Resolution?
Post by: Thijn on Jul 06, 2016, 03:42 PM
Why'd you need it?

Just use set your sprites/textdraws to use relative positioning and position them according to a 1024x768 screen
Title: Re: Resolution?
Post by: Kewun on Jul 06, 2016, 05:11 PM
i just want to add a notificaton if player joins example
Your resolution: 640x840, We recommend using 1366x768 at least
Title: Re: Resolution?
Post by: Thijn on Jul 06, 2016, 05:24 PM
In that case you can't :)
Title: Re: Resolution?
Post by: DizzasTeR on Jul 06, 2016, 07:02 PM
You can, unless I misunderstood the question.
Title: Re: Resolution?
Post by: Thijn on Jul 06, 2016, 08:44 PM
Right, you can probably use GUI::GetScreenSize() on the clientside to get the screen resolution.

(I've not used client scripts at all so far, so I don't know all functions out of my head yet :P)
Title: Re: Resolution?
Post by: Stormeus on Jul 08, 2016, 02:25 PM
Like @Thijn said, you can use GUI::GetScreenSize() to get the player's resolution, and Console::Print(message) to give the player a notice if their resolution is too small.
Title: Re: Resolution?
Post by: DizzasTeR on Jul 08, 2016, 02:37 PM
A small example code [client-side]:
function Script::ScriptLoad() {
    local client_resolution = GUI.GetScreenSize()
    local X = client_resolution.X, Y = client_resolution.Y;
    if( X < 1366 && Y < 768 ) {
        Console.Print( "Your resolution: " + X + "x" + Y + ", We recommend using 1366x768 at least" )
    }
}
Title: Re: Resolution?
Post by: EK.IceFlake on Jul 08, 2016, 04:49 PM
We should have a GUI.ForceScreenSize or something
Title: Re: Resolution?
Post by: DizzasTeR on Jul 08, 2016, 04:55 PM
Quote from: ext-d.CrystalBlue on Jul 08, 2016, 04:49 PMWe should have a GUI.ForceScreenSize or something

Nothing could be more useless than this, sorry mate.
Title: Re: Resolution?
Post by: Stormeus on Jul 08, 2016, 04:55 PM
Quote from: ext-d.CrystalBlue on Jul 08, 2016, 04:49 PMWe should have a GUI.ForceScreenSize or something

No.
Title: Re: Resolution?
Post by: KAKAN on Jul 09, 2016, 07:03 AM
Quote from: ext-d.CrystalBlue on Jul 08, 2016, 04:49 PMWe should have a GUI.ForceScreenSize or something
if the game would be set to windowed, it would cause problems. Like, a player has a HD monitor, but, I'll set his screen size to 4K, then, he would see a magnified version of the game. I've experienced it when I was using some ASI mods :p
And the well known, Stone age PC.
Title: Re: Resolution?
Post by: EK.IceFlake on Jul 09, 2016, 08:33 AM
Quote from: KAKAN on Jul 09, 2016, 07:03 AM
Quote from: ext-d.CrystalBlue on Jul 08, 2016, 04:49 PMWe should have a GUI.ForceScreenSize or something
if the game would be set to windowed, it would cause problems. Like, a player has a HD monitor, but, I'll set his screen size to 4K, then, he would see a magnified version of the game. I've experienced it when I was using some ASI mods :p
And the well known, Stone age PC.
I know I know its the scripters responsibility
Title: Re: Resolution?
Post by: Kewun on Jul 10, 2016, 06:59 AM
ok, thx guys!
Title: Re: Resolution?
Post by: Mötley on Jul 11, 2016, 02:49 AM
Quote from: ext-d.CrystalBlue on Jul 08, 2016, 04:49 PMWe should have a GUI.ForceScreenSize or something

LOL!!! You know what this would do to some of use right? Crash our monitors. I happen to be using a really old monitor at the moment and if the games screen is windowed and goes beyond what I can see well better off pressing the reset button on the tower as the monitor goes into sleep mode,. Had this issue with old LCD monitors in the past. So bad Idea unless you want to troll players :D. The concept is kinda cool though ;)
Title: Re: Resolution?
Post by: KAKAN on Jul 11, 2016, 08:49 AM
Quote from: Mötley on Jul 11, 2016, 02:49 AM
Quote from: ext-d.CrystalBlue on Jul 08, 2016, 04:49 PMWe should have a GUI.ForceScreenSize or something

LOL!!! You know what this would do to some of use right? Crash our monitors. I happen to be using a really old monitor at the moment and if the games screen is windowed and goes beyond what I can see well better off pressing the reset button on the tower as the monitor goes into sleep mode,. Had this issue with old LCD monitors in the past. So bad Idea unless you want to troll players :D. The concept is kinda cool though ;)
yeah, this is cool suggestion, but it can be abused in a very bad way :( I hate when I see good things are being used in a bad way
Title: Re: Resolution?
Post by: EK.IceFlake on Jul 11, 2016, 03:05 PM
We could have some signal checking that we can only set resolution to what our monitor supports
Title: Re: Resolution?
Post by: Stormeus on Jul 11, 2016, 04:28 PM
Quote from: ext-d.CrystalBlue on Jul 11, 2016, 03:05 PMWe could have some signal checking that we can only set resolution to what our monitor supports

We're not going to force people's resolutions at all. One major concern is that people could have their resolutions set to something lower than native to help their framerate. Server owners undoing that to force GUI-based features undoes that.
Title: Re: Resolution?
Post by: EK.IceFlake on Jul 11, 2016, 04:32 PM
Quote from: Stormeus on Jul 11, 2016, 04:28 PM
Quote from: ext-d.CrystalBlue on Jul 11, 2016, 03:05 PMWe could have some signal checking that we can only set resolution to what our monitor supports

We're not going to force people's resolutions at all. One major concern is that people could have their resolutions set to something lower than native to help their framerate. Server owners undoing that to force GUI-based features undoes that.
Okay
RequestScreenSize, then?
:P
GUI.RequestScreenSize(1366, 768, "Please set a resolution of 1366x768 to optimize our GUI system. Do you agree?");
Title: Re: Resolution?
Post by: Shadow on Jul 11, 2016, 05:20 PM
Quote from: Stormeus on Jul 08, 2016, 02:25 PMLike @Thijn said, you can use GUI::GetScreenSize() to get the player's resolution, and Console::Print(message) to give the player a notice if their resolution is too small.
Title: Re: Resolution?
Post by: EK.IceFlake on Jul 11, 2016, 07:58 PM
Quote from: Shadow on Jul 11, 2016, 05:20 PM
Quote from: Stormeus on Jul 08, 2016, 02:25 PMLike @Thijn said, you can use GUI::GetScreenSize() to get the player's resolution, and Console::Print(message) to give the player a notice if their resolution is too small.
For that the player will have to /rq then open VCSP then go to display settings and find the 1366x768 then quit the game and come back to VCMP. This request can do that with a click of a button
Title: Re: Resolution?
Post by: Stormeus on Jul 11, 2016, 08:07 PM
@ext-d.CrystalBlue Only if you disabled windowed mode. Regardless, we're not adding that functionality in under any circumstances and regardless of the inconvenience of having to relaunch a game.
Title: Re: Resolution?
Post by: EK.IceFlake on Jul 11, 2016, 08:09 PM
Okay
I should implement this feature in my browser
if i could... i dont want to mess around with gta-vc.set
Title: Re: Resolution?
Post by: Thijn on Jul 11, 2016, 09:28 PM
Quote from: ext-d.CrystalBlue on Jul 11, 2016, 08:09 PMOkay
I should implement this feature in my browser
if i could... i dont want to mess around with gta-vc.set
Why would you do that? Let users pick their own resolution, they often have a good reason why they're on lower resolutions. Like a crappy PC, or just because they want to do other stuff while having vcmp opened in a window.
Title: Re: Resolution?
Post by: . on Jul 11, 2016, 09:42 PM
Is there even a point to this topic? If you make the GUI look so ugly on lower resolution then I'm guessing the user will most likely play at a recommended resolution. And as long as you keep your promise and the GUI works great on the resolutions you recommend. Then it's that guy's issue if he wants to play at a lower resolution.

If you buy a car and the seller promised you that it'll work as long as it's used the way he recommended. But then you're stupid enough and remove the wheels and still expect it to work even though the seller did not guarantee such thing. Does that mean the seller must weld the wheels to the car just in case another one like you could end up buying a car from him?

If I made a promise that something works in a certain way but then people use it in a different way. Does that mean it's my fault? What dafuq kinda logic is that?
Title: Re: Resolution?
Post by: Stormeus on Jul 11, 2016, 10:01 PM
New VC:MP feature: server owners now have Player.ForceOSUpgrade() to force players to immediately upgrade to Windows 10 in order to prevent crashes. There is obviously no other way of resolving this that would make sense.
Title: Re: Resolution?
Post by: DizzasTeR on Jul 12, 2016, 03:14 AM
How fucking funny is this, I mean why on Earth do you need to force a person to use the same resolution as you do just do make GUIs work properly?

GUIs can work in every resolution, there is a thing called relative positioning and sizing on which I gave a snippet (http://forum.vc-mp.org/?topic=2752.0) and ofcourse @S.L.C as well with a different way.

Learn relative positioning so that your gui is always looking great in every resolution, if you can't then you don't need something like whatever crap was suggested. Seriously, client-side needs more callbacks and functions instead of these forceresolution crap
Title: Re: Resolution?
Post by: Thijn on Jul 12, 2016, 06:15 AM
Snippet to give a warning for low resolution has been posted, so there's not much else to say. Locked.