2 registered members (AndrewAMD, Akow),
1,371
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Crash in sys
#332716
07/11/10 18:33
07/11/10 18:33
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
This one gives me a Crash in sys (system)
ENTITY* rock;
var base_perc;
var scan_base = 1;
var b = 0;
function rocket_weg()
{
ent_remove(rock);
vec_set(camera.x,nullvector);
scan_base = 1;
b = 0;
}
function rocket_launch()
{
rock = ent_create("sphere.mdl",camera.x,NULL);
set(rock, INVISIBLE);
rock.emask |= (ENABLE_BLOCK | ENABLE_ENTITY);
rock.event = rocket_weg;
while(rock)
{
vec_set(camera.x,rock.x);
c_move(rock,nullvector,vector(10*time_step,(key_a - key_d),(key_w - key_a)), GLIDE);
wait(1);
}
}
action rocket_base()
{
while(me && scan_base == 1)
{
c_scan(my.x,my.pan, vector(360,180,15), IGNORE_ME);
if(you == ball)
{
if(key_e)
{
scan_base = 0;
ent_animate(me,"zu",base_perc,0);
base_perc += 5*time_step;
}
if(mouse_right && b == 0)
{
b = 1;
rocket_launch();
}
control = 0;
phent_enable(ball,0);
ent_animate(me,"zu",base_perc,0);
base_perc += 5*time_step;
c_setminmax(me);
}
else
{
phent_enable(ball,1);
}
wait(1);
}
}
Why? Because after I am clicking okay in the error box everything works fine And can you say me btw waht causes these crashes in sys? Thanks
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Crash in sys
[Re: MasterQ32]
#332722
07/11/10 19:00
07/11/10 19:00
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
I never worked with Debug before o.o No, I am not using a NULL Pointer, code is above.
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Crash in sys
[Re: MasterQ32]
#332725
07/11/10 19:11
07/11/10 19:11
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
Now I have Invalid Arguments in rocket_launch. I think that it is because I am deleting the Entity rock. But why is it causing an error?
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Crash in sys
[Re: Liamissimo]
#332727
07/11/10 19:48
07/11/10 19:48
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
at a glance, looks like your ball pointer = NULL, at the start of action rocket_base() put hope this helps
|
|
|
Re: Crash in sys
[Re: MrGuest]
#332730
07/11/10 19:59
07/11/10 19:59
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
No, sorry, here is the changed code. Same error as before
function rocket_weg()
{
wait(1);
ent_remove(rock);
vec_set(camera.x,nullvector);
scan_base = 1;
b = 0;
}
function rocket_launch()
{
rock = ent_create("sphere.mdl",camera.x,NULL);
set(rock, INVISIBLE);
rock.emask |= (ENABLE_BLOCK | ENABLE_ENTITY);
rock.event = rocket_weg;
while(rock)
{
vec_set(camera.x,rock.x);
c_move(rock,nullvector,vector(30*time_step,(key_a - key_d),(key_w - key_s)), GLIDE);
wait(1);
}
}
action rocket_base()
{
while(!ball){wait(1);}
while(me && scan_base == 1)
{
c_scan(my.x,my.pan, vector(360,180,15), IGNORE_ME);
if(you == ball)
{
if(key_e)
{
scan_base = 0;
ent_animate(me,"zu",base_perc,0);
base_perc += 5*time_step;
}
if(mouse_right && b == 0)
{
b = 1;
rocket_launch();
}
control = 0;
phent_enable(ball,0);
ent_animate(me,"zu",base_perc,0);
base_perc += 5*time_step;
c_setminmax(me);
}
else
{
phent_enable(ball,1);
}
wait(1);
}
}
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Crash in sys
[Re: Liamissimo]
#332743
07/11/10 21:26
07/11/10 21:26
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
Serious User
|
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
I think the problem is you pointer. I got same error in a couple of times trying to compare the result of a collision instruction. try this:
if ( result )
{
if ( you == ball )
{
...
}
}
else
{
...
}
|
|
|
Re: Crash in sys
[Re: txesmi]
#332744
07/11/10 21:36
07/11/10 21:36
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
No, now it just playes the animation...finish
var base_perc;
var scan_base = 1;
var b = 0;
var ball_enabl = 0;
function rocket_weg()
{
wait(1);
ent_remove(rock);
vec_set(camera.x,nullvector);
scan_base = 1;
b = 0;
}
function rocket_launch()
{
rock = ent_create("sphere.mdl",camera.x,NULL);
set(rock, INVISIBLE);
rock.emask |= (ENABLE_BLOCK | ENABLE_ENTITY);
rock.event = rocket_weg;
while(rock)
{
vec_set(camera.x,rock.x);
c_move(rock,nullvector,vector(30*time_step,(key_a - key_d),(key_w - key_s)), GLIDE);
wait(1);
}
}
action rocket_base()
{
while(!ball){wait(1);}
while(me && scan_base == 1)
{
c_scan(my.x,my.pan, vector(360,180,15), IGNORE_ME);
if(result)
{
if(key_e)
{
scan_base = 0;
ent_animate(me,"auf",base_perc,0);
base_perc += 5*time_step;
}
if(mouse_right && b == 0)
{
b = 1;
rocket_launch();
}
control = 0;
ball_enabl = 1;
phent_enable(ball,0);
ent_animate(me,"zu",base_perc,0);
base_perc += 5*time_step;
c_setminmax(me);
}
if(ball_enabl == 1)
{
ball_enabl = 0;
phent_enable(ball,1);
}
wait(1);
}
}
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Crash in sys
[Re: Liamissimo]
#332756
07/11/10 22:54
07/11/10 22:54
|
Joined: Jul 2004
Posts: 1,710
MMike
Serious User
|
Serious User
Joined: Jul 2004
Posts: 1,710
|
LOOK on the end function action rocket_base
in the ..if mouse_right.. i thnk you should do the all thing if mouse_right!=NULL ..&&...
after the ent_create give it a wait(1) for security..
And in lite C is it nullvector, i know i have to use NULL and not null.. because its case sensitive..
also this instruction seems to me be dangerouse: function rocket_weg() { >>>> ent_remove(rock); vec_set(camera.x,nullvector); scan_base = 1; b = 0; } function rocket_launch() { rock = ent_create("sphere.mdl",camera.x,NULL); set(rock, INVISIBLE); rock.emask |= (ENABLE_BLOCK | ENABLE_ENTITY); rock.event = rocket_weg; >>>> You create and then you delete.. perhaps there is some.. thing here causing error. then you ask for the rock, but there is no while valid rock ! you removed.. while(rock)
Last edited by MMike; 07/11/10 22:57.
|
|
|
|