Remove or override vanilla commands

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Valansch
Inserter
Inserter
Posts: 23
Joined: Fri Jun 23, 2017 12:00 pm
Contact:

Remove or override vanilla commands

Post by Valansch »

Please let us remove or override vanilla commands.

If people exand the functionality of certain commands, choosing another name than the vanilla name isn't a desired outcome, if/because:
  • People already know of the vanilla names and will intuitively use the vanilla commands, missing the new features
  • We explicity don't want the vanilla behavior because it breaks other mod features.
  • It remove duplicates from /help
Our example usage for this request:
We have 3 commands, that we would want to replace vanilla commands.
  • /search-command <keyword> <page:optional> Search for commands matching the keyword in name or description
    Replaces help, lets you filter the commands list, hides commands that the player can't run due to access level and gives a clearn formated output.
  • /sc <str:sentence> silent-command (Admin Only)
    Replaces silent-command. It doesn't print errors for all players, only the caller and logs the error.
  • /color-redmew
    Replaces color adds more colors and persistently saves the users preferenes across all our servers
  • /redmew-ban
    Replaces ban and adds to the ban message "If you wish to appeal this ban please visit redmew.com/discord"
Using on_console_command does not solve our problems, as the vanilla command is still run, breaking our ban, spamming chat with the vanilla output and for the other states reasons.

Especially /ban is important for us.
The problem with adding an "If you wish to appeal this ban please visit redmew.com/discord" message is we either need people
  • To use a different ban command, which is in our opinion not a good idea, the less mods have to learn in order to moderate the better and if one forgets to not use /ban the player goes without appeal message.
  • Have the server unban the player and then re ban them with the message, 3 messages to game chat for every ban.
  • Not update the ban message until the server is restart, so if the player attempts to re-join before then they don't see the updated ban message
Admin and Developer for RedMew

User avatar
Cooldude2606
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Sat Sep 16, 2017 9:04 pm
Contact:

Re: Remove or override vanilla commands

Post by Cooldude2606 »

I have found many times when I have wanted to interrupt the effect of an game command such as ban or kick but there is currently no way to do so. Two possible suggestions are:
  1. Have a pre_on_command_used event with the abilty to prevent the exucution of the game command or append extra data to it, such as the player's name who triggered the event. This could be the better way as it still runs the command as expected but it can be blocked depending on certain contitions. Example: an "admin" can ban any one but a "moderator" can only ban normal users.
  2. Have commands.block(command) which blocks a command from being ran but will still trigger the on_command_used event so that other funnctions can be ran. Example: one mod blocks /ban and adds an event lisener to write a game file; other mods still expect the command to be there which is why an event would work and removing the command would not.
The abbilty to remove or override game commands would be very useful as currently we have little control over who can run what commands and what each command does. It would be more consistent if all commands were handled the same way rather than having game commands and then custom commands.
--- Developer for Explosive Gaming factorio community. Find our code on GitHub. Please contact me via our Discord. ---

Post Reply

Return to “Modding interface requests”