Hiding Crosshair

EchaEcha Join Date: 2009-06-12 Member: 67809Members
I've got a 3D setup (and NS2 looks fantastic in 3D, except for some lighting issues) and I want to disable the games crosshair. I'll replace it with nVidia's crosshair that comes with the drivers. It scales with the depth of what I'm looking at where the games standard crosshair is always flat on the screen.

I know a bit of C++ but have no experience with lua. The main problem is I have no idea what classes or functions the games modding API has so I don't know what to do to eliminate the crosshair.

Comments

  • KoruyoKoruyo AUT Join Date: 2009-06-06 Member: 67724Members, Reinforced - Shadow
    edited August 2012
    So the nvidia 3d stuff has a crosshair overlay? and you just want to get rid of the ingame crosshair to use that instead?


    <a href="http://www.file-upload.net/download-4648298/crosshairs.zip.html" target="_blank">crosshairs.zip</a>

    Go to
    "C:\Program Files (x86)\Steam\SteamApps\common\Natural Selection 2\ns2\ui"

    Replace:

    crosshair.dds
    crosshair-hit.dds

    With the ones in my zip.

    (dont forget to backup, tho you could also get the original files back by checking integrity of natural selection 2 in steam)


    What did i do? I basically made empty files so the crosshairs will be invisible ingame. (seemed like the easiest and fastest way to do it)
    How did i do it? You can edit .dds files with paint.net(you could also do it with photoshop + nvidia dds plugin) - i just opened the files ctrl+a and deleted everything - then saved the empty files.


    Hope it works.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    edited August 2012
    Crosshairs can be very simply removed in the code...

    Will be back in a few minutes with the files to show you how to do it. (I've done it in GorgeCraft mod and previously in an Older version of Proving Grounds).

    --------------------------------------------------------------------------------------------------------

    EDIT:

    Player_Client.lua:line 565 (well in my modded file anyway...). This is the whole original function as used in NS2.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function PlayerUI_GetCrosshairY()

        local player = Client.GetLocalPlayer()

        if(player and not player:GetIsThirdPerson()) then  
          
            local weapon = player:GetActiveWeapon()
            if(weapon ~= nil) then
            
                // Get class name and use to return index
                local index
                local mapname = weapon:GetMapName()
                
                if mapname == Rifle.kMapName or mapname == GrenadeLauncher.kMapName then
                    index = 0
                elseif mapname == Pistol.kMapName then
                    index = 1
                elseif mapname == Shotgun.kMapName then
                    index = 3
                elseif mapname == Minigun.kMapName then
                    index = 4
                elseif mapname == Flamethrower.kMapName then
                    index = 5
                // All alien crosshairs are the same for now
                elseif mapname == Spikes.kMapName or mapname == Parasite.kMapName or mapname == LerkUmbra.kMapName then
                    index = 6
                elseif(mapname == SpitSpray.kMapName) then
                    index = 7
                // Blanks (with default damage indicator)
                else
                    index = 8
                end
            
                return index * 64
                
            end
            
        end

    end<!--c2--></div><!--ec2-->

    Easiest way to remove ALL crosshairs is to edit the function to look like this:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function PlayerUI_GetCrosshairY()

        local player = Client.GetLocalPlayer()

        if(player and not player:GetIsThirdPerson()) then  
          
            local weapon = player:GetActiveWeapon()
            if(weapon ~= nil) then
            
                // Get class name and use to return index
                local index
                index = 8
                return index * 64
                
            end
            
        end

    end<!--c2--></div><!--ec2-->

    Index 8 is no crosshair.

    If you don't want to delete all that code you can just comment it out like this:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function PlayerUI_GetCrosshairY()

        local player = Client.GetLocalPlayer()

        if(player and not player:GetIsThirdPerson()) then  
          
            local weapon = player:GetActiveWeapon()
            if(weapon ~= nil) then
            
                // Get class name and use to return index
                local index
                local mapname = weapon:GetMapName()
                
                /*if mapname == Rifle.kMapName or mapname == GrenadeLauncher.kMapName then
                    index = 0
                elseif mapname == Pistol.kMapName then
                    index = 1
                elseif mapname == Shotgun.kMapName then
                    index = 3
                elseif mapname == Minigun.kMapName then
                    index = 4
                elseif mapname == Flamethrower.kMapName then
                    index = 5
                // All alien crosshairs are the same for now
                elseif mapname == Spikes.kMapName or mapname == Parasite.kMapName or mapname == LerkUmbra.kMapName then
                    index = 6
                elseif(mapname == SpitSpray.kMapName) then
                    index = 7
                // Blanks (with default damage indicator)
                else*/
                index = 8
                //end
            
                return index * 64
                
            end
            
        end

    end<!--c2--></div><!--ec2-->

    Of course you can copy and paste either of those code blocks over the function in your file and it will work. Also note, as this is a client mod, you can use it on vanilla servers.
Sign In or Register to comment.