1 registered members (TedMar),
1,420
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
vec_for_vertex problem
#271512
06/13/09 16:19
06/13/09 16:19
|
Joined: Aug 2006
Posts: 96 Netherlands
Polypfreak1987
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2006
Posts: 96
Netherlands
|
Hello everybody, I have a tricky problem. I have the following script:
entity* zug;
action pp_bol {
var zz;
zz = my.z;
zug = my;
while(1) {
my.z = zz+9.6-hubring*-14-10;
my.pan = molen.pan+100;
my.tilt = 26*hubring*sin(exzenter_pos+molen.pan);
my.roll = 26*hubring*cos(exzenter_pos+molen.pan);
wait(1);
}
}
function stange1() {
var zpos1[3];
var zpos2[3];
vec_set(my.scale_x,vector(1.200,0.800,0.800));
proc_late();
while(1) {
vec_for_vertex(my.x,you,87);
vec_for_vertex(zpos2.x,you,87);
vec_for_vertex(zpos1.x,zug,41);
vec_for_vertex(zpos2.x,zug,41);
vec_lerp(temp.x,zpos1.x,zpos2.x,0.0);
vec_diff(temp.x,temp.x,my.x);
vec_to_angle(my.pan,temp.x);
wait(1);
}
}
But when I am going to test the programm I got the following error: Error E1515: Invalid arguments in stange1: vec_for_vertex(zpos1.x,zug,41) Error E1515: Invalid arguments in stange1: vec_for_vertex(zpos2.x,zug,41) I don't know what the problem is, and I can't find the problem. I hope you can help me. Thanks in advance. Greetings, Polypfreak1987.
|
|
|
Re: vec_for_vertex problem
[Re: Polypfreak1987]
#271571
06/13/09 23:40
06/13/09 23:40
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
possibly the while loop is running before ZUG get filled, or after ZUG is destroyed. Try this
while(1)
{
if((me!=0)&&(you!=0)&&(zug!=0))
{
vec_for_vertex(my.x,you,87);
vec_for_vertex(zpos2.x,you,87);
vec_for_vertex(zpos1.x,zug,41);
vec_for_vertex(zpos2.x,zug,41);
vec_lerp(temp.x,zpos1.x,zpos2.x,0.0);
vec_diff(temp.x,temp.x,my.x);
vec_to_angle(my.pan,temp.x);
}
wait(1);
}
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|