Secret Santa 2024
Original Post
Lua Documentation, References, and Tutorial
General Lua links (not specific Toribash Lua)]

http://lua.org -- Official site.
http://www.lua.org/manual/5.1/ -- Official Reference Manual. Has all the Lua commands there.
http://lua-users.org/wiki/LuaTutorial -- Lua tutorial


Toribash Lua

http://wiki.toribash.com/index.php?t..._Documentation -- Documentation on the Tori Wiki.

Bodypart List
0 - head
1 - breast
2 - chest
3 - stomach
4 - groin
5 - r_pecs
6 - r_biceps
7 - r_triceps
8 - l_pecs
9 - l_biceps
10 - l_triceps
11 - r_hand
12 - l_hand
13 - r_butt
14 - l_butt
15 - r_thigh
16 - l_thigh
17 - l_leg
18 - r_leg
19 - r_foot
20 - l_foot


Joint List
0 = neck
1 = chest
2 = lumbar
3 = abs
4 = right pec
5 = right shoulder
6 = right elbow
7 = left pec
8 = left shoulder
9 = left elbow
10 = right wrist
11 = left wrist
12 = right glute
13 = left glute
14 = right hip
15 = left hip
16 = right knee
17 = left knee
18 = right ankle
19 = left ankle

State List
1 = extend/right rotate/right bend
2 = contract/left rotate/left bend
3 = hold
4 = relax

http://forum.toribash.com/showthread.php?t=9390 -- Toribash Lua tutorial written by me.




Comments, suggestions, additions go here. I will add links as I find them/they are created.
Last edited by Jok; Sep 20, 2007 at 07:45 PM. Reason: Update!
Originally Posted by NewbLuck View Post
Any chance of having this be updated with the new joint stuff?

I'll get right on it, though that means I'll probably simply go through each command and write down like above, just out of experience, so you're less likely to get errors. Give me a few days and I'll have it done.
Correction Needed:

get_joint_info(integer player_index, integer joint_index)
-- Args: player_index (0 for RED, 1 for BLUE), joint_index (from
JOINTS.<blah>)
-- Returns a table containing the following key-value pairs:
-- state: Integer value of state (1 - 4)
-- screen_state: String value that is the name of state as displayed at bottom of screen
-- name: String value that is the name of the joint

Any other key pairs I don't know about?
Originally Posted by Treacles View Post
Id like to ask how i would make something happen if something was said in the chat box kinda like a / command

Add a hook to a function that checks what letter is being pressed, bind it to key_down. Then simply check if they happen in order.

In pseudocode: If key == / then stage = 1 end
if key == p then stage = 2 end
if key == m then stage = 3 end
if stage == 3 then //code to send the pm end


Obviously not exactly like I said. And more conditions. But you should get the basic of how it's done.

PS. Questions shouldn't go there. I'll make a new topic for that, I guess.



-------



Updated above. Documentation now on the wiki. Added joint and state list.