spaghettification-chatcommands icon

chatcommands

mod for easy chat command makings

Last updated 5 days ago
Total downloads 8
Total rating 0 
Categories
Dependency string spaghettification-chatcommands-0.0.1
Dependants 0 other packages depend on this package

This mod requires the following mods to function

spaghettification-utils-0.0.1 icon
spaghettification-utils

utilities for my mods

Preferred version: 0.0.1

README

chat commands


mod that makes creation of chat commands easier

how to add more commands


the default file is mod/commands.gnut, if you want to add your own make sure you add it to the mod.json (basically just copy the existing mod/commands.gnut script entry but change the path)

first create your command function in mod/scripts/vscripts/mod/commmands.gnut (or your custom file), call it something that isnt already taken

if using your own file, make sure to add globalize_all_functions or manually global <function>

make sure your function takes the args of array<string> args, even if it doesn't need them edit chat.gnut and add your command to the commands table in chat_Init format is as follows

commands = {
	<chat command> = {
		func = <your function name>,
		args = <arg count>
	}
}

there are some premade commands in mod/commands.gnut (thats why it requires my utils thingy)