The point of this was to see how a bone could be used to move a turret. This is the exact script being used right now.
Code:
// test.wdl
var video_mode = 7; // 800x600 pixels
var video_depth = 32; // 32 bit mode
//
var bone_angle[3]; // a vector that will hold the pan, tilt and roll angles
//
string test_wmb = <test.wmb>;
//
function bone_move()
//
function main()
{
level_load (test_wmb);
mouse_mode = 1; // now show the mouse
camera.x = 0;
camera.y = 250;
camera.z = -70;
camera.pan = 0;
camera.tilt = 0; // all of these set the camera to look at the turret
// to see how it moves.
}
action bone_move
{
while(1)
{
ent_bonereset(my, "Bone1");
if (key_l == on)
{
bone_angle.pan -= 3;
}
if (key_j == on)
{
bone_angle.pan += 3;
}
if (key_k == on)
{
bone_angle.tilt -= 3;
}
if (key_i == on)
{
bone_angle.tilt += 3;
}
ent_bonerotate(my,"bone1", bone_angle); // rotate the bone named "Bone1"
wait (1);
}
}
A frankly this is the first code I have ever made in C, so please don't hammer me.
