I have seen some keybinding scripts and thought to try my hand at one:
#define CMD_FIRE 0
... other defines
var player_input[20];
var player_binds[20];
function input_startup()
{
player_binds[CMD_FIRE] = key_for_str("a");
... set all player binds
}
function update_input()
{
for( i =0; i< 20; i++ )
{
player_input[i] = key_pressed( player_binds[i] );
}
}
Unfortunately the key_pressed function will not accept var, int, float or any other value I have tried for the binds array. Why not?
My second question is about button events. The manual states that the first parameter to a button event is the button number(starting with 1). When I check the value it is multiples of 1024, 2048...? Is this some sort of fixed-point number?
Thanks,
-David