Toribash
Originally Posted by Chac View Post
can anyone exlpain the "3d draw" function to me?

Do you mean draw3d? Draw3d is a hook that is called when the 3d objects are drawn. You can use the functions:
draw_capsule(x,y,z,length,radius,rotx,roty,rotz),
draw_sphere(x,y,z,radius) and
draw_box(x,y,z,width,height,depth)
in this function to draw 3d objects on the screen. Look in worldbuilder.lua to see it used in practice or here's a quick example

do
	local function on3d()
                draw_sphere(0,0,1,1)
        end

	add_hook("draw3d", "draw3dtest", on3d)
end
Originally Posted by flamflim View Post
I've tried using get_body_info(player,part).sides

Ok, I've found another field called get_body_info.rot which wasn't in the sdk example. I also found a function set_body_rotation, but it doesn't seem to do anything, so I guess this feature is planned but not implemented yet.
Originally Posted by flamflim View Post
Ok, I've found another field called get_body_info.rot which wasn't in the sdk example. I also found a function set_body_rotation, but it doesn't seem to do anything, so I guess this feature is planned but not implemented yet.

.rot was new fixed 3.1, so it hasn't been added yet.
And set_body_rotation as you said probably is planned for the near future.
Last edited by Blam; Feb 1, 2008 at 09:36 PM.
:D
.rot has actually been around since 2.7 or so, but it was broken between something like 3.04 and 3.06, but it's back to its old behavior.

It currently returns a rotation matrix with named fields r0, r1, r2 ... r15.

Here's some code from an API I'm developing that uses it. Maybe this will help.

http://toribash.mydistraction.net/sphericalRegion.lua
http://toribash.mydistraction.net/ukeFaceLaser.lua
Radioactive torso's description should be, "You have cancer like wow."
Can lua export game settings into notepad and save them in the scripts folder?

Same with moves from a replay?
Church of BnW
I tried to add upon RiCh's emote script but it has an error loading

local function keydown(key)
if(key == 44) then
run_cmd("em Where is your god now!?!")
end
if(key == 46) then
run_cmd("em I fail")
end
if(key == 109) then
run_cmd("em Death by spritecat")
end

if(key == 110) then
run_cmd("em Fresh blood")
end
if(key == 305) then
run_cmd("em What are you looking at?")
end
if(key == 303) then
run_cmd("Duck and cover!")
end

echo("Script by RicH")
echo("Have a nice day!! ")
echo("Tested by RicH, Blueshoes, and others who were shocked with the rapid emotes")
echo("m,.")

add_hook("key_down", "keypressdown", keydown)


Whats wrong with it?
Its an lol.
Check stderr.txt for clues!
Radioactive torso's description should be, "You have cancer like wow."
(10) : warning C7532: global function exp requires "#version 110" before use

Lua script error in file rapidemotes.lua: data/script/rapidemotes.lua:29: 'end' expected (to close 'function' at line 1) near '<eof>'
Shader linking: Fragment info
-------------



Thats what it says i have no idea what it means
Its an lol.
you need to put another end after the last end..
Fixed code:
local function keydown(key)
    if(key == 44) then
        run_cmd("em Where is your god now!?!")
end
    if(key == 46) then
        run_cmd("em I fail")
end
    if(key == 109) then
        run_cmd("em Death by spritecat")
end

    if(key == 110) then
            run_cmd("em Fresh blood")
end
    if(key == 305) then
        run_cmd("em What are you looking at?")
end
    if(key == 303) then
        run_cmd("Duck and cover!")
end
end

echo("Script by RicH")
echo("Have a nice day!! :)")
echo("Tested by RicH, Blueshoes, and others who were shocked with the rapid emotes")
echo("m,.")

add_hook("key_down", "keypressdown", keydown)
To end the keydown function
:D