ES Recruitment Drive
Movie.lua
Hey, not sure if this is exactly the place to post this, but my movie.lua script isn't working. When i run it, it creates the frames, but doesnt convert them into a video. Its easy enough to convert them myself, but it would be nice if the movie script would do it for me. Anyone help?

G
For scripts where you want to program a move for uke to do, what would you type for the function? And then from there, would you just put the name of the joint to bend and a number 1-4 for the joint movement? I'm still pretty new to lua, so sorry if you've heard these questions 5,000,000 times already.
Last edited by SrgtCorn; Jul 9, 2008 at 04:27 AM.
[CBK]
If you look in your data/script/sdk folder, you'll see most of the functions you can use. In particular, you'll want to look at set_joint_state.lua and set_grip_info.lua
Examples of how to use them are inside.
Radioactive torso's description should be, "You have cancer like wow."
Originally Posted by Dafe View Post
If you look in your data/script/sdk folder, you'll see most of the functions you can use. In particular, you'll want to look at set_joint_state.lua and set_grip_info.lua
Examples of how to use them are inside.

Yay, thank you, now I can actually make my noob trainer script.
[CBK]
Hi.
I'm trying to figure out which player won in my end_game hook.
I know I can use the injury value from get_player_info() to get the score that's displayed, and i know that the end_game hook takes one argument which is 0 for a win on points and 2 for a DQ (and I'm guessing 1 for a draw)...
But I can't figure out how to figure out which player was DQ'd.

Any Ideas?
You could try checking if any of the players joints / bodyparts are touching the ground, but that would probably lag a little.
:D
Yeah. There isn't really a good way to really reliably get that information. You could scan all body positions and joint positions and find the one with the lowest z value, but it's also going to depend on like joint radius, and the fact that non-spheres don't have their position values in the center of the object. It would probably work around 90% of the time, though.
Radioactive torso's description should be, "You have cancer like wow."
Here's an alpha prototype of my script "Newbie Trainer". It doesn't work, and I know that probably everything is wrong with it. Some hints or help on what to do/fix would be useful. (I didn't set the joints to any position yet, but I'm not sure if I wrote the joint number in the right spot, anyway.)

P.S. If this script is a completly embarassing disaster that is nearly unfixable, I'll just not bother anymore.

--Newbie Trainer
--By SrgtCorn
--A simulation of an online player to help Newbies get better.

local function start()

helloworld()

end

local function helloworld()

local a = "Newbie Trainer"

echo(a)

end

local function hello()

draw_text("Good luck against my bot! It shouldn't be too hard to beat...", 0, 300

end 

local function joint_state, x, y, z = 0, 0, 0, 0, 0
	local player_index, hand_id, grip_state = 0, 11, 1

	set_grip_info( player_index, hand_id, grip_state)
	echo ("set_grip_info (" .. player_index .. ", " .. hand_id .. ", " .. grip_state .. ")")

	local player_index, hand_id, grip_state = 0, 12, 1

	set_grip_info( player_index, hand_id, grip_state)
	echo ("set_grip_info (" .. player_index .. ", " .. hand_id .. ", " .. grip_state .. ")")

	set_joint_pos (player_index, joint_index, x, y, z)
		local player_index, joint_state = 0, 1
		local player_index, joint_state = 1, 1
		local player_index, joint_state = 2, 1
		local player_index, joint_state = 3, 1
		local player_index, joint_state = 4, 1
		local player_index, joint_state = 5, 1
		local player_index, joint_state = 6, 1
		local player_index, joint_state = 7, 1
		local player_index, joint_state = 8, 1
		local player_index, joint_state = 9, 1
		local player_index, joint_state = 10, 1
		local player_index, joint_state = 11, 1
		local player_index, joint_state = 12, 1
		local player_index, joint_state = 13, 1
		local player_index, joint_state = 14, 1
		local player_index, joint_state = 15, 1
		local player_index, joint_state = 16, 1
		local player_index, joint_state = 17, 1
		local player_index, joint_state = 18, 1
		local player_index, joint_state = 19, 1
		for i=0,19 do
		echo ("set_joint_state (" .. player_index .. ", " .. i .. ", " .. joint_state .. ")")
		set_joint_state (player_index, i, joint_state)
end

run_cmd("exportworld jointsWide.tbm")
	

end

add_hook("new_game", "unique_group_name", hello)

local function pain() 
local a = get_player_info(0)
local b = get_player_info(1)
if b.injury > 20000 then 

	centerprint("Ouch","","I think you may have won!",100)
else
	if a.injury > 10000 then
		centerprint("Ouch,"","Try again",100)
	end
end
end

echo("Newbie Trainer 0.1 Alpha")
echo("By SrgtCorn")
 
end
[CBK]
Originally Posted by SrgtCorn View Post
Here's an alpha prototype of my script "Newbie Trainer". It doesn't work, and I know that probably everything is wrong with it. Some hints or help on what to do/fix would be useful. (I didn't set the joints to any position yet, but I'm not sure if I wrote the joint number in the right spot, anyway.)

P.S. If this script is a completly embarassing disaster that is nearly unfixable, I'll just not bother anymore.

--Newbie Trainer
--By SrgtCorn
--A simulation of an online player to help Newbies get better.

local function start()

helloworld()

end

local function helloworld()

local a = "Newbie Trainer"

echo(a)

end

local function hello()

draw_text("Good luck against my bot! It shouldn't be too hard to beat...", 0, 300

end 

local function joint_state, x, y, z = 0, 0, 0, 0, 0
    local player_index, hand_id, grip_state = 0, 11, 1

    set_grip_info( player_index, hand_id, grip_state)
    echo ("set_grip_info (" .. player_index .. ", " .. hand_id .. ", " .. grip_state .. ")")

    local player_index, hand_id, grip_state = 0, 12, 1

    set_grip_info( player_index, hand_id, grip_state)
    echo ("set_grip_info (" .. player_index .. ", " .. hand_id .. ", " .. grip_state .. ")")

    set_joint_pos (player_index, joint_index, x, y, z)
        local player_index, joint_state = 0, 1
        local player_index, joint_state = 1, 1
        local player_index, joint_state = 2, 1
        local player_index, joint_state = 3, 1
        local player_index, joint_state = 4, 1
        local player_index, joint_state = 5, 1
        local player_index, joint_state = 6, 1
        local player_index, joint_state = 7, 1
        local player_index, joint_state = 8, 1
        local player_index, joint_state = 9, 1
        local player_index, joint_state = 10, 1
        local player_index, joint_state = 11, 1
        local player_index, joint_state = 12, 1
        local player_index, joint_state = 13, 1
        local player_index, joint_state = 14, 1
        local player_index, joint_state = 15, 1
        local player_index, joint_state = 16, 1
        local player_index, joint_state = 17, 1
        local player_index, joint_state = 18, 1
        local player_index, joint_state = 19, 1
        for i=0,19 do
        echo ("set_joint_state (" .. player_index .. ", " .. i .. ", " .. joint_state .. ")")
        set_joint_state (player_index, i, joint_state)
end

run_cmd("exportworld jointsWide.tbm")
    

end

add_hook("new_game", "unique_group_name", hello)

local function pain() 
local a = get_player_info(0)
local b = get_player_info(1)
if b.injury > 20000 then 

    centerprint("Ouch","","I think you may have won!",100)
else
    if a.injury > 10000 then
        centerprint("Ouch,"","Try again",100)
    end
end
end

echo("Newbie Trainer 0.1 Alpha")
echo("By SrgtCorn")
 
end

you need to check your ends and such.
check stderr.txt for better errors.

--Newbie Trainer
--By SrgtCorn
--A simulation of an online player to help Newbies get better.

function grip(hand)
    if(hand == "left") then
        h = 11
    elseif(hand == "right") then
        h = 12
    else
        h = 11
    end
    player_index, hand_id, grip_state = 0, h, 1
    set_grip_info( player_index, hand_id, grip_state)
    echo ("set_grip_info (" .. player_index .. ", " .. hand_id .. ", " .. grip_state .. ")")
end

function set_joints()
    for i=0,19 do
        joint_index, joint_state = i, 1
        echo ("set_joint_state (" .. player_index .. ", " .. i .. ", " .. joint_state .. ")")
        set_joint_state (player_index, i, joint_state)
    end
end

function hello()
    echo("Blam :D")
    grip("left")
    grip("right")
    set_joints()
end

add_hook("new_game", "unique_group_name", hello)

local function pain()
    local a = get_player_info(0)
    local b = get_player_info(1)
    if b.injury > 20000 then
        centerprint("Ouch","","I think you may have won!",100)
    else
        if a.injury > 10000 then
            centerprint("Ouch","","Try again",100)
        end
    end
end

add_hook("enter_frame","bees",pain)

echo("Newbie Trainer 0.1 Alpha")
echo("By SrgtCornhole")
:D
Originally Posted by Blam View Post
you need to check your ends and such.
check stderr.txt for better errors.

--Newbie Trainer
--By SrgtCorn
--A simulation of an online player to help Newbies get better.

function grip(hand)
    if(hand == "left") then
        h = 11
    elseif(hand == "right") then
        h = 12
    else
        h = 11
    end
    player_index, hand_id, grip_state = 0, h, 1
    set_grip_info( player_index, hand_id, grip_state)
    echo ("set_grip_info (" .. player_index .. ", " .. hand_id .. ", " .. grip_state .. ")")
end

function set_joints()
    for i=0,19 do
        joint_index, joint_state = i, 1
        echo ("set_joint_state (" .. player_index .. ", " .. i .. ", " .. joint_state .. ")")
        set_joint_state (player_index, i, joint_state)
    end
end

function hello()
    echo("Blam :D")
    grip("left")
    grip("right")
    set_joints()
end

add_hook("new_game", "unique_group_name", hello)

local function pain()
    local a = get_player_info(0)
    local b = get_player_info(1)
    if b.injury > 20000 then
        centerprint("Ouch","","I think you may have won!",100)
    else
        if a.injury > 10000 then
            centerprint("Ouch","","Try again",100)
        end
    end
end

add_hook("enter_frame","bees",pain)

echo("Newbie Trainer 0.1 Alpha")
echo("By SrgtCornhole")
SrgtCornhole

The stderr.txt said that it failed to load and nothing more. Oh well, and thanks for the help.

Nice try =P
[CBK]