HTOTM: FUSION
It should work, something like this should randomise once, then draw a square based on this.
function randomise()
r = math.random(0,1000)/1000
g = math.random(0,1000)/1000
b = math.random(0,1000)/1000
a = math.random(0,1000)/1000
end

randomise()

local function draw2d()
set_color(r,g,b,a)
draw_quad(100,100,300,300)
end

add_hook("draw2d","randomquad",draw2d)
:D
Someone explain the following completely:
add_trail_particle(integer player, integer emitter_id, number pt1_x, number pt1_y, number pt1_z, number pt2_x, number pt2_y, number pt2_z)
I think the areas in italic are the position, but I have no idea what the bold is.
Also, I bet someone can make something kick ass with this if they tried hard enough.
Originally Posted by Nuyashaki View Post
Someone explain the following completely:
add_trail_particle(integer player, integer emitter_id, number pt1_x, number pt1_y, number pt1_z, number pt2_x, number pt2_y, number pt2_z)
I think the areas in italic are the position, but I have no idea what the bold is.
Also, I bet someone can make something kick ass with this if they tried hard enough.

I think it relates to the body part?
Last edited by Blam; Apr 14, 2008 at 07:45 PM.
:D
I think it relates to the body part?

I dont think so, because the built in trails move from a joint to a body part. I'm thinking it's like an ID for colors or something. So like 2 parts with the same color would have the same thing there It's a crappy guess.
Last edited by Nuyashaki; Apr 14, 2008 at 07:57 PM.
Warning, my knowledge of hexidecimals and the structure of programs is limited, so don't say I'm stupid and you need blah blah blah.
Is it possible to get the value of an adress (in double, float, text, 4 byte, and all that stuff) inside of the tb.exe process while it is running, with Lua (sorta like a bulit in Cheat Engine)? If so, what's the command; and if not, make one.
It's not like I could do any harm since tb multi player is completely server sided (I think).
That's very hard to code. So no. Not to mention it's unsafe and leaves huge holes that can be exploited by keyloggers and such.

Also, the value of an address would be a byte always, afaik.
Well thanks Jok, I just use cheat engine. That's where all my knowledge of hexidecimals came from.
Also, I'd like to note that before Lua, I had no programing experience what so ever, so let me ask a few things:
1. Does a hook basically tell a function when to run? Like new_game would start on a new game?
2. Can you list all the current hooks?
3. What does this mean
for k = 0, 1 do
        for i=0, 19 do
I dont understand it what so ever.
Originally Posted by Nuyashaki View Post
Well thanks Jok, I just use cheat engine. That's where all my knowledge of hexidecimals came from.
Also, I'd like to note that before Lua, I had no programing experience what so ever, so let me ask a few things:
1. Does a hook basically tell a function when to run? Like new_game would start on a new game?
2. Can you list all the current hooks?
3. What does this mean
for k = 0, 1 do
        for i=0, 19 do
I dont understand it what so ever.

1. Yes.
2. List from Toribash 3.2:
"new_game"
"new_mp_game"
"enter_frame"
"end_game"
"leave_game"
"enter_freeze"
"exit_freeze"
"key_up"
"key_down"
"mouse_button_up"
"mouse_button_down"
"mouse_move"
"player_select"
"joint_select"
"draw2d",
"draw3d"
"play"
"camera"
"console"
3. That makes 2 loops. Ill make an example of how to use it for you

for k = 0, 1 do -- Do this twice (0 to 1 = 2 times) First with k being 0, then with it being 1.
        for i=0, 19 do -- Do this 20 times. With i going from 0 to 19
              echo(k .. " : " .. i) -- Echos k and i.
        end -- Ends the second for
end -- Ends the first for
That will make 38 echos. First it will go through i equaling 0,19 with k equaling 0, then it will go through with k being 1.

The loop you specified is normally used to get joint data for both the tori and the uke, like so:
JointInfo = { } -- This sets up a new array 
for k = 0, 1 do -- Do this twice for each player
JointInfo[k+1] = { } -- We use k+1 as tables shouldnt use [0].
         for i=0, 19 do -- Do this 20 times for each joint
              JointInfo[k+1][i+1] = get_joint_info(k,i) -- Inserts the joint info into the JointInfo[k+1][i+1] table.
        end -- Ends first for
end -- Ends second for
:D
Er, no.

It's a cycle.

k starts at 0, and i starts at 1. Then it does the function inside the loop once, then k is still 0, and i is 2. It repeats until i is 19, then k becomes 1 and i become 1 again. Then k is 1, i is 2, etc, etc, until k is 1 and i is 19.

Factorials are 1*2*3*...*n. Nothing more.