Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (3run, AndrewAMD), 667 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simple scripting problem? #350299
12/15/10 10:07
12/15/10 10:07
Joined: Jul 2010
Posts: 5
R
Recreator Offline OP
Newbie
Recreator  Offline OP
Newbie
R

Joined: Jul 2010
Posts: 5
Why does it give me E1513 (CRASH IN) each frame? The entity moves like it should, but i can't see any empty pointer here...

Code:
action snake()
{
	VECTOR *lookAt;
	while (1)
	{
		
		vec_for_angle(lookAt, my.pan);
		vec_scale(lookAt, 11.1);
		c_move(me, vector(0,0,0), lookAt, GLIDE);
		wait(1);	
	}


}



Re: Simple scripting problem? [Re: Recreator] #350302
12/15/10 10:30
12/15/10 10:30
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,

I think because the lookAt vector is not initialized thus pointing to an illegal memory : you need to initialize it with malloc or sys_malloc and free it when you don't nees it anymore; or you can use a vector struct instead a vector pointer ;
Code:
action snake()
{
	VECTOR lookAt;
	while (1)
	{
		
		vec_for_angle(&lookAt, my.pan);
		vec_scale(&lookAt, 11.1);
		c_move(me, vector(0,0,0), &lookAt, GLIDE);
		wait(1);	
	}


}




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