Ok, so I challenged myself to write a barebones key assigner 'cause for some reason I thought it'd be hard and take a whole 3 hours... it took 25 min...
You will need to create a file called keyfile.txt and place it in the directory with the Scancodes of left right forward and backward going straight down. So basically create a file that looks like this:
30
32
16
31
If all goes well (as you can see in my comments in the code it didn't go well for me the first try lol) the Q key will be your "forward" key instead of the initial W key.
Thanks to Synergy I didn't have to go by memory for those codes.
Also I believe this belongs in the codebank more than here, but it is finished, and it is useable, and it should be object-oriented enough to give others a shot at writing their own version of it.
Well I blabbed enough for a 30-line snippet...
Rem Project: KeyAssign
Rem Created: 1/1/2008 1:44:23 AM
Rem ***** Main Source File *****
sync on
sync rate 30
`I had readkeys here... !!!!! so obvious bug..
`initial values
global left = 30
global right = 32
global forward = 17
global backward = 31
readkeys()
global player = 1
make object cube player, 150
do
doinput()
sync
loop
function readkeys()
open to read 1, "keyfile.txt"
fleft as string
fright as string
fforward as string
fbackward as string
read string 1, fleft
read string 1, fright
read string 1, fforward
read string 1, fbackward
left = VAL(fleft)
right = VAL(fright)
forward = VAL(fforward)
backward = VAL(fbackward)
close file 1
endfunction
function doinput()
if keystate(left) = 1
move_left(player)
endif
if keystate(right) = 1
move_right(player)
endif
if keystate(forward) = 1
move_forward(player)
endif
if keystate(backward) = 1
move_backward(player)
endif
endfunction
function move_left(obj)
turn object left obj, 90
move object obj, 10
turn object right obj, 90
endfunction
function move_right(obj)
turn object right obj, 90
move object obj, 10
turn object left obj, 90
endfunction
function move_forward(obj)
move object obj, 10
endfunction
function move_backward(obj)
move object obj, -10
endfunction
LLRGT omglol