Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
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
2 registered members (SBGuy, Quad), 768 guests, and 5 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
Page 1 of 2 1 2
path_create doesnt work #368668
04/27/11 14:00
04/27/11 14:00
Joined: May 2010
Posts: 117
Germany , Dortmund
B
Bone Offline OP
Member
Bone  Offline OP
Member
B

Joined: May 2010
Posts: 117
Germany , Dortmund
I tried to create a path with path_create and an entity that
follow the path.

var 'check' and 'node' are always 0
I write this again so you dont forget it wink

Code:
var dist = 0;
	
	ENTITY* ball = ent_create("ball.mdl", vector(0,0,20),NULL);
	
	path_create(ball,4,4);
	
	var check = path_setnode(ball,1, vector(0,30,20),NULL);
	path_setnode(ball,2, vector(3*60,3*30,70),NULL);
	path_setnode(ball,3, vector(7*60,4*30,50),NULL);
	path_setnode(ball,4, vector(11*60,2*30,20),NULL);
	

	while(1){
	 	var node =	path_spline(ball,ball.x,dist);
	 
	 	dist += 5*time_step;
		DEBUG_VAR(check, 10);
		DEBUG_VAR(node,22);
	
		wait(1);
	}



Re: path_create doesnt work [Re: Bone] #368806
04/28/11 15:45
04/28/11 15:45
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Thanks - it was indeed a bug. Path creation did not work when you use an empty level.

This will be fixed.

Re: path_create doesnt work [Re: jcl] #368824
04/28/11 18:06
04/28/11 18:06
Joined: May 2010
Posts: 117
Germany , Dortmund
B
Bone Offline OP
Member
Bone  Offline OP
Member
B

Joined: May 2010
Posts: 117
Germany , Dortmund
You are right. I tried it with level_load("");.
With loading an empty wmb file it works.

Why is path_create limited to 256 Nodes?

Last edited by Bone; 04/28/11 19:18.
Re: path_create doesnt work [Re: Bone] #369736
05/06/11 16:57
05/06/11 16:57
Joined: May 2010
Posts: 117
Germany , Dortmund
B
Bone Offline OP
Member
Bone  Offline OP
Member
B

Joined: May 2010
Posts: 117
Germany , Dortmund
An other problem.
I want to receive the name of a path (with path_set()) which i created with path_create() and use it in ent_movepath()

road1.track_path is an ENTITY Pointer with an model attached to a path.
Code:
function move_car()
 {
 	
 	ENTITY* car = ent_create("mini.mdl",0,0);
  	STRING* tpath;
 	path_set(road1.track_path,tpath);
 	printf(_chr(tpath));
 	ent_movepath(car,tpath, 5,2);
 	 	
}



printf shows me some crazy symbols an the car dont move
along the path.

Also a bug or my fail?

Re: path_create doesnt work [Re: Bone] #369750
05/06/11 19:17
05/06/11 19:17
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Your fail. tpath has not been initialized and hence is a vagabonding pointer. Use
Code:
STRING* tpath = str_create("#32");
// The rest of your code goes here...
ptr_remove(tpath);


instead.


Always learn from history, to be sure you make the same mistakes again...
Re: path_create doesnt work [Re: Uhrwerk] #369760
05/06/11 20:42
05/06/11 20:42
Joined: May 2010
Posts: 117
Germany , Dortmund
B
Bone Offline OP
Member
Bone  Offline OP
Member
B

Joined: May 2010
Posts: 117
Germany , Dortmund
I tried this too and it doesnt work.
printf() shows a blank box and the entity isnt moving along the path.

Re: path_create doesnt work [Re: Bone] #369849
05/07/11 21:34
05/07/11 21:34
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
printf("%s",_chr(tpath));


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: path_create doesnt work [Re: Superku] #369905
05/08/11 20:08
05/08/11 20:08
Joined: May 2010
Posts: 117
Germany , Dortmund
B
Bone Offline OP
Member
Bone  Offline OP
Member
B

Joined: May 2010
Posts: 117
Germany , Dortmund
Also empty

Re: path_create doesnt work [Re: Bone] #369929
05/09/11 14:41
05/09/11 14:41
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Quick user quiz: Which code experts can help Bone with his "empty" string?

Re: path_create doesnt work [Re: jcl] #369931
05/09/11 14:48
05/09/11 14:48
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
STRING* tpath = str_create("tpath");

als0

STRING* tpath = str_create("#32"); means 32 chars of empty string.


Last edited by Quadraxas; 05/09/11 14:49.

3333333333
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