[Tweaks] Script lua

vlncvlnc Join Date: 2010-09-07 Member: 73921Members, Squad Five Blue
edited April 2011 in Modding
<div class="IPBDescription">Some tweaks on HUD</div>Hi everyone,

Since yesterday, I'm trying to modify some variables from the lua code files.

/!\ I'm not modifying variables like damage, speed ... I just want to adjust the HUD (color, size...) like I want /!\

<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--><!--sizeo:150--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->It's still an experimental thing, so you should back-up all files you will modify.
If you still have crashes, you can launch the <Verify integrity cache tool> in Steam to download original files of ns2.<!--sizec--></span><!--/sizec--><!--colorc--></span><!--/colorc-->

<!--sizeo:150--><span style="font-size:12pt;line-height:100%"><!--/sizeo--><!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Work In Progress ...<!--colorc--></span><!--/colorc--><!--sizec--></span><!--/sizec-->


<!--sizeo:150--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->1/ Where are the LUA Code files ?<!--sizec--></span><!--/sizec-->


By default : "C:\Program Files (x86)\Steam\steamapps\common\natural selection 2\ns2\lua"


<!--sizeo:150--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->2/ Change Crosshair Size and Color (file="GUICrosshair.lua") Frontiermen And Alien<!--sizec--></span><!--/sizec-->


<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->//GUICrosshair.kCrosshairSize = 64 (default)
GUICrosshair.kCrosshairSize = 30

//GUICrosshair.kTextureWidth =  64 (default)
GUICrosshair.kTextureWidth = 30

//GUICrosshair.kVisibleColor = Color(1, 1, 1, 1) (default)
GUICrosshair.kVisibleColor = Color(1, 1, 0, 1)<!--c2--></div><!--ec2-->

Differents combinations for colors (maybe others) :

Black -> GUICrosshair.kVisibleColor = Color(1, 0, 0, 1)
Dark Blue -> GUICrosshair.kVisibleColor = Color(1, 0, 1, 1)
Light Blue (default) -> GUICrosshair.kVisibleColor = Color(1, 1, 1, 1)
Light Green -> GUICrosshair.kVisibleColor = Color(1, 1, 0, 1)
No Crosshair -> GUICrosshair.kVisibleColor = Color(0, 1, 1, 0)

You can adjust the contrast of the Crosshair with the Second parameter (1, <!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->-> 0 <-<!--colorc--></span><!--/colorc-->, 1, 1). Values are 0.x to 1.

Result :

<b>Before Marine</b>

<img src="http://pix.wefrag.com/i/d/7/3/a/5/3030156c4265ab19e67ecddd1d563c21.png" border="0" class="linked-image" />

<b>After Marine</b>

<img src="http://pix.wefrag.com/i/9/3/a/3/b/30303bf1204f17572d4bacde6fe0f3ec.png" border="0" class="linked-image" />

<b>After Alien (Smaller size but color still the same like before) </b>

<img src="http://pix.wefrag.com/i/3/b/c/e/9/30304954a70363d18abe32228e7cf4ec.png" border="0" class="linked-image" />


<!--sizeo:150--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->3/ Change Chat name (for fun) (file="Chat.lua") Frontiermen And Alien<!--sizec--></span><!--/sizec-->


line 46 to 50 :

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if teamOnlyChat then
        return "Crew : "
    end
    
    return "Public : "<!--c2--></div><!--ec2-->

line 116 :

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->locationNameText = string.format("(Crew, %s) ", Shared.GetString(locationId))<!--c2--></div><!--ec2-->

line 120 :

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->local preMessageString = string.format("%s%s: ", ConditionalValue(tonumber(teamOnly) == 1, locationNameText, "(Public) "), DecodeStringFromNetwork(playerName), locationNameText)<!--c2--></div><!--ec2-->

line 140 to 144 :

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if not Client.GetIsRunningServer() then
            local prefixText = "Public"
            if tonumber(teamOnly) == 1 then
                prefixText = "Crew" .. tostring(teamNumber)
            end<!--c2--></div><!--ec2-->

Result :

[Public]

<img src="http://pix.wefrag.com/i/c/f/c/8/a/30305a1f5b0c19292dea4d56da9bd5d4.png" border="0" class="linked-image" />

[Crew]

<img src="http://pix.wefrag.com/i/1/d/2/7/a/30306aa40a64e622232ff867cac1af9f.png" border="0" class="linked-image" />


<!--sizeo:150--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->4/ Change FOV (file="Marine.lua, Player.lua, Skulk.lua, Gorge.lua, Lerk.lua") <!--sizec--></span><!--/sizec-->


<!--sizeo:135--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Marine.lua<!--sizec--></span><!--/sizec-->

//Marine.kMaxSprintFov= 95 (default)
Marine.kMaxSprintFov = 130

<!--sizeo:135--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Player.lua<!--sizec--></span><!--/sizec-->

//Player.kFov = 90 (default)
Player.kFov = 110

<!--sizeo:135--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Skulk.lua<!--sizec--></span><!--/sizec-->

//Skulk.kFov = 110 (default)
Skulk.kFov = 110

<!--sizeo:135--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Gorge.lua<!--sizec--></span><!--/sizec-->

//Gorge.kFov = 95 (default)
Gorge.kFov = 130

<!--sizeo:135--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Lerk.lua<!--sizec--></span><!--/sizec-->

//Lerk.kFov = 100 (default)
Lerk.kFov = 130

<!--sizeo:135--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Onos.lua<!--sizec--></span><!--/sizec-->

//Onos.kFov = 95
Onos.kFov = 130


(my original post <a href="http://www.ns2uk.com/forums/viewtopic.php?f=24&t=14" target="_blank">here</a>)

If you find errors, new stuff/modification or any suggestions, don't hesitate

Comments

  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    I'm assuming this script is ment for players (clients), in which case you should take into account that the server imposes many of it's variable-values onto the client. Among others, the Field-of-View. This means clients cannot change these values on their own accord, it'll have to be done server-side. Also, a FoV of 130 for the marines is very high indeed. Any value higher than 110 will lead to significant bending around the edges (fishbowl-effect), depending on the monitor's aspect-ratio of course.
  • vlncvlnc Join Date: 2010-09-07 Member: 73921Members, Squad Five Blue
    edited April 2011
    <!--quoteo(post=1840960:date=Apr 14 2011, 12:01 PM:name=player)--><div class='quotetop'>QUOTE (player @ Apr 14 2011, 12:01 PM) <a href="index.php?act=findpost&pid=1840960"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->This means clients cannot change these values on their own accord, it'll have to be done server-side.<!--QuoteEnd--></div><!--QuoteEEnd-->
    I'll look if server-side files use these values but i got no problem yesterday with this changes on any servers.

    <!--quoteo(post=1840960:date=Apr 14 2011, 12:01 PM:name=player)--><div class='quotetop'>QUOTE (player @ Apr 14 2011, 12:01 PM) <a href="index.php?act=findpost&pid=1840960"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Also, a FoV of 130 for the marines is very high indeed. Any value higher than 110 will lead to significant bending around the edges (fishbowl-effect), depending on the monitor's aspect-ratio of course.<!--QuoteEnd--></div><!--QuoteEEnd-->
    I'm still testing different values but FoV of 130 does not disturb me at all.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    <!--quoteo(post=1840963:date=Apr 14 2011, 12:15 PM:name=vlnc)--><div class='quotetop'>QUOTE (vlnc @ Apr 14 2011, 12:15 PM) <a href="index.php?act=findpost&pid=1840963"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'll look if server-side files use these values but i got no problem yesterday with this changes on any servers.

    I'm still testing different values but FoV of 130 does not disturb me at all.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Try setting Player.kFov to 170 (this has effect on readyroom'ers and marines), you'll surely notice whether or not it's working. Then join a random server (not your own obviously) and you will find the FoV will be incredibly high, but only for 1 tick (a 30th of a second, which amounts to just barely enough to catch a glimpse of it) before the server imposes it's own FoV-value (90) onto the client, and the view is back to vanilla.

    A FoV of 130 is o.k for skulks, lerks and perhaps other aliens, but for marines it really is too high (for 16:9, 16:10 setups anyway, perhaps you're using multiple monitors). OR you were actually just playing on 90 all the time, like I described above.
  • SN.WolfSN.Wolf Join Date: 2010-03-29 Member: 71115Members
    If later down the road an anti cheat system is imposed, will it not compare server/client files on any of this. I was just wondering as back in the day of the bf42 server side modding file mismatch between server and client was a huge problem. This was also the case for the early rainbow six series games.
  • vlncvlnc Join Date: 2010-09-07 Member: 73921Members, Squad Five Blue
    I hope UWE will add a autoexec.cfg file.

    It will be easier to change variables for graphics, HUD tweaks.
  • PhYzorPhYzor Join Date: 2003-10-26 Member: 22005Members, Constellation, Reinforced - Shadow
  • vlncvlnc Join Date: 2010-09-07 Member: 73921Members, Squad Five Blue
    FOV modification doesn't work anymore like said Player, it's client value who are overwrited by server values.

    Crosshair modification sill working
Sign In or Register to comment.