Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (VoroneTZ, 7th_zorro), 1,071 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
vec_dist help #226865
09/11/08 19:27
09/11/08 19:27
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline OP
Senior Member
sadsack  Offline OP
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
I been working on this for many days now on and off. I am trying to print out the distances beteen two Ent.
I been over the manual and other code and still have not been able to make it work. It is something simple that I am doing wrong. It compile and runs, it is just not printing to the screen the distance of the two objects.
CODE:
Code:

/////////////////////////////////////renny was here //////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
ENTITY* house;

ENTITY* snowman;

STRING* dis = "#30";



var distance;

distance = vec_dist(house.z,snowman.z);





TEXT* greetings_txt =
{
	pos_x = 20;
	pos_y = 20;
	string (dis);
	flags = VISIBLE;
}




action get_dis_house()
{
	house = my;
	snowman = you;
	my.ambient = 100;
	while (1)
	{
vec_dist(house.z,snowman.z);

str_for_num(dis,distance); 
	
	if(distance >100) 
	
{sys_exit ("Thank you for playing");}
	
	 wait (1);
	}

}

function main()
{
	
	level_load ("");
	wait(2);	// wait until the level is loaded
	vec_set(camera.x, vector(-2500, 0, 100));
	ent_create("house.mdl", vector(0, 0, 0), NULL);
	ent_create("snowman.mdl", vector(0, 0, 600),NULL );
}



I hope some one can point me in the right way to make it work?
Thank You
renny


I have A7 Commercial .............. Now I just need to learn how to use it

Re: vec_dist help [Re: sadsack] #226870
09/11/08 19:52
09/11/08 19:52
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
distance = vec_dist(house.z,snowman.z);


"empty"
Re: vec_dist help [Re: flits] #226890
09/11/08 20:57
09/11/08 20:57
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline OP
Senior Member
sadsack  Offline OP
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
Originally Posted By: flits
distance = vec_dist(house.z,snowman.z);


is what I have.......... are you saying that it is wrong and should ne somethink else?
renny


I have A7 Commercial .............. Now I just need to learn how to use it

Re: vec_dist help [Re: sadsack] #226891
09/11/08 21:00
09/11/08 21:00
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
But you haven't put it in a function, you have tried to run it outside, straight after the distance declaration. You can't do this. You have to use...

distance = vec_dist(house.z,snowman.z) inside a function.

Re: vec_dist help [Re: DJBMASTER] #226894
09/11/08 21:05
09/11/08 21:05
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
but still, I have to repeat flits:

distance = vec_dist(house.z,snowman.z);

Last edited by Slin; 09/11/08 21:06.
Re: vec_dist help [Re: Slin] #226927
09/12/08 00:04
09/12/08 00:04
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline OP
Senior Member
sadsack  Offline OP
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
this is my new function, but it still will not print to the screen.


function farapart_help()
{
vec_dist(my.z,you.z);
return;

}

I sure someone can use this comm and make it work.
Thank You
renny


I have A7 Commercial .............. Now I just need to learn how to use it

Re: vec_dist help [Re: sadsack] #227002
09/12/08 10:50
09/12/08 10:50
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
like slin said you will need to change .z

like i said you need add distance =

Code:
action get_dis_house()
{
	house = my;
	snowman = you;
	my.ambient = 100;
	while (1)
	{
distance = vec_dist(house.x,snowman.x);

str_for_num(dis,distance); 
	
	if(distance >100) 
	
{sys_exit ("Thank you for playing");}
	
	 wait (1);
	}

}



"empty"
Re: vec_dist help [Re: flits] #227073
09/12/08 14:23
09/12/08 14:23
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline OP
Senior Member
sadsack  Offline OP
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
Thank you flits, But I have tryed that, but will tryed it again.
I been working on this for a few days now so I have tryed just about every thing.

Thank You
renny

Edit:

I try what you had and it did not work, played around with it and put it in it own function and called it, some told me to do. that did not work.
It look like that comm. does not work, I have yet seen it work in any code I have found.



Thank you for your help, but spending days on just trying to print a few numbers
to the screen is cazy. There is other things to spend my time on. I can see why all my game making friends told me not to buy 3D Game Stuido. they said it was full of bugs.
bye

Last edited by sadsack; 09/12/08 14:42.

I have A7 Commercial .............. Now I just need to learn how to use it

Re: vec_dist help [Re: sadsack] #227181
09/12/08 23:29
09/12/08 23:29
Joined: May 2006
Posts: 398
Bot190 Offline
Senior Member
Bot190  Offline
Senior Member

Joined: May 2006
Posts: 398
just wondering but what does this mean? STRING* dis = "#30"; whats the #30 supposed to be?


Wait, there isn't a "Make My Game Now" button?
Re: vec_dist help [Re: Bot190] #227358
09/13/08 22:44
09/13/08 22:44
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline OP
Senior Member
sadsack  Offline OP
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
that let you put 30 digits of numbers.
renny


I have A7 Commercial .............. Now I just need to learn how to use it

Page 1 of 2 1 2

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