Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 12,726 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to retrieve the x,y,z of an vector [solved] #350635
12/17/10 19:46
12/17/10 19:46
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Hi, i have a vector but i want to use it's x,y,z value's indepandently , how can i read only one?

Thanks in advance

Last edited by peteredlin; 12/18/10 08:19.
Re: How to retrieve the x,y,z of an vector [Re: peteredlin] #350638
12/17/10 20:09
12/17/10 20:09
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Code:
myVector.x


Same goes for the y and z component


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: How to retrieve the x,y,z of an vector [Re: WretchedSid] #350639
12/17/10 20:20
12/17/10 20:20
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
I got the following code which i cant figure out how to work right:

Code:
VECTOR newspw;
vec_for_vertex(newspw,chasis,60);

cylinder = ent_create("cube\\cylinder\\cylinder.mdl",spawnp,NULL);

cylinder.x = newspw.x;






Last edited by peteredlin; 12/17/10 20:26.
Re: How to retrieve the x,y,z of an vector [Re: peteredlin] #350640
12/17/10 20:46
12/17/10 20:46
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
You forgot to mention what you expected as result wink


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: How to retrieve the x,y,z of an vector [Re: WretchedSid] #350643
12/17/10 21:09
12/17/10 21:09
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
I want to change the x position of the cylinder. using the coordinate from newspw...

My basic question is: how to change the position of an entity using a vector as source.?

Last edited by peteredlin; 12/17/10 21:14.
Re: How to retrieve the x,y,z of an vector [Re: peteredlin] #350653
12/17/10 21:54
12/17/10 21:54
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Well, the code is correct. I don't see why it shouldn't work.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: How to retrieve the x,y,z of an vector [Re: WretchedSid] #350659
12/17/10 22:55
12/17/10 22:55
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
well i get the following error message:

'X' is not a member of BOOL

Re: How to retrieve the x,y,z of an vector [Re: peteredlin] #350665
12/18/10 00:21
12/18/10 00:21
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
We'd need to see more of the code but a stab in the dark,

you've created a boolean pointer somewhere and are storing the entity in this (won't show any problems in the compiler) but the BOOLEAN data type doesn't have a .x property, make sure that cylinder is an ENTITY pointer.

basically what i'm trying to say:
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////


BOOL bool_temp;


void main(){
	
	BOOL bool_temp;
	level_load(NULL);
	bool_temp = ent_create(CUBE_MDL, vector(1, 1, 1), NULL);
	
	bool_temp.x = 1;
	//vec_set(bool_temp, vector(1, 1, 1));
	
}



change to:
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////


ENTITY* ent_temp;


void main(){
	
	level_load(NULL);
	ent_temp = ent_create(CUBE_MDL, vector(1, 1, 1), NULL);
	
	ent_temp.x = 1;
}



or .x inside the entities on function would work
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////


action move_me(){
	while(me){
		my.x += time_step;
		wait(1);
	}
}

void main(){
	
	level_load(NULL);
	ent_create(CUBE_MDL, vector(1, 1, 1), move_me);
	
}

Hope this helps (and makes sense)


ENTITY*

Re: How to retrieve the x,y,z of an vector [Re: MrGuest] #350683
12/18/10 08:19
12/18/10 08:19
Joined: Sep 2010
Posts: 82
P
peteredlin Offline OP
Junior Member
peteredlin  Offline OP
Junior Member
P

Joined: Sep 2010
Posts: 82
Thanks for all the help, but i solved the problem.

I used a reserved word somewhere else in the code ,thats why i coul'dn't use cylinder.x = newspwn.x

Now it works...


Gamestudio download | 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