2 registered members (VoroneTZ, 7th_zorro),
1,071
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
vec_dist help
#226865
09/11/08 19:27
09/11/08 19:27
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
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:
/////////////////////////////////////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
flits
User
|
User
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
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
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: DJBMASTER]
#226894
09/11/08 21:05
09/11/08 21:05
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
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
OP
Senior Member
|
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
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
like slin said you will need to change .z like i said you need add distance =
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
OP
Senior Member
|
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
Senior Member
|
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
OP
Senior Member
|
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
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|