From ef4fe2a49e9e16d9a7785a1b6be4b61b9624f4e2 Mon Sep 17 00:00:00 2001 From: Nicholas Hope Date: Thu, 16 Jun 2022 20:04:31 -0400 Subject: [PATCH] Added content and an example --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa93551..5710597 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,45 @@ -Hello! Welcome to the README for tfscript!!! +# Hello and welcome to tfscript! -# Known issues, problems, etc. \ No newline at end of file +## Basic overview + +tfscript is meant to simplify the complexity of creating tf2 keybinds. While simple binds may be easy, more complex actions such as key combinations and toggles can be quite complex. + +For example, this config will bind "e" to call for medic, unless mouse4 is held, in which case it will call for an ÜberCharge: + +``` +alias call_for_medic "voicemenu 0 0" +alias call_for_uber "voicemenu 1 6" +alias e_bind call_for_medic +bind e e_bind +alias +toggle_state "alias e_bind call_for_uber" +alias -toggle_state "alias e_bind call_for_medic" +bind mouse4 "+toggle_state" +``` + +There are some issues with this: +- It is quite verbose, and if several of these exist the file can become difficult to traverse +- There is a lack of clarity in the voicemenu command, only the bind name explains what it does +- If either "mouse4" or "e" had a prior function, it has now been overwritten +- The scope is dictated by what `.cfg` file this is located within, which can cause problems + +  + +The tfscript way of doing this is +``` +default: + e: + double: + primary: + impulse: voice "medic" + secondary: + impulse: voice "activate uber" + condition: mouse4 +``` + +There are several benefits to this: +- The indentation allows for easier scanning of the file +- The voicemenu commands have been replaced with the clearer "voice" impulse +- Since this is within the `default` section, it is clear that there are is no "prior function" to overwrite and this will apply to all classes unless specifically overwritten. + +## Known issues, problems, etc. +none everything is perfect and there are no problems it is all amazing \ No newline at end of file