ES Recruitment Drive
Original Post
Glowing Joints (sorta)
This script is merely for looks and that alone. It places a transparent orb around each joint, simulating somewhat of a glowing joint.
I'll also include some of my edited LightDagger scripts.
Here's a screenshot.

I am NOT TAKING REQUESTS to make each joint a different size/color. Learn the syntax below and do it yourself.


SYNTAX:
When You open the script you should see
local p3 = {['x'] = 0, ['y'] = 0, ['z'] = 0}
local draw = false

local function get_distance(x1,y1,z1,x2,y2,z2)
    local dist = math.abs( math.sqrt( (x1 - x2)^2 + (y1 - y2)^2 + (z1 - z2)^2 ) )
    return dist
end

local function show()
        if (draw == true) then
--                set_color(0,0,0,0.5)
--                draw_sphere(px,py,pz,0.2)
                set_color(1,1,0,0.5)
                draw_sphere(px,py,pz,0.15)
                etc.
Every joint is abbreviated by the first letters of draw_sphere. DO NOT CHANGE. Ex. la= left ankle, n=neck. The right wrist is p. This is the only exception.

C
hanging Color:

The color is in the set_color line ABOVE the wanted joint. The first 3 numbers are color, the last is visibility (1 = 100% visible, .5 = 50% visible, etc.). The colors are in red green blue format. They are determined by ratio (ex. 1,1,1 is the same as 50,50,50. 100, 50, 0 is the same as 2,1,0). To add white to colors, add 1 to every number. To get black, use a decimal.
Changing Size:
The size is in the last number in the draw_sphere line of your desired joint (indicated in syntax by the bold).
END SYNTAX

Go to Save As if you don't want to overwrite the original. If you do decide to do this THE NAME MUST HAVE NO SPACES IN IT! This will cause an error that took me 2 hours to find.

Credits: 50% to suo for the light dagger script; the script I learned lua from, and used as the base for this script.

NOTE: Removed neck glow. And wrist glow size decreased!
Attached Files
lightdagger2.lua (1.4 KB, 43 views)
GlowingGreenJoints.LUA (3.5 KB, 46 views)
GlowingPurpleJoints.lua (3.5 KB, 34 views)
GlowingRedJoints.lua (3.5 KB, 44 views)
GlowingWhiteJoints.lua (3.5 KB, 29 views)
GlowingYellowJoints.lua (3.5 KB, 28 views)
GlowingCyanJoints.lua (3.5 KB, 35 views)
GlowingBlueJoints.lua (3.5 KB, 37 views)
GlowingBlackJoints.lua (3.5 KB, 48 views)
Last edited by Nuyashaki; Jan 11, 2008 at 12:42 AM.
i can make them different colors by editing the script, it's easy... this makes it look cool! nice script!
Meow, I am quite a cat these days.
Even though no one knows me, I know more about them than they know of me.
Ye, looks nice, good for screenshots.. looks like it fucks up the head though D:


[T]
#hi


I think there is something wrong. Can you get this script to work? It wont work for me for some reason. It did earilier! WTF
Edit: Found the problem. The LUA needs to be 1 word, no spaces.
Last edited by Nuyashaki; Jan 10, 2008 at 04:36 AM.
Nice code, but dont be overly complicated. The following code does the same.
local joints = {}

local function get_joint_3d()
    for i=0,19 do
        joints[i] = {}
        x, y, z = get_joint_pos(0, i)
        joints[i]['x'], joints[i]['y'], joints[i]['z'] = get_screen_pos(x, y, z);
        echo("Moo " .. i)
        if(i == 0 or i == 10 or i == 11 or i == 18 or i == 19) then
            set_color(1,1,0,0.5)
            size = 0.15
            draw_sphere(x, y, z, size)
            echo("Small " .. i)
        else
            set_color(1,0,1,0.5)
            size = 0.2
            draw_sphere(x, y, z, size)
            echo("Big " .. i)
        end
    end
    
end
add_hook("draw3d", "sphere", get_joint_3d)
Last edited by Blam; Jan 12, 2008 at 12:01 PM.
:D
Ofc.

if(i == 0 or 10 or 11 or 18 or 19) then

Is not proper.

That's saying:

If any of these are true:
i is 0
10
11
18
19

Please note, all non-0 integers are boolean trues.
Squad Squad Squad lead?
The standardization of Toribash Squad roles may have gone too far!
ohh i see thanks, fixed.
:D
There is a get_joint_radius function that can be used.

This one looks like gold in shaders.

local function get_joint_3d()
        set_color(1, 1, 0, 0.5)
        for i=0, 19 do
                x, y, z = get_joint_pos(0, i)
                draw_sphere(x, y, z, get_joint_radius(0, i))
        end
end

add_hook("draw3d", "sphere", get_joint_3d)
Attached Thumbnails
gold2.jpg