🇨🇳
R2Northstar Wiki
Chinese
Chinese
  • 欢迎来到Northstar
  • 加入我们
  • 安装Northstar
    • 基础教程
    • 故障处理
  • Northstar用户手册
    • Mods(模组)
    • 服务器列表
    • 直连服务器
    • 游戏模式
    • 控制台指令
    • 启动参数
    • 在Linux上游玩
  • 常见问题解答
  • 使用 Northstar托管服务器
    • 前期准备
    • 托管私人比赛服务器
    • 托管独立的服务器端
      • 实践经验
      • 在Linux上托管服务器
    • 故障处理
    • 视频教程
  • 修改与开发教程
    • 开始修改
      • 基础修改
      • 教程
      • 参考列表
      • Squirrel(松鼠)脚本
        • 线程处理
        • 基础代码块
        • Respawn(重生)创建的函数
        • 表和数组
        • 回调函数
        • 游戏模式修改
          • 开始修改
        • 自定义设置
          • 关于mod.json文件
          • 关于本地化语言文件
          • 关于Mod(模组)文件
      • 设置语法高光
      • 本地化翻译
      • 收尾工作
    • 开发者
  • 其他
    • 特别感谢
由 GitBook 提供支持
在本页
  • Basics
  • Tools
  • Quick start
  1. 修改与开发教程
  2. 开始修改

基础修改

上一页开始修改下一页教程

最后更新于3年前

Basics

This guide assumes you have basic understanding with programming and know how to use developer environments. Listed below are tools useful for exporting file formats

If you'd like a more lengthy set of tutorials covering many topics. Look at:

TODO: Actually link tools

Tools

  • RSPNVPK

  • Cra0 VPK Tool (Titanfall VPK Tool)

  • Legion by DZXTPorter

Quick start

In order to get started with making your mod, create a folder in R2Northstar/mods. While it isn't required, it is best practise by mod authors to follow the naming scheme "Author.ModName", such as "Northstar.Client".

After making this folder, inside it add a folder named mod and a file named mod.json.

Provided is a template mod.json, for a detailed list of values read

{
    "Name": "My.Mod",
    "Description": "Woo yeah wooo!",

    "LoadPriority": 0,
    "ConVars": [],
    "Scripts": [],
    "Localisation": []
}

Inside the mod folder, existing files found in the engine's virtual file system will be overwritten and new files can be added. If you need to define new Squirrel files (.nut/.gnut) they must be declared in the "Scripts" array in mod.json. An example for this might be:

    "Scripts": [
        {
            "Path": "path/to/my.nut",
            "RunOn": "( CLIENT || SERVER ) && MP"
        },
        {
            "Path": "path/to/my_second.nut",
            "RunOn": "( CLIENT || SERVER ) && MP",
            "ClientCallback": {
                "Before": "ClientPreMapspawnThing",
                "After": "AfterMapspawnClientThing"
            },
            "ServerCallback": {
                "Before": "ServerPreMapspawncrap",
                "After": "ServerAfterMapspawnWoo"
            }
        }
    ]

TODO: Create and link Squirrel VM documentation

"Path" indicates where the script is, "RunOn" is the Squirrel VM context (see ) as an expression, and "ClientCallback" and "ServerCallback" specify a function call that can be "Before" and/or "After" map-spawn.

https://github.com/R2Northstar/NorthstarWiki/blob/main/docs/modding/modding/tutorials/modding-tutorials.md
Cheatsheet
Squirrel VM