Toribash
Original Post
[Request] Change Two Hotkeys for Me – 5-10k TC REWARD
Before I begin, I'll let you know why I need this done. I want to play Toribash competitively (in tourneys, deuls, clan wars) but not having the ability to customize my hotkeys has influenced me to hang out on the side lines most of the time.

TB forces me to use Z and X. I have to put my left hand in an uncomfortable position to use these keys which lowers the quality of my play and keeps my head out of the game. I just want to enjoy playing TB. If you can make this script for me, I’d be willing to pay you 5-10k TC.

EDIT: This script might be hard to develop. So if you need to work together, I'll split the reward among you all.

DETAILS:
TASK #1: Change the Z (Extends/contracts the joint) hotkey to Q.

TASK #2: Change the X (Holds/relaxes the joint) hotkey to E.

That's all I ask.
Feel free to contact me if you need assistance.
Last edited by LesDuncan; Aug 28, 2013 at 04:20 AM.
Learning from the best.
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.
Attached Files
hotkey_switch.lua (492 Bytes, 9 views)
Last edited by box; Aug 28, 2013 at 01:58 AM.
[23:23:53] <AndChat|700625> Blue eyes ultimate dragon best card
[23:24:29] <AndChat|700625> You know the one with 3 heads
[23:24:39] <~Lightningkid> just like my dick



[11:35:40] <box> Hampa suck
[11:36:21] <hampa> not the first to tell me that today
Originally Posted by box View Post
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.

Thank you for giving me hope that someone can make it work completely.

EDIT: Due to how i can't use your version of the script in competitive play, without putting myself at a disadvantage, I'm opening up this request to anyone who can make a working version of the script. No problems.

Just make Z change to Q and X change to E. If everyone comes to a conclusion that it's impossible. It'll be time for me to bug Hampa and ask him to make customizable hotkeys.
Last edited by LesDuncan; Aug 28, 2013 at 04:20 AM.
Learning from the best.
I fixed the problem with Q and Uke.

If you're talking about the ghosts, I'm pretty sure it's not fixable as the set_ghost function is the same thing as using B or G, which may produce unexpected or unwanted results. Suppressing the error might come at the expense of suppressing other errors, although it's possible.

Here is the updated version of the script.

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(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)
Attached Files
hotkey_switch.lua (497 Bytes, 5 views)
[23:23:53] <AndChat|700625> Blue eyes ultimate dragon best card
[23:24:29] <AndChat|700625> You know the one with 3 heads
[23:24:39] <~Lightningkid> just like my dick



[11:35:40] <box> Hampa suck
[11:36:21] <hampa> not the first to tell me that today
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.
Last edited by Daanando; Aug 28, 2013 at 12:06 PM.
You can remove the conditionals if you use:
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.
multiple texture uploader! updated: multiple texture remover!
updated pretty colorlist!

<BobJoelZ> ok ive just rebooted my pc and ive tried to activate my reflex on yahoo internet explorer :/ no luck

<Aracoon> I do not enjoy having anal sex with multiple men
You're right, Yoyo. I made that more complicated than it needed to be.
[23:23:53] <AndChat|700625> Blue eyes ultimate dragon best card
[23:24:29] <AndChat|700625> You know the one with 3 heads
[23:24:39] <~Lightningkid> just like my dick



[11:35:40] <box> Hampa suck
[11:36:21] <hampa> not the first to tell me that today
Originally Posted by Daanando View Post
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?
Learning from the best.
Originally Posted by LesDuncan View Post
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
Last edited by T1G3R5H0T; Aug 28, 2013 at 11:22 PM.
ImBoredProdutionz©
Originally Posted by T1G3R5H0T View Post
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

Thank you all so much for helping me out. The program worked and now i can play Toribash the way i want to.
Learning from the best.