NS2 Multi-Monitor HUD LUA Changes

SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
edited May 2012 in Modding
The necessary LUA changes to support the HUD on multiple monitors
Updated on 5/19/2012: Now supports changes to HUD in Build 208

We now have multi-monitor HUD support for NS2. For those of you who are running 3 or 5 monitor configurations, you know how frustrating it can be to constantly turn your head to the left or right to check out your minimap or health and ability stats. These LUA changes will allow for all of the GUI elements to reside on the center monitor of your multi-monitor configuration.

Features
  • Moves Marine and Alien GUI elements to central monitor
  • Moves Marine and Alien Commander GUI elements to central monitor
  • Automatically detects between single and multiple monitors

Limitations
  • Does not support in-game resolution changes
  • Auto detection of single monitor assumes no single monitor horizontal resolutions above 2600 pixels
  • Team Chat vs. All Chat inputs display in different x-axis values depending on whether you are Alien or Marine
  • Close button in Marine buy menu does not properly move to center monitor
  • Jet Pack Buy Menu does not work properly when using more than one monitor. Results in not being able to purchase jet packs

I've tested this a bunch using my own private server as well as public games and so far it seems to work very well. However, let me state that I am not a professional software developer, so if someone finds a cleaner way to do this or can institute modifications to allow resolution changes within game, that would be fantastic.

Also, if anyone finds any elements that I may have missed when moving items to the central monitor, please let me know (and provide a screenshot if possible) so I can track down the code and get it modified.

Thanks in advance for any constructive feedback you may have.

Instructions
  • Download zip file from link below
  • Copy contents to "%ProgramFiles%\Steam\steamapps\common\natural selection 2\ns2\lua" or make the changes manually as described in the accompanying text file

Download ZIP File

Here are some screenshots in different resolutions to give you an idea of what this looks like:
First Person View @ 1280x1024
image

Commander View @ 1280x1024
image

First Person View @ 1680x1050
image

Commander View @ 1680x1050
image

First Person View @ 1920x1080
image

Commander View @ 1920x1080
image

First Person View @ 5760x1080
image

Commander View @ 5760x1080
image
Post edited by Unknown User on
TalesinMontyp
«1

Comments

  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    See first post. The files/instructions have been updated to support Build 202 GUI changes.
  • JoopzorJoopzor Join Date: 2012-04-01 Member: 149805Members Posts: 12
    Great addon btw, is it possible to make it view the map on one screen maxed?
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    QUOTE (Joopzor @ Apr 1 2012, 01:22 PM) »
    Great addon btw, is it possible to make it view the map on one screen maxed?


    Which map are you referring to? The marine mini map, or the map that shows up when you press the "c" key?
  • JoopzorJoopzor Join Date: 2012-04-01 Member: 149805Members Posts: 12
    the map when u press the c key?
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    Just to clarify, you're asking if the map can be displayed on one of the side screens, correct? Would you want it there 100% of the time or just when you press the "c" key?
  • DarkOmenDarkOmen Join Date: 2002-11-05 Member: 7148Members Posts: 600 Fully active user
    I believe Joopzor is asking if it would be possible to dedicate one monitor entirely to a persistent minimap and not the default Marine first-person perspective. I for instance use two monitors and would love to play on one monitor as I always have and additionally have a large minimap to my side.

    Much <3 for what you made already!
  • JoopzorJoopzor Join Date: 2012-04-01 Member: 149805Members Posts: 12
    Yes Darkomen is correct in what i wanted sorry for explaining it badly lol
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    I don't think I can modify the video settings to only show gameplay on one monitor and the map on another monitor. The reason being is that you have to display the map on a screen that is part of the video resolution. So, for example, if you play on two monitors, your field of view will be centered between both monitors and you would have a crack down the middle where the monitors meet. However, if you were on 3 monitors, you still have your center monitor as your default screen and the map can be displayed on the left or right monitors 100% of the time.

    I'll see what I can create when I get home this evening. Seems like it would be pretty straight forward for the 3-monitor approach, but the dual monitor solution will take some investigation. The only downside I can think of is that you would lose some of your screen visibility when using the map constantly as it would sit over one of your peripheral vision monitors.
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    Updated the documentation to reflect that the code is compatible with build 203.
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    QUOTE (Picklefinger @ Apr 2 2012, 01:56 PM) »
    I don't think I can modify the video settings to only show gameplay on one monitor and the map on another monitor. The reason being is that you have to display the map on a screen that is part of the video resolution. So, for example, if you play on two monitors, your field of view will be centered between both monitors and you would have a crack down the middle where the monitors meet. However, if you were on 3 monitors, you still have your center monitor as your default screen and the map can be displayed on the left or right monitors 100% of the time.

    I'll see what I can create when I get home this evening. Seems like it would be pretty straight forward for the 3-monitor approach, but the dual monitor solution will take some investigation. The only downside I can think of is that you would lose some of your screen visibility when using the map constantly as it would sit over one of your peripheral vision monitors.


    I haven't been able to determine how to make this happen yet. Just wanted to let everyone know I was still looking into it.
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    Updated the files to support build 204. See original post for details.
  • MisterDMisterD Join Date: 2012-04-13 Member: 150386Members Posts: 3
    Thanks for keeping this updated Pickle!
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    Updated the files to support build 205. See original post for details.
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    Updated the files to support build 206. See original post for details.
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    Updated the files to support build 207. See original post for details.
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation Posts: 181
    Hey! Could you please provide a screenshot with your mod running? I wonder how NS2 looks on a 3 screen (or more) configuration.
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    QUOTE (Hackepeter @ May 3 2012, 03:40 AM) »
    Hey! Could you please provide a screenshot with your mod running? I wonder how NS2 looks on a 3 screen (or more) configuration.


    Hey Hackepeter,
    Sorry I haven't replied sooner, but I got a little busy. Anyhow, I just posted the screenshots in the original post above, so feel free to scroll up and take a look. :)
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    I just found a bug in my code where I cannot purchase jet packs when using more than one monitor. Apparently is has something to do with the marine buy menu code, but I can't seem to figure it out. Works great when in single monitor though...go figure.

    Any suggestions?
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members Posts: 24
    Updated the files to support build 208. See original post for details.
  • TheDestroyerTheDestroyer Tooobah Join Date: 2003-07-12 Member: 18123Members, Constellation Posts: 737 Fully active user
    Not sure if this is happening to everyone else, but for aliens, my health and weapon indicators are on the outside monitors a bit as well and chat is partially on my left for both marines or aliens. I just copied/pasted the zip and modified the MultiMonitor.lua as instructed. All versions of this have had this issue. I was just lazy and now getting around to mentioning it.
  • MakenshiMakenshi Join Date: 2012-10-30 Member: 164681Members Posts: 157
    hi,

    I was wondering if this fix still works for the retail version of the game. On my game, I haven't tried the LUA editing to see if it still fixes the fov because this mod doesn't seem to have been updated in a while
  • ☼Lap☼☼Lap☼ Join Date: 2009-02-16 Member: 66432Members Posts: 15 Fully active user
    Too bad the best implementation of dual monitors (one for map), likely requires dev intervention. It was one of the best features of Supreme Commander and I loved it.
  • MakenshiMakenshi Join Date: 2012-10-30 Member: 164681Members Posts: 157
    Well, I wanted to know if it still works at all period. My friend have since tried it and said she was getting some errors when using multi-monitor resolution so I didn't bother downloading it
  • RegnarebRegnareb Join Date: 2007-08-26 Member: 62008Members, NS2 Playtester Posts: 424 Advanced user
    Awww... I though it was a mod to get the game on one monitor, and the map on the other one... So sad :P

    But good job anyway ;)
    In NS1, no matter which class you are, you can feel really powerful and a threat to anyone, while being greatly threatened by anyone at the same time.
    In NS2, you just feel crappy against nearly everything, but at the same time, you feel as much crappy when the roles are reversed.

    This is what fun is about, feeling as an asset to the game, and feeling that you can change something.
  • SkidSkid Join Date: 2012-11-14 Member: 171080Members Posts: 1
    edited November 2012
    I've actually already made a portion of a mod that would do the same job as this, and I've been using this as a reference for where to edit to save time, but there is a massive problem with using it. Because you have to change the LUA scripts all the servers will refuse your connection because the client and servers don't match. So you would have to have servers running this mod as well, which buggers up my implementation as it stands as the configuration is hard coded in a LUA script, meaning it would be different for different resolutions which messes with client server model even more.

    What I'll probably do is try to finish as much of it as I can when I get the chance, then submit it Unknown Worlds to see if they'll make it official, the mod I'm making is a Custom HUD (maybe GUI as well) Area mod. Basically it lets you define the width and position the HUD is displayed, so it has some use on a single monitor system as well.

    To let you know, the point as which I got in my mod, Alien and Marine HUDs are fixed chat is fixed, scoreboard is fixed. Command views are still spanned, spectator is still spanned, and there are probably a number of independent HUD items I've not fixed yet.
    :) Skid :)
    "Imagination is the only weapon in the war against reality."
    "The polar opposite to Nintendo's bewilderingly name modestly powered little white cuboid is Sony's unoriginal titled monolithic black colossus the Playstation 3"
  • R4ndumR4ndum Join Date: 2012-12-08 Member: 174551Members Posts: 1
    nice skid, please keep us updated on it. I got a feeling theirs quite a few people waiting for a options like this
  • fivesevenfiveseven Join Date: 2012-11-26 Member: 173272Members Posts: 73
    Does running multiple monitors increase your in-game FOV? I thought it was fixed regardless of resolution. Wouldnt it make more sense to have the entire game on a single screen, and use your other monitors for tv shows? :)
  • SoundFXSoundFX Join Date: 2003-08-21 Member: 20048Members Posts: 234 Fully active user
    I purchased two monitors originally to give me more space in World of Warcraft. I ran into the problem of having my character split by the monitors touching sides as you noted in the early posts. I ended up just dedicating one monitor to all the extra information and used a mod that basically changed the viewport.

    I mention this because you might be able to do it as well, if the engine actually supports it, as it too is written in LUA. Here is a link to the mod I used: Sunn Viewport

    Don't know if that helps or is relevant at this time, but it's the thought that counts, right?
  • frag85frag85 Join Date: 2012-12-21 Member: 175796Members Posts: 1
    edited December 2012
    I bought this game when I found this threadand realized NS2 the HUD could be easily re-positioned for triple head, but now it appears I can not play with the HUD re-positioned. With the files edited I get this error "Server and client differ" and i cannot join any servers. The game is almost unplayable with the HUD aligned on the outside edges of the left and right monitors. I have to look far left or right and also the FOV is extremely high in this game.


    QUOTE (Skid @ Nov 14 2012, 04:59 PM) »
    I've actually already made a portion of a mod that would do the same job as this, and I've been using this as a reference for where to edit to save time, but there is a massive problem with using it. Because you have to change the LUA scripts all the servers will refuse your connection because the client and servers don't match. So you would have to have servers running this mod as well, which buggers up my implementation as it stands as the configuration is hard coded in a LUA script, meaning it would be different for different resolutions which messes with client server model even more.

    What I'll probably do is try to finish as much of it as I can when I get the chance, then submit it Unknown Worlds to see if they'll make it official, the mod I'm making is a Custom HUD (maybe GUI as well) Area mod. Basically it lets you define the width and position the HUD is displayed, so it has some use on a single monitor system as well.

    To let you know, the point as which I got in my mod, Alien and Marine HUDs are fixed chat is fixed, scoreboard is fixed. Command views are still spanned, spectator is still spanned, and there are probably a number of independent HUD items I've not fixed yet.


    Didn't see this post when I was looking through the forums the other day. You might want to post something over at WSGF about the mod. It may get more attention and help (about positioning for different resolutions). I don't like that I can't position the HUD in a usable area and would like it fixed. It would be cool if the dev's here would implement something since its already been done by the community.
    Montyp
  • CardnylCardnyl Join Date: 2013-03-03 Member: 183628Members Posts: 1
    frag85 wrote: »
    I bought this game when I found this threadand realized NS2 the HUD could be easily re-positioned for triple head, but now it appears I can not play with the HUD re-positioned. With the files edited I get this error "Server and client differ" and i cannot join any servers. The game is almost unplayable with the HUD aligned on the outside edges of the left and right monitors. I have to look far left or right and also the FOV is extremely high in this game.


    QUOTE (Skid @ Nov 14 2012, 04:59 PM) »I've actually already made a portion of a mod that would do the same job as this, and I've been using this as a reference for where to edit to save time, but there is a massive problem with using it. Because you have to change the LUA scripts all the servers will refuse your connection because the client and servers don't match. So you would have to have servers running this mod as well, which buggers up my implementation as it stands as the configuration is hard coded in a LUA script, meaning it would be different for different resolutions which messes with client server model even more.

    What I'll probably do is try to finish as much of it as I can when I get the chance, then submit it Unknown Worlds to see if they'll make it official, the mod I'm making is a Custom HUD (maybe GUI as well) Area mod. Basically it lets you define the width and position the HUD is displayed, so it has some use on a single monitor system as well.

    To let you know, the point as which I got in my mod, Alien and Marine HUDs are fixed chat is fixed, scoreboard is fixed. Command views are still spanned, spectator is still spanned, and there are probably a number of independent HUD items I've not fixed yet.

    Didn't see this post when I was looking through the forums the other day. You might want to post something over at WSGF about the mod. It may get more attention and help (about positioning for different resolutions). I don't like that I can't position the HUD in a usable area and would like it fixed. It would be cool if the dev's here would implement something since its already been done by the community.

    I wish I would have read your post before I got my hopes up and installed this mod. Started getting the refuse connection issue and figured it had to be the mod. Going to restore everything back to stock but its really a shame this can't be used without it running on the server.
«1
Sign In or Register to comment.