B267 & Modding

McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
Greetings Modders,

I want to give you all a heads up regarding what will impact your mods once Build 267 is released. This post won't detail anything pertaining to specific files. Instead I'll go over what will impact all mods.

The Return of Version Locking
Yup, that's right. You will be able to lock your mod to a specific Build Version one 267 hits the streets. There are some important factors to take into consideration however. First off, your mod's required build version will be published along with the normal details to the Steam Workshop. This means players won't have to worry about anything. The engine will automatically load the archived Build###.zip file containing all the past version's Lua code. You can set this for your mod in the LaunchPad via a simple text field. No "B" or "build" is required, just the Number ( Ex: 265, 250 ) of the previous build you wish to lock you mod to.

It's important to understand the complications that come along with Build-Locking. Any Server or Client that mounts a mod which is using locking will force that specific Build number to become the baseline for all other mods. Multiple Build Verisons are not allowed. If conflicting build numbers are encountered, the most recently loaded mod will not mount. For the most part, this feature will only be useful for gameplay mods. However, it can be useful to other types of mods as well.

Broadly speaking, you should alway try to ensure your mod works with the most recent updates to NS2. However, if you (for example) decide to stop updating you mod; locking it to a version that still works will give players the option to continue playing it.


Additional Precaching
There is a new method for precaching files that did not exist in previous build. This is important and you should considering utilizing it for your mods, because it will help reduce hitching when you mod is played. As you can learn in this post by Matso, a large factor of why hitching was occuring is due to files being loaded during gameplay. In order to allieviate some of this hitching a new prechaching method needed to be created for B267 in the context of GUIs.

Welcome to GUIAssets.lua. This file is used to specifiy all of the assets the game should precache, but they are specific to files (texture mainly but also shaders and fonts) relevent to GUIScripts. It is important for mods that do a lot of customization for the GUIScripts that they take advantage of this new precaching file. The file itself covers what its actions are and you can see the various files it precaches there. It is loaded only in the Client VM, so you would just need load your own version of GUIAssets from your mod's Client.lua file.
Reference: See GUIAssets.lua, GUIRifle.lua, GUIExo.lua for examples on how this is used.


Greatly Increased Translation Options
A big thanks should go out to @Ghoul for making a whole lote more of the game translatable. The Main Menu, Loading screens, and a lot more now supports multiple languages. There is a whole lot more work to come on this front as well. We will soon have support for just over of 30 different languages! By default the game uses US-English, so I recommend you start from there. Take a look at the 'gamestrings' folder to see the available languages and search through the Lua source code to determine how the localization strings are used.


That's it for now but there is more to come on the modding front. And the CDT is taking mods into account for our long term plans. Stay tuned!

Happy Modding! :)



Sign In or Register to comment.