Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Imhotep, opm), 785 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Need Help Finding Cause of Crash #478386
10/11/19 13:38
10/11/19 13:38
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
Hey everyone, I am getting a random crash in my game. It seems to happen sporadically, and very rarely. Sometimes I can get through the whole game with no problem. But occasionally it just shuts down. It gives me this Sys_marker in the error message (CH3) so I know it is happening somewhere in this script. This is in my character's main loop, so it is called in every frame.

Does anything stand out here as a possible cause?
Code
		sys_marker("CH3");
		
		
		//TEST JUMPING
		if(var_level_number == 0)
		{
			jump_test = c_trace(my.x,vector(my.x,my.y,my.z-2048),IGNORE_ME|IGNORE_PASSABLE|USE_POLYGON|IGNORE_FLAG2|USE_BOX);
		}
		else
		{
			jump_test = c_trace(my.x,vector(my.x,my.y,my.z-2048),IGNORE_ME|IGNORE_PASSABLE|USE_POLYGON|IGNORE_FLAG2);
		}
		
		if(jump_test > 0)//stores last reliable surface position
		{
			
			surface_z = hit.z;
		}
		
		if(var_jump == 1 && ((jump_test <= my_height) || (hit.entity.skill1 == 62 && on_ground = 1)))
		{
			
			if(jump_wait <= 0 && on_ground != 1)
			{
				if(!snd_playing(land_handle))
				{
					land_handle = snd_play(snd_land,100 * (main_volume/100),0);
				}
			}
			
			on_ground = 0;
			jumping = var_jump_amount;//5.0
		}
		else if(jump_test > my_height)
		{
			if(hit.entity.skill1 == 62 && jumping == 0 && jump_test < 32)
			{
				on_ground = 1;
				my.z = surface_z + my_height;
			}
			else
			{
				on_ground = 0;
				jumping -= 1.2 * time_step;
			}
		}
		else
		{
			if(on_ground == 0 && jumping < -4)
			{
				if(!snd_playing(land_handle))
				{
					land_handle = snd_play(snd_land,100 * (main_volume/100),0);
				}
			}
			
			on_ground = 1;
			my.z = surface_z + my_height;
			jumping = 0;
		}
		
		
		sys_marker("CH4");
		

Last edited by Dooley; 10/11/19 18:52. Reason: Changed Quote to Code as advised
Re: Need Help Finding Cause of Crash [Re: Dooley] #478388
10/11/19 14:38
10/11/19 14:38
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
The only thing I see it can cause a crash is both acceses to 'hit.entity.skill1' when 'entity' is not a valid pointer.


pd: use the code tag, not the quote one, in order to post code.

Re: Need Help Finding Cause of Crash [Re: txesmi] #478392
10/11/19 18:51
10/11/19 18:51
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
Oh, good idea. Yes, that pointer should totally have an if statement... Thanks fro the advice, I will do better next time laugh


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