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
3 registered members (VoroneTZ, monk12, Quad), 829 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
Page 2 of 2 1 2
Re: path_create doesnt work [Re: Quad] #369954
05/09/11 20:31
05/09/11 20:31
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
That's exactly what it was supposed to do. Is there anything wrong with that?

From my point of view it should be:
Code:
printf("%s",tpath->chars);


I don't know what _chr exactly does, but as far as I know it is only supposed for the dll interface, isn't it?


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

Joined: May 2010
Posts: 117
Germany , Dortmund
Hm, the ways you show me dont work. I havent any idea.
I only want that the ENTITY moves along the path with ent_movepath()

Code:
path_set(ENTITY* entity,STRING* name)

A8.13 If an empty name string is given, the string is set to the path name the entity is currently attached to



I tried that with
Code:
STRING* tpath;
STRING* tpath = "#40";
STRING* tpath; = str_create("#40");



I dont want to read something, the function shall work.
The ent_movepath function need the name of a
path and I dont know that name because I use
path_create()

Please let me know how it works.
I have headache ...

Wish you a nice day

Re: path_create doesnt work [Re: Bone] #370027
05/10/11 16:29
05/10/11 16:29
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Im not sure what your problem was, is it that you dont know how to create an empty string?

Strings are described in the manual. This is an empty string:

STRING* MyEmptyString = "";

or this

STRING* AnotherEmptyString = str_create("");

Hope this helps...


Re: path_create doesnt work [Re: Spirit] #370036
05/10/11 16:53
05/10/11 16:53
Joined: May 2010
Posts: 117
Germany , Dortmund
B
Bone Offline OP
Member
Bone  Offline OP
Member
B

Joined: May 2010
Posts: 117
Germany , Dortmund
Both ways result in a crash in ent_movepath()

Re: path_create doesnt work [Re: Bone] #370310
05/12/11 11:53
05/12/11 11:53
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Sure it crashes when you give an empty string instead of a path name.

I still don't understand what you want to do. Either you want to attach the entity to a new path, then you must give its name, or not, then you must give NULL. At least thats what the manual tells about ent_movepath.

Re: path_create doesnt work [Re: Quad] #370323
05/12/11 13:35
05/12/11 13:35
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 create a path with path_create.
After that i create a car and want the car move along
the path which i have created with path_create.
I have to use path_set with an empty string to get the pathname of the path.

Quote:
path_set(ENTITY* entity,STRING* name)
Attaches the given entity to the path with the given name. A8.13 If an empty name string is given, the string is set to the path name the entity is currently attached to. If NULL is given for the name, the entity is detached from its previous path.


I tried following
Code:
car = ent_create("mini.mdl",0,0);

	STRING* tpath ="";

// and = "#40" or = str_create("") or str_create("#40")

	

	path_set(road1.track_path,tpath);
 	ent_movepath(car,tpath, 5,2);
 	
 	ptr_remove(tpath);



It doesnt work.
road1.track_path is an ENTITY pointer to
an entity attached to the path created with path_create.

Re: path_create doesnt work [Re: Bone] #370333
05/12/11 14:31
05/12/11 14:31
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Hmm I cant see how this is supposed to work. How can you name a path that you created with path_create? Created objects have no name, names are only for identifying objects that you placed in WED. Why don't you just create the path with the car?

Re: path_create doesnt work [Re: Spirit] #370348
05/12/11 15:49
05/12/11 15:49
Joined: May 2010
Posts: 117
Germany , Dortmund
B
Bone Offline OP
Member
Bone  Offline OP
Member
B

Joined: May 2010
Posts: 117
Germany , Dortmund
http://manual.3dgamestudio.net/newfeatures8.htm

There you find
Quote:
Actor paths can be created by script with the path_create function. The path_set function can be used to retrieve the path name.


I think that should work for pathes created with path_create too.

I dont want to create the path for each vehicle that shall follow the street

Re: path_create doesnt work [Re: Bone] #370417
05/13/11 07:37
05/13/11 07:37
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Well if something has no name, it would obviously not make much sense to search for it with a name command? When you only want to connect another entity to the same path, I think the entity path is stored in path_index so its just:

my.path_index = your.path_index;

Is this what you want to do?


Page 2 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