Posted By: sadsack
vec_dist help - 09/11/08 19:27
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:
I hope some one can point me in the right way to make it work?
Thank You
renny
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