function key_down(key)
joint = get_world_state().selected_joint;
player = get_world_state().selected_player;
if (key == 113) then
if (get_joint_info(0, joint).state == 1) then
set_joint_state(player, joint, 2);
else
set_joint_state(player, joint, 1);
end
elseif (key == 101) then
if (get_joint_info(player, joint).state == 3) then
set_joint_state(player, joint, 4);
else
set_joint_state(player, joint, 3);
end
end
end
add_hook("key_down", "key_down", key_down)
Here's a quickie.
lua code:
function key_down(key)
joint = get_world_state().selected_joint;
player = get_world_state().selected_player;
if (key == 113) then
if (get_joint_info(0, joint).state == 1) then
set_joint_state(player, joint, 2);
else
set_joint_state(player, joint, 1);
end
elseif (key == 101) then
if (get_joint_info(player, joint).state == 3) then
set_joint_state(player, joint, 4);
else
set_joint_state(player, joint, 3);
end
end
end
add_hook("key_down", "key_down", key_down)
Note, it does not update the ghost like Z and X (which I think is unfixable), and it will throw an error if you press the key while not hovering over a joint. Let me know if that causes a problem for you.
e: Seems to be a problem when using Q on Uke, although it works fine on Tori. Interesting.
function key_down(key)
joint = get_world_state().selected_joint;
player = get_world_state().selected_player;
if (key == 113) then
if (get_joint_info(player, joint).state == 1) then
set_joint_state(player, joint, 2);
else
set_joint_state(player, joint, 1);
end
elseif (key == 101) then
if (get_joint_info(player, joint).state == 3) then
set_joint_state(player, joint, 4);
else
set_joint_state(player, joint, 3);
end
end
end
add_hook("key_down", "key_down", key_down)
z::q
q::z
x::e
e::x
set_joint_state(player, joint, 3 - get_joint_info(player, joint))
set_joint_state(player, joint, 7 - get_joint_info(player, joint))
You should also check if joint ~= -1, that should fix the error when not hovering a joint.
If a lua script doesn't work out, may I suggest AutoHotKey. With it, it's the easiest thing in the world to swap keys. I used it to remap my worn out WASD keys.
The script for your ZQXE would basically require no more than;
AHK scripting code:z::q
q::z
x::e
e::x
But good luck.
This could be the fix to my problems. but i don't know where to put the script your showing me. Do i just put it here?
just make a new txt file and copy and paste the code into in then saveas a .ahk
then double click the file
now its running so just play the script will run in your taskbar