Skip to content

Repository files navigation

TypeScript Sample Template Program for Battlefield 6 Rule Editor

※ このリポジトリの日本語での説明はこちらです。

This repository is designed to make it easier to write Battlefield (BF) Rule Editor scripts in TypeScript.

It provides the following features:

  • When you push to GitHub, ESLint automatically checks your code syntax.
  • Running bun run build combines multiple .ts files into a single .ts file.
    • The BF Portal Rule Editor only accepts a single TypeScript file.
  • bfportal-vitest-mock and vitest are already installed, so you can easily use unit tests.

Questions / Support

If you have questions or feedback, feel free to contact me on the PlumRice Discord server 😄

Please use the appropriate thread/channel for discussions related to this project.

https://discord.gg/Zy65k8AxH2

Installation

  1. Install Bun. On Windows, open PowerShell and run the official installer:
powershell -c "irm bun.sh/install.ps1|iex"

After installation, restart your terminal and check that Bun is available:

bun --version

https://bun.com/docs/installation

  1. Download this repository.
  2. Place the PortalSDK/code folder from the official Battlefield 6 SDK into the code directory of this project.
  3. Run the command bun install.

Usage

  1. Write your program in the mods folder.
  2. After you finish coding, run the command bun run build.
  3. Upload dist/Script.ts and dist/String.json to the BF Portal Rule Editor.

Setting Up Strings

Add the strings you want to include in dist/String.json.

How to run the tests

This project uses the bfportal-vitest-mock package. For how to install and use it, please refer to the section below.

https://github.com/link1345/bfportal-vitest-mock

Run tests with:

bun test

About

TypeScript Sample Template Program for Battlefield 6 Rule Editor.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages