Client sided coding help

TurbineTurbine Join Date: 2012-09-13 Member: 159160Members
I'm coming from developing gmod content, where client sided scripts are sent over to the server upon connection.

Unfortunately there is very little information about certain NS2 areas.

The problem I'm having is editing client sided files, these do not appear to be ran on the client. Whereas server sided coding is working perfectly fine.

Could somebody outline how client sided scripts are handled in NS2 and whether there's a way to modify these.

Comments

  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited September 2013
    First what exactly do you want to do? Secondly did you take a look into NS2Docs?
    Spark knows 3 types of lua scrips shared (loaded by client and server), _client (loaded by client), _server (loaded by server). In fact those files are loaded by the different main classes Client.lua, Server.lua and Shared.lua . But without more details i can't help you more.
  • TurbineTurbine Join Date: 2012-09-13 Member: 159160Members
    Currently tweaking existing code, to learn how things are done in NS2. For modding.

    I currently have Ns2Docs open right now.

    For instance, I'm trying to move the jetpack fuel bar position, currently it's off by 2 pixels vertically and not very attractively placed.

    Editing "GUIJetpackFuel.lua" GUIJetpackFuel.kBarCoords values will not take effect in the client, whereas editing server files will.
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited September 2013
    Turbine wrote: »
    Currently tweaking existing code, to learn how things are done in NS2. For modding.

    I currently have Ns2Docs open right now.

    For instance, I'm trying to move the jetpack fuel bar position, currently it's off by 2 pixels vertically and not very attractively placed.

    Editing "GUIJetpackFuel.lua" GUIJetpackFuel.kBarCoords values will not take effect in the client, whereas editing server files will.

    Are you sure that your modded files are not blocked by ConsistencyCheck ?
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    And as you come from gmod maybe take a look at shine core: https://github.com/Person8880/Shine/wiki
  • TurbineTurbine Join Date: 2012-09-13 Member: 159160Members
    Turbine wrote: »
    Currently tweaking existing code, Are you sure that your modded files are not blocked by ConsistencyCheck ?

    Would this stop such code when the changes are made at the servers end?

    I briefly saw shine, but I wasn't certain whether it was what I needed.
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited September 2013
    ConsistencyCheck = define which client files are allowed to differ from server files. If your modded files are blocked by ConsistencyCheck they won't be loaded at clientside if they do not match with server files.
  • TurbineTurbine Join Date: 2012-09-13 Member: 159160Members
    edited September 2013
    So I should add the modified files to "ConsistencyConfig.json" ignore area. Thus allowing the client to use the client files provided by the server, and hopefully not deny the player to connect at all, if they do not match.

    [Edit]
    Just tried it out, so is this statement correct: Client files changed at the servers end cannot be delivered to the client for use unless it's made as a client workshop addon.
  • Person8880Person8880 Join Date: 2013-01-02 Member: 177167Members, Squad Five Blue
    Turbine wrote: »
    [Edit]
    Just tried it out, so is this statement correct: Client files changed at the servers end cannot be delivered to the client for use unless it's made as a client workshop addon.
    Yes that's correct. Unlike GMod where most client files are sent on connect, in NS2 the client has to have matching files already on their computer. Usually it's through workshop mods.
  • TurbineTurbine Join Date: 2012-09-13 Member: 159160Members
    edited September 2013
    
    
    
    Person8880 wrote: »
    Turbine wrote: »
    [Edit]Yes that's correct. Unlike GMod where most client files are sent on connect, in NS2 the client has to have matching files already on their computer. Usually it's through workshop mods.

    I see, not quite as flexible, but I can see why they would have chosen this method. (Easier to update/force new game code)

    I managed to disable things like infestation through creating a mod, not ideal the level which it is exposed, but sure does boost some peoples fps.
Sign In or Register to comment.