Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, 1 invisible), 721 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_move crashed #453218
07/12/15 18:56
07/12/15 18:56
Joined: Dec 2009
Posts: 16
NovaTech2010 Offline OP
Newbie
NovaTech2010  Offline OP
Newbie

Joined: Dec 2009
Posts: 16
Hoi ^^

I'm on script a shooter, now c_move is crashing the engine, although the code has already worked...
My guess is the engine is to old...

Code:
function bulletHit(){
/* Hit-Event */
}
function alginProjectil(ENTITY* bullet,ENTITY* weapon){
/* Algin bullets */
}

function shoot_bullet01(){
	var life=50;
	my.event=bulletHit;
	alginProjectil(me,you);
	ang_add(me.pan,vector(random(3)-1.5,random(3)-1.5,random(3)-1.5));
while(life>0){
		c_move(me,vector(0,-1000*time_step,0),nullvector,USE_POLYGON | IGNORE_YOU);//[color:#FF0000]<---Crash[/color]
		life-=1*time_step;
		wait(1);
	}
}



If i delete the c_move-row the game don't crash, but i need the c_move command smirk

Thank you for helps and tips and stuff!

Re: c_move crashed [Re: NovaTech2010] #453219
07/12/15 19:04
07/12/15 19:04
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: NovaTech2010
My guess is the engine is to old...
grin

alginProjectil(me,you); - from where do you get your YOU pointer? Cause your 'c_move' has IGNORE_YOU.

Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: c_move crashed [Re: 3run] #453220
07/12/15 19:09
07/12/15 19:09
Joined: Dec 2009
Posts: 16
NovaTech2010 Offline OP
Newbie
NovaTech2010  Offline OP
Newbie

Joined: Dec 2009
Posts: 16
The weapon ist the YOU-pointer, i have tryed NULL as flag, it isn't the crash reason.
c_move don't crash if the ENTITY of c_move isn't the 'me' ^^

Re: c_move crashed [Re: NovaTech2010] #453221
07/12/15 19:14
07/12/15 19:14
Joined: Dec 2009
Posts: 16
NovaTech2010 Offline OP
Newbie
NovaTech2010  Offline OP
Newbie

Joined: Dec 2009
Posts: 16
P.S.: I have the A7 Extra Version xD

Re: c_move crashed [Re: NovaTech2010] #453222
07/12/15 19:16
07/12/15 19:16
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Better avoid using 'you' and pointers in general like that, that's caused the crash, I'm pretty sure. That pointer changed by many other functions.

Edit: use A8 free.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: c_move crashed [Re: 3run] #453223
07/12/15 19:21
07/12/15 19:21
Joined: Dec 2009
Posts: 16
NovaTech2010 Offline OP
Newbie
NovaTech2010  Offline OP
Newbie

Joined: Dec 2009
Posts: 16
Thank you, yes maybe, but if i cancel alginProjectil(me,you); from the function, it crashes nevertheless smirk

Re: c_move crashed [Re: NovaTech2010] #453224
07/12/15 19:33
07/12/15 19:33
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Raw example of 'c_move' with event:
Code:
function hit_bullet(){

	if(event_type == EVENT_ENTITY){				
		my.skill1 = -1;		
	}
}

function shoot_bullet01(){
	
	var life = 50;
	
	my.emask |= ENABLE_ENTITY;
	my.event = hit_bullet;	
	
	my.skill1 = 1;
	
	wait(1);
	c_setminmax(my);
	
	while(my.skill1 > 0){
		
		c_move(me, vector(0, -1000 * time_step, 0), nullvector, USE_POLYGON | IGNORE_YOU);
		
		if(life <= 0){
			my.skill1 = -1;
		}
		life -= 1 * time_step;
		
		wait(1);
	}
	ent_remove(my);
}

void main()
{
	level_load("");
	
	vec_set(camera.x, vector(-301, 177, 13));
	vec_set(camera.pan, vector(302, -2, 0));
	
	
	ENTITY* testEnt = ent_create(CUBE_MDL, vector(0, -1000, 0), NULL);	
	vec_fill(testEnt.scale_x, 10);
	wait(1);
	c_setminmax(testEnt);
	set(testEnt, POLYGON);	
	
	while(1){
		
		ent_create(CUBE_MDL, nullvector, shoot_bullet01);
		
		wait(-1);
	}	
	
}

As you can see, it works :> So, it means that's you've messed up somewhere else.

Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: c_move crashed [Re: 3run] #453225
07/12/15 19:44
07/12/15 19:44
Joined: Dec 2009
Posts: 16
NovaTech2010 Offline OP
Newbie
NovaTech2010  Offline OP
Newbie

Joined: Dec 2009
Posts: 16
Thank you for help grin
Looks legal but crashes as well :'/
It works if i cancel c_move row xd
I think it is simply the engine, soon i update the A7 Extra to A8 supermegapro and than this thingy maybe is fixed smirk

Re: c_move crashed [Re: NovaTech2010] #453227
07/12/15 20:00
07/12/15 20:00
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Not sure about this, but try using NULLVECTOR instead of nullvector. I remember at some point there was a problem using lower-case nullvector in 3DGS... or maybe my memory is failing grin ... anyway, its 1 sec to try...


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: c_move crashed [Re: NovaTech2010] #453228
07/12/15 20:00
07/12/15 20:00
Joined: Dec 2009
Posts: 16
NovaTech2010 Offline OP
Newbie
NovaTech2010  Offline OP
Newbie

Joined: Dec 2009
Posts: 16
Iiiiiiiiiii have found the mysterious mistake!

ent_create(NULL,me.x,shoot_bullet01);

He can't move a NULL.
I apologize for stupidness and thank you so much.

EDIT: and please kill me and bury me.

Last edited by NovaTech2010; 07/12/15 20:02.

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