1 registered members (AndrewAMD),
1,089
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
nonexistent/empty function NIGHTMARE
#215214
07/09/08 20:35
07/09/08 20:35
|
Joined: Aug 2006
Posts: 152 vector(200,45,338)
Marwan
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 152
vector(200,45,338)
|
I was writing code for some game and it was working fine as it should be , then I modified a small thing in the script file , and when I run the engine after that I got a message:
nonexistent / empty function in (xy)
I dont know why did I resieve an error message about this function , It wasnt the one which I modified , I modified a totally different that has nothing to do with that errored function , and there are no syntax faults in it or in any part of the script , I erased that function but it gave me the same error , please could someone tell me how to get rid of this nightmare???
and thanks in advance
Marwan
age:16
game design and
programming
experience:2 years
|
|
|
Re: nonexistent/empty function NIGHTMARE
[Re: kasimir]
#215221
07/09/08 21:16
07/09/08 21:16
|
Joined: Aug 2006
Posts: 152 vector(200,45,338)
Marwan
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 152
vector(200,45,338)
|
I swear I checked it like a hundred times there are no syntax mistakes at all
age:16
game design and
programming
experience:2 years
|
|
|
Re: nonexistent/empty function NIGHTMARE
[Re: kasimir]
#215224
07/09/08 21:36
07/09/08 21:36
|
Joined: Aug 2006
Posts: 152 vector(200,45,338)
Marwan
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 152
vector(200,45,338)
|
action gun_action { gun=my; my.passable=on; my.alpha=100; while(1) { aiming(); wait(1); } }
action bat_movement()//some bat entities act as targets { bat=my; my.enable_impact=on; my.enable_entity=on; my.event=die_event; while(1) { movement(); wait(1); } }
action move_bullets() { bullet=my; gun=you; var bullet_speed; my.enable_impact = on; my.enable_entity = on; my.enable_block = on; my.passable=off; my.event = remove_bullets; my.pan = camera.pan; my.tilt = camera.tilt; bullet_speed.x = 10 * time; bullet_speed.y = 0; bullet_speed.z = 0; while (my != null) { c_move (my, bullet_speed, nullvector, IGNORE_YOU); }
////////////////////////////////////////////////////
function aiming() { my.pan-=3*mouse_force.x*time_step; my.tilt+=3*mouse_force.y*time_step; camera.pan=my.pan; camera.tilt=my.tilt; camera.x=my.x; camera.z=my.z; camera.y=my.y; my.transparent=on; if (key_space==on){fire_bullets();} if (key_s==on){my.alpha-=5;} }
starter random_directions()
{ randomize(); }
function movement()//controls the movements of the bat entities { var index; index = random(10); var tempo = 0; while (index > 0) { tempo = random (1); if (tempo <= 0.2){my.pan-=0*time_step;} if ((tempo > 0.2) && (random(1)<= 0.4)){my.pan-=10*time_step;} if ((tempo > 0.4) && (random(1)<= 0.6)){my.pan+=10*time_step;} if ((tempo > 0.6) && (random(1)<= 0.8)){my.tilt+=10*time_step;} if (tempo > 0.8){my.tilt-=10*time_step;} index-=1; } c_move(my,vector(0,0,0),nullvector,glide); ent_animate(my,"fly",fly_percentage,anm_cycle); fly_percentage+=2*time_frame; }
function fire_bullets() { proc_kill(4); while (key_space== on) {wait (1);} var shoot_percentage; ent_animate(my,"shot",shoot_percentage,NULL); shoot_percentage+=3*time_frame; ent_create (bullets,vector(camera.x+60,camera.y+60*sin(camera.pan),(camera.z+60*sin(camera.tilt))-10), move_bullets); snd_play (shot2, 100, 0); }
function remove_bullets() { if (event_type==event_impact) { wait (1); ent_remove(my); }
if (event_type==event_entity) { wait (1); ent_remove(my); }
if (event_type==event_block) { wait (1); ent_remove(my); } }
function die_event() { wait(1); ent_remove(my); snd_play(damage1,100,0); }
the function aiming() is the one which is getting the error message
when I press space the gun fires a bullets and when it collides with a bat the bat is removed , and the but is not moving so dont fell strange about that the error began when I modified the remove_bullets() function , I just added an if instruction for event_entity and event_block , thats where every thing was screwed up
the rest of the code is nothing more than definisions like vars and panles , and by the way , the gun is supposed to play an animation when it fires a bullet , but it doesent , dont know why
there are some meanless commands like controling the transparency of the gun
Last edited by Marwan; 07/09/08 21:51.
age:16
game design and
programming
experience:2 years
|
|
|
Re: nonexistent/empty function NIGHTMARE
[Re: Marwan]
#215236
07/09/08 22:33
07/09/08 22:33
|
Joined: May 2006
Posts: 90 England
TigerTao
Junior Member
|
Junior Member
Joined: May 2006
Posts: 90
England
|
action move_bullets is missing a bracket at the end. Thats why function aiming is popping up as an error, the compiler is expecting a bracket but didnt find one and so falls over at that function.
Try changing the order of functions so another function is called after action (before you set the close bracket in) and see what the compiler says.
Last edited by TigerTao; 07/09/08 22:37.
|
|
|
Re: nonexistent/empty function NIGHTMARE
[Re: kasimir]
#215338
07/10/08 15:20
07/10/08 15:20
|
Joined: Aug 2006
Posts: 152 vector(200,45,338)
Marwan
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 152
vector(200,45,338)
|
that did it , I think I just deleted something by mistake
age:16
game design and
programming
experience:2 years
|
|
|
|