Thank You Very Much XD1v0 ! The problem was saving my srcipt to .wdl not to .c . But now I have a next problem
.After saving in .c my script has got some new errors. When I try to compile it, following error appears:
Error in 'MAIN' line 60: syntax error
< anim_percentage==0; >
Before saving in .c everything was cool. It seems like it's having problems with variables cuz when i delete line with an error, next one appears in some other line. So could someone please tell me WTF is wrong again ?
Here's my full code anyways:
//////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
///////////////////////////////
var bone_angle;
ENTITY* colt;
BMAP* first_pcx = "first.pcx"; // my first bmap
PANEL* first_pan = // my first panel
{
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = first_pcx;
flags = OVERLAY | VISIBLE;
}
////////////////////////////////////////////////////////////////////////////////////
function main()
{
video_set(1024,768,32,1);
level_load ("level3.wmb");
wait (3);
}
function poruszanie_sie()
{
player=me;
var ruch = 0;
var mouse_speed = 10;
var anim_percentage;
var turn_speed;
var strzal_czas;
colt=ent_create("colt.mdl", 0, 0);
colt.PASSABLE = ON;
colt.scale_x = 0.15;
colt.scale_y = colt.scale_x;
colt.scale_z = colt.scale_x;
while(1)
{
c_move (my, vector(0, 0, 0), vector(0, 0, -5 * time_step), IGNORE_PASSABLE|GLIDE);
if (key_a) {c_move (my, vector(0, 7.5 * time_step, 0), nullvector, IGNORE_PASSABLE|GLIDE);}
if (key_d){c_move (my, vector(0, -7.5 * time_step, 0), nullvector, IGNORE_PASSABLE|GLIDE);}
if (key_w){c_move (my, vector(15 * time_step,0,0), nullvector, IGNORE_PASSABLE|GLIDE);ruch=2;}
else {ruch=0;}
if (key_s){c_move (my, vector(-15 * time_step, 0, 0), nullvector, IGNORE_PASSABLE|GLIDE);}
if (mouse_left) {strzal_czas=50;}
strzal_czas-= 1 * time_step;
if (strzal_czas<0) {strzal_czas=0;}
//------------Animacja-----------------------------------------
if (ruch == 0)
{
ent_animate(my, NULL, 0, 0);
anim_percentage==0;
if (strzal_czas==0){ent_animate(my,"Stand",anim_percentage, ANM_CYCLE);}
else
{
ent_animate(my,"StandAim",anim_percentage, ANM_CYCLE);
bone_angle.pan = camera.tilt * -1 -13; // changes pan from -40 to +40 degrees
ent_bonerotate(my,"Bip01 R UpperArm", bone_angle);
}
anim_percentage += 3 * time_step;
}
if (ruch == 2)
{
ent_animate(my, NULL, 0, 0);
if (strzal_czas==0) {ent_animate(my, "Run", anim_percentage, ANM_CYCLE);}
else
{
ent_animate(my, "RunAim", anim_percentage, ANM_CYCLE);
bone_angle.pan = camera.tilt * -1 -13; // changes pan from -40 to +40 degrees
ent_bonerotate(my,"Bip01 R UpperArm", bone_angle);
}
anim_percentage += 5 * time_step;
}
//--------Kamera--------------------------------------------
camera.pan -= mouse_force.x * 24 * time;
player.pan=camera.pan;
camera.tilt += mouse_force.y * 24 * time;
if (camera.tilt>=46)
{
camera.tilt=46;
}
if (camera.tilt<=-70)
{
camera.tilt=-70;
}
temp = fcos(camera.tilt,-50);
vec_set(camera.x,vector(my.x + fcos(camera.pan,temp),my.y +
fsin(camera.pan,temp),my.z + 12 + fsin(camera.tilt,-50)));
//-----------Attach-----------------------------------------------
vec_for_vertex(colt.x,player,447);
ang_for_bone(colt.pan,player,"Bip01 R Hand");
wait(1);
}
}