NS2 Multi-Monitor HUD LUA Changes

SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members
edited May 2012 in Modding
<div class="IPBDescription">The necessary LUA changes to support the HUD on multiple monitors</div><b>Updated on 5/19/2012: Now supports changes to HUD in Build 208</b>

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.

<u><b>Features</b></u>
<ul><li>Moves Marine and Alien GUI elements to central monitor</li><li>Moves Marine and Alien Commander GUI elements to central monitor</li><li>Automatically detects between single and multiple monitors</li></ul>
<u><b>Limitations</b></u>
<ul><li>Does not support in-game resolution changes</li><li>Auto detection of single monitor assumes no single monitor horizontal resolutions above 2600 pixels</li><li>Team Chat vs. All Chat inputs display in different x-axis values depending on whether you are Alien or Marine</li><li>Close button in Marine buy menu does not properly move to center monitor</li><li>Jet Pack Buy Menu does not work properly when using more than one monitor. Results in not being able to purchase jet packs</li></ul>
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.

<u><b>Instructions</b></u>
<ul><li>Download zip file from link below</li><li>Copy contents to "%ProgramFiles%\Steam\steamapps\common\natural selection 2\ns2\lua" or make the changes manually as described in the accompanying text file</li></ul>
<a href="https://docs.google.com/open?id=0Bx9QYXdNEy1rcVJvdXRjNWx5RDQ" target="_blank">Download ZIP File</a>

Here are some screenshots in different resolutions to give you an idea of what this looks like:
<u><b>First Person View @ 1280x1024</b></u>
<img src="https://lh6.googleusercontent.com/--TtZor4ABcw/T69Npd9hZrI/AAAAAAAADzw/JIW7h8V1uQ8/s931/NS2%20FP%20@%201280x1024.jpg" border="0" class="linked-image" />

<u><b>Commander View @ 1280x1024</b></u>
<img src="https://lh6.googleusercontent.com/-6b0GnbfSX90/T69NqGH-cCI/AAAAAAAADz4/VGNJ3-_hgkE/s931/NS2%20Commander%20@%201280x1024.jpg" border="0" class="linked-image" />

<u><b>First Person View @ 1680x1050</b></u>
<img src="https://lh3.googleusercontent.com/-OzkTFK0msic/T69NoCWnJtI/AAAAAAAADzg/JsqT8X7aGIM/s1141/NS2%20FP%20@%201680x1050.jpg" border="0" class="linked-image" />

<u><b>Commander View @ 1680x1050</b></u>
<img src="https://lh3.googleusercontent.com/-NSfN7o7XyOQ/T69No3WWTwI/AAAAAAAADzo/D0gwTW6hz4o/s1141/NS2%20Commander%20@%201680x1050.jpg" border="0" class="linked-image" />

<u><b>First Person View @ 1920x1080</b></u>
<img src="https://lh3.googleusercontent.com/-GoptEfuHvVw/T69NmNU7iaI/AAAAAAAADzQ/3Kw1oZCK3wY/s1141/NS2%20FP%20@%201920x1080.jpg" border="0" class="linked-image" />

<u><b>Commander View @ 1920x1080</b></u>
<img src="https://lh3.googleusercontent.com/-EeCi0y-GIrc/T69Nm0Pcq5I/AAAAAAAADzY/Dauu9cgP9rs/s1141/NS2%20Commander%20@%201920x1080.jpg" border="0" class="linked-image" />

<u><b>First Person View @ 5760x1080</b></u>
<img src="https://lh4.googleusercontent.com/-FH5AVYjuE4g/T69NjWcdkmI/AAAAAAAADzA/1eSA0JORTCE/s1141/NS2%20FP%20@%205760x1080.jpg" border="0" class="linked-image" />

<u><b>Commander View @ 5760x1080</b></u>
<img src="https://lh5.googleusercontent.com/-2EfbO6p-IS4/T69Nk94U3xI/AAAAAAAAD0E/0YYNgSuXpEg/s1141/NS2%20Commander%20@%205760x1080.jpg" border="0" class="linked-image" />
«1

Comments

  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members
    See first post. The files/instructions have been updated to support Build 202 GUI changes.
  • JoopzorJoopzor Join Date: 2012-04-01 Member: 149805Members
    Great addon btw, is it possible to make it view the map on one screen maxed?
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members
    <!--quoteo(post=1920676:date=Apr 1 2012, 01:22 PM:name=Joopzor)--><div class='quotetop'>QUOTE (Joopzor @ Apr 1 2012, 01:22 PM) <a href="index.php?act=findpost&pid=1920676"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Great addon btw, is it possible to make it view the map on one screen maxed?<!--QuoteEnd--></div><!--QuoteEEnd-->

    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
    the map when u press the c key?
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members
    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
    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
    Yes Darkomen is correct in what i wanted sorry for explaining it badly lol
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members
    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
    Updated the documentation to reflect that the code is compatible with build 203.
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members
    <!--quoteo(post=1921050:date=Apr 2 2012, 01:56 PM:name=Picklefinger)--><div class='quotetop'>QUOTE (Picklefinger @ Apr 2 2012, 01:56 PM) <a href="index.php?act=findpost&pid=1921050"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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.<!--QuoteEnd--></div><!--QuoteEEnd-->

    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
    Updated the files to support build 204. See original post for details.
  • MisterDMisterD Join Date: 2012-04-13 Member: 150386Members
    Thanks for keeping this updated Pickle!
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members
    Updated the files to support build 205. See original post for details.
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members
    Updated the files to support build 206. See original post for details.
  • SKINZSKINZ Join Date: 2008-11-11 Member: 65422Members
    Updated the files to support build 207. See original post for details.
  • HackepeterHackepeter Join Date: 2003-06-08 Member: 17107Members, Constellation
    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
    <!--quoteo(post=1933003:date=May 3 2012, 03:40 AM:name=Hackepeter)--><div class='quotetop'>QUOTE (Hackepeter @ May 3 2012, 03:40 AM) <a href="index.php?act=findpost&pid=1933003"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Hey! Could you please provide a screenshot with your mod running? I wonder how NS2 looks on a 3 screen (or more) configuration.<!--QuoteEnd--></div><!--QuoteEEnd-->

    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
    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
    Updated the files to support build 208. See original post for details.
  • TheDestroyerTheDestroyer Tooobah Join Date: 2003-07-12 Member: 18123Members, Constellation
    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
    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
    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
    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
    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 ;)
  • SkidSkid Join Date: 2012-11-14 Member: 171080Members
    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.
  • R4ndumR4ndum Join Date: 2012-12-08 Member: 174551Members
    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
    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
    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: <a href="http://www.curse.com/addons/wow/sunn-viewport-art" target="_blank">Sunn Viewport</a>

    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
    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.


    <!--quoteo(post=2023658:date=Nov 14 2012, 04:59 PM:name=Skid)--><div class='quotetop'>QUOTE (Skid @ Nov 14 2012, 04:59 PM) <a href="index.php?act=findpost&pid=2023658"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Didn't see this post when I was looking through the forums the other day. You might want to post something over at <a href="http://www.wsgf.org/forums" target="_blank">WSGF</a> 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.
  • CardnylCardnyl Join Date: 2013-03-03 Member: 183628Members
    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.
Sign In or Register to comment.