Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,295 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 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 | 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