LocalClientCommand

v1.0.0·Updated 2022-04-09

Allow you to add local client with callback. These commands only run in local.

About this mod Author’s original text

What this mod brings

I tried to use AddClientCommandCallback, but met a CLIENT SCRIPT COMPILE ERROR.

// CLIENT SCRIPT COMPILE ERROR Undefined variable "AddClientCommandCallback"

So I made this to allow you to custom commands in local easier.

You can type some commands like /ping in the chat. These commands you sent will not show to other players, so feel free to use them.

Type /helpor? to get the commands list. Use up-arrow/down-arrow to scroll.

New callbacks

void function AddLocalClientCommand(string command, void functionref(entity, array) func)

You can add command with this function.

entity is the local player.

array is an array of args. args[0] is the command string.

void function PingCommand(entity player, array args)

{

int ping = MyPing()

Logger.Info("ping: " + ping)

}

// args[0] is the command string. Here is ping.

AddLocalClientCommand("ping", PingCommand)

global struct Logger

It offer 5 functions you can use to log in the chat window(only shown to you). I don’t know how to colorize the text, so they are not color-modified.

  • Logger.Trace(string str)

Trace is not completed. Do not use.

  • Logger.Debug(string str)
  • Logger.Info(string str)

Default log level.

  • Logger.Warn(string str)
  • Logger.Error(string str)

Once if the log function you use is lower than the log level, the log message will not show.

Configure this int Logger.logLevel. You can find the levels with Logger.LogType["INFO"].

If you want to change the log level, just like this:

Logger.logLevel = Logger.LogType["DEBUG"]

Logger.Debug(command)

Some default commands

  • ping

Show ping.

  • list_all_player

List all players.

  • list_all_command
  • help

-?

List all commands.

  • convar ConVarname

Show the value of the ConVarname.

Mod.json

Convars

"ConVars": [

// use to identify the commands, these chats will be blocked.

{

"Name": "l1nexus_local_client_command_prefix",

"DefaultValue": "/"

}

]

Files

│ mod.json

│

└─mod

└─scripts

└─vscripts

l1nexus_local_client_command.nut

l1nexus_local_client_command_default_commands.nut

l1nexus_logger.nut

Further updates

  • Colorize the log.

Update log

v1.0.0

  • Upload.

Install & use Install: Northstar client mod

  1. Install the Northstar client first (the open-source community client for Titanfall 2; its release page provides an installer). It loads the mods.
  2. Unzip the archive from playbuff and put its contents into the Northstar/mods/ folder inside your Titanfall2 directory.
  3. Start the game through NorthstarLauncher.exe — the console lists the mods it loaded.

Northstar is for private servers and custom content; do not use it to connect to official servers.

File & checksum

Filename
LocalClientCommand-1.0.0.zip
File size
79.4 KiB