Serious Sam Fusion 2017 (beta)

Serious Sam Fusion 2017 (beta)

30 ratings
Keyboard Shortcuts
   
Award
Favorite
Favorited
Unfavorite
Type: Additions
File Size
Posted
Updated
59.928 KB
12 Dec, 2017 @ 6:26am
18 Apr, 2020 @ 9:51am
4 Change Notes ( view )

Subscribe to download
Keyboard Shortcuts

Description
This mod is just an utility. It doesn't add any fun stuff to the game.
Also, it works in non-moddable version of the game too!

Using this mod you can create keyboard shortcuts, activating which will execute some console commands.
For example, you can set a shortcut which will toggle cheats on/off, or which calls 'gamStart()' function, or whatever you can come up with.

How to add shortcuts:
Open console (by pressing ~), and enter the following function:
(three dots means it may have more than 3 arguments).

After you enter this function with all arguments, you will be prompted to press and hold keys you want in your shortcut.
Do it, and shortcut will be created!

What are these arguments?

keyCount is a positive integer, which defines how many keys there will be in a shortcut.

type specifies the type of action performed when using the shortcut. It can be one of the following:
  • "file" - this means that lua code, contained in the file name, will be executed. Beware, that file name should be in quotes and you should use \\ (two backslashes) for separating folders in the path.
  • "func" - this means that function with the name name will be called, with arguments that you put into the globals.AddShortcut function after the first three.
  • "var" - this means that the value of the variable with the name name will be changed somehow. In this case, fourth parameter of the globals.AddShortcut function should be either "cycle", "add" or "subtract". if it is "cycle", all parameters following fourth should be the values through which the variable will be cycled upon using the shortcut. You can "cycle" through one element to just set that variable to fixed value every time. If fourth argument is "add" or "subtract", then fifth argument should be the value which will be added/subtracted to/from the variable upon using the shortcut.

Examples:
globals.AddShortcut("file",3,"Content\\Config\\commands.lua").
After creating such shortcut, whenever you press those 3 recorded keys, code from the file 'Content\Config\commands.lua' will be executed.

globals.AddShortcut("func",2,"chatSay","Hello there!").
After creating such shortcut, whenever you press those 2 recorded keys, chatSay("Hello there!") will be executed in console.

globals.AddShortcut("var",3,"hud_bShowWeapon","cycle",0,1).
This will be turning on/off rendering of weapon in First-Person.

globals.AddShortcut("var",3,"hud_fCustomHudScale","add",0.1).
This one will be increasing hud_fCustomHudScale by 0.1 on every shortcut press.

Other functions:
globals.RemoveShortcut(keyCount)
This will prompt you to press and hold a combination of keyCount keys, upon doing so it will erase any action associated with this combination.

globals.RemoveAllShortcuts()
Pretty self-explanatory.

globals.ListDefinedShortcuts()
Lists all shortcuts that are set up.

Editing config file
If you have a need to change shortcuts frequently, you can edit the configuration file (Content/Config/Shortcuts.txt) for the shortcuts mod manually.
If you change the config file while the game is running, it will be automatically reloaded. If an error occurs when trying to read the config file, current shortcuts won't be affected and you can proceed to "fix" the config file.
Here is an example of a config file for the reference, it contains all possible command types:
#Shortcuts Mod V1.1 C|N|O| file Content\Convert.lua ### Left Shift|Left Control|R| function gamStart() ### Q| cycle hud_bShowCheats:0,1, ### H|Num +| add hud_fCustomHudScale:0.1, ### H|Num -| subtract hud_fCustomHudScale:0.1, ###

Known issues:
Some combinations of keys can't be registered (e.g. Ctrl+Shift+C). Probably has something to do with more basic game/system shortcuts.
14 Comments
DUCKYBONY 11 Feb, 2021 @ 1:33pm 
ok so you might remember me i wanted this mod just to use the cheats but then i realized that cht_bEnableCheats=3 has with shortcuts i didn't even know about that so uh it was nice having your mod
blu 19 Apr, 2020 @ 12:03pm 
it might become relevant soon, all SSVR games are cheap rn
NSKuber  [author] 18 Apr, 2020 @ 9:59am 
Hey @blu, if that's still relevant I updated the shortcuts mod config file structure a bit. Also the config file now auto-reloads in game if it is changed.
NSKuber  [author] 10 Nov, 2019 @ 11:50pm 
Hm. Same exact action and shortcut works for me. Could you please send me your
"Content/Config/Shortcuts.txt"
file (from the came folder)?
Best use pastebin.com to share it.
blu 9 Nov, 2019 @ 11:56pm 
Sadly func doesn't work anymore :c

08:55:39 INF: > globals.AddShortcut("func",2,"chatSay","Hello there!")
08:55:39 INF: Press and hold 2 keys you want in your shortcut.
08:55:43 INF: Added shortcut. Combination Left Alt + O performs 'chatSay("Hello there!")' call.
08:55:43 ERR: Lua error> [Content/SeriousSamFusion/Scripts/Startup/ShortcutsMod.lua]:42: attempt to concatenate field '?' (a nil value)
08:55:43 INF: Lua stack traceback:
08:55:43 INF: [Content/SeriousSamFusion/Scripts/Startup/ShortcutsMod.lua]:42 in function SaveShortcutsToFile
08:55:43 INF: [Content/SeriousSamFusion/Scripts/Startup/ShortcutsMod.lua]:119 in unnamed function defined in line 100
08:55:43 INF: (tail call):-1 in ?
DUCKYBONY 15 Jul, 2019 @ 6:35am 
it works yey thx
NSKuber  [author] 15 Jul, 2019 @ 2:40am 
globals.AddShortcut("var",2,"cht_bKillAll","cycle",1)

For example, like this. Enter into console and then push two keys you want to use. Or change the number of keys required in the string (second argument).
DUCKYBONY 14 Jul, 2019 @ 10:28pm 
how can i make shortcut with console cheat like killall help me plz
DUCKYBONY 14 Jul, 2019 @ 10:24pm 
how do i use this...