Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Akow), 1,371 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Crash in sys #332716
07/11/10 18:33
07/11/10 18:33
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
This one gives me a Crash in sys (system)
Code:
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 wink

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: Liamissimo] #332720
07/11/10 18:47
07/11/10 18:47
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
maybe you use a NULL - Pointer!
"Crash is SYS" is in the most of cases a crash because a NULL pointer, try to debug it


Visit my site: www.masterq32.de
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
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

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: Liamissimo] #332724
07/11/10 19:05
07/11/10 19:05
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
try this:
Code:
function rocket_weg()
{
	wait(1);
	ent_remove(rock);
	vec_set(camera.x,nullvector);
	scan_base = 1;
	b = 0;
}




Visit my site: www.masterq32.de
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
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

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
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
at a glance, looks like your ball pointer = NULL,
at the start of action rocket_base() put
Code:
while(!ball){wait(1);}


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
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
No, sorry, here is the changed code. Same error as before
Code:
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 Offline
Serious User
txesmi  Offline
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:

Code:
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
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
No, now it just playes the animation...finish grin

Code:
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 Offline
Serious User
MMike  Offline
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.
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1