people playing: 52, servers online: 18, games played: 142,000,000 Top Player: imapirate

  Toribash Community » Toribash » Mods » Lua scripts
Register FAQ General Rules Community
Reply
 
Thread Tools Display Modes
Old Jun 9, 2007   #1
Jok
Senior Member
 
White Belt
Join Date: Nov 2006



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 06:45 PM.. Reason: Update!
Jok is offline   Reply With Quote
Old Jul 21, 2007   #2
NewbLuck
Skip Sandwich DX
 
10th Dan Black Belt
Join Date: Mar 2007
Posts: 227



Any chance of having this be updated with the new joint stuff?
NewbLuck is offline   Reply With Quote
Old Jul 21, 2007   #3
Jok
Senior Member
 
White Belt
Join Date: Nov 2006



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.
Jok is offline   Reply With Quote
Old Jul 29, 2007   #4
NewbLuck
Skip Sandwich DX
 
10th Dan Black Belt
Join Date: Mar 2007
Posts: 227



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?
NewbLuck is offline   Reply With Quote
Old Aug 1, 2007   #5
Treacles
NON-EXISTING!
 
Black Belt
Join Date: Jul 2007
Posts: 254



Id like to ask how i would make something happen if something was said in the chat box kinda like a / command
Treacles is offline   Reply With Quote
Old Aug 2, 2007   #6
Jok
Senior Member
 
White Belt
Join Date: Nov 2006



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.
Jok is offline   Reply With Quote
Old Sep 19, 2007   #7
Blam
Now I know my abc's!
This user title is the property of SkulFuk.
 
4th Dan Black Belt
Join Date: Apr 2007
Posts: 5,510
Clan: bncy



The link to the lua tutorial doesn't work.
:D
Blam is offline   Reply With Quote
Old Sep 19, 2007   #8
Dafe
Serious Business
 
4th Dan Black Belt
Join Date: Jul 2006
Posts: 618
Clan: bncy



The new correct link is here:
http://forum.toribash.com/showthread.php?t=9390
Radioactive torso's description should be, "You have cancer like wow."
Dafe is offline   Reply With Quote
Old Sep 20, 2007   #9
Jok
Senior Member
 
White Belt
Join Date: Nov 2006



Sorry about that, fixed.

Also fixed the [code] problems in the tutorial.
Jok is offline   Reply With Quote
Old Dec 24, 2008   #10
MONEYROCKS
Junior Member
 
Green Belt
Join Date: Nov 2008
Posts: 3



i cant open a lua file
MONEYROCKS is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:43 AM.




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
ragdoll fighting game physics fighting game ragdoll fighting physics funmotion joints martial arts karate pc mac free game turn based game