Keybindings in starter.fps
by Markus Nuebel · in Torque Game Engine · 12/16/2003 (12:17 pm) · 2 replies
I have a question regarding keybindings in the example: starter.fps.
File: /client/init.cs
Here the following scripts are loaded:
exec("./scripts/default.bind.cs");
exec("./config.cs");
In ./scripts/default.bind.cs some default keybindings are added to the moveMap.
Then in ./config.cs
The complete moveMap is thrown away and regenerated with the bindings from config.cs .
This means, there is no need to do any default bindings, since only the bindings from config.cs are making it into the current configuration.
On the other hand you have to make your "default bindings" (e.g. for new moves) in config.cs.
Doesn't it make more sense to have the bindings in config.cs owerwrite and append the bindings, that are already in moveMap, instead of deleting it upfront?
Best regareds
-- Markus
File: /client/init.cs
Here the following scripts are loaded:
exec("./scripts/default.bind.cs");
exec("./config.cs");
In ./scripts/default.bind.cs some default keybindings are added to the moveMap.
Then in ./config.cs
The complete moveMap is thrown away and regenerated with the bindings from config.cs .
This means, there is no need to do any default bindings, since only the bindings from config.cs are making it into the current configuration.
On the other hand you have to make your "default bindings" (e.g. for new moves) in config.cs.
Doesn't it make more sense to have the bindings in config.cs owerwrite and append the bindings, that are already in moveMap, instead of deleting it upfront?
Best regareds
-- Markus
About the author
#2
That makes total sense to me. Thanks for pointing me to this.
I will try your suggestion of deleting the config.* files.
If I understood you right, all new additions to default.bind.cs will show up afterwards in config.cs.
-- Markus
12/17/2003 (3:35 am)
Hi Dan.That makes total sense to me. Thanks for pointing me to this.
I will try your suggestion of deleting the config.* files.
If I understood you right, all new additions to default.bind.cs will show up afterwards in config.cs.
-- Markus
Torque Owner Dan -
The default.bind.cs is exactly that. The default.
So if you don't have a config.cs you default back to the defaults (default.bind.cs)
Try this. Delete the config.cs and the config.dso. Run the engine and then exit. You will see the config.cs/dso is created.
As far as "why it doesn't append" if it did it would alter your original code with potentially person preferences. Wouldn't it be bad to ship a game having the manual state particular keybindings only to find out the last person to check in the default.bind.cs file had their own and different settings?
Regards,