2 registered members (TipmyPip, 1 invisible),
18,789
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Entity error, but where?
[Re: croman]
#232081
10/19/08 10:24
10/19/08 10:24
|
Joined: Feb 2007
Posts: 53
n00bie
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2007
Posts: 53
|
wait, i didn't understood you now.
1) when you comment this line: if(me == kruiscorrecter1){temp5 = kruisdraaier1;} - does it work or it gives you an error again?
It gives the same error. 2) when you comment this line: vec_for_vertex(temp,temp5,2); - does it work or it gives you an error again?
It does work without error, but the entity is not attached to the place where it's belong (the vec_for_vertex script)
|
|
|
Re: Entity error, but where?
[Re: n00bie]
#232083
10/19/08 10:41
10/19/08 10:41
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
okay we found the problem and the problem is in that function which is obvious. from manual: vec_for_vertex (VECTOR* vector, ENTITY* entity, var number); do you see what says in first parameter inside of brackets? it says vector and in your code there is entity and that's why you got an error. you declared temp as ENTITY* temp; which is wrong, you must declare it as a vector: VECTOR temp; and then it will work. VECTOR temp; ENTITY* temp1; ENTITY* temp2; ENTITY* temp3; ENTITY* temp4; ENTITY* temp5 [4];
#define draaien skill1 #define draaien2 skill2 ...
action act_kruis1() { kruis1 = me; while(my) { wait(1); if(me == kruis1){temp1 = vloer;} vec_for_vertex(temp,temp1,340);
my.pan += my.draaien2 + vloer.draaien; if(key_w == 1) { if(my.draaien2 > -2.5 - vloer.draaien) { my.draaien2 -= 0.04*time_step; } } if(my.draaien2 < 0 && vloer.draaien > 0) { if(my.draaien2 < -2.5 - vloer.draaien) { my.draaien2 += 0.018*time_step; } } if(key_s == 1) { if(my.draaien2 < 0) { my.draaien2 += 0.04*time_step; } } my.roll = -kruiscorrecter1.y; my.tilt = kruiscorrecter1.x; my.x = temp.x; my.y = temp.y; my.z = temp.z; wait(1); } }
action act_kruiscorrecter1() { kruiscorrecter1 = me; while(my) { wait(1); if(me == kruiscorrecter1){temp5 = kruisdraaier1;} vec_for_vertex(temp,temp5,2); my.x = temp.x; my.y = temp.y; my.z = temp.z; wait(1); } }
action act_kruisdraaier1() { while(my) { wait(1); my.pan += my.draaien2 + vloer.draaien - my.draaien; if(key_w == 1) { if(my.draaien2 > -2.5 - vloer.draaien) { my.draaien2 -= 0.04*time_step; } } if(my.draaien2 < 0 && vloer.draaien > 0) { if(my.draaien2 < -2.5 - vloer.draaien) { my.draaien2 += 0.018*time_step; } } if(key_s == 1) { if(my.draaien2 < 0) { my.draaien2 += 0.04*time_step; } } wait(1); } }
and if this dont work then use this ENTITY* temp [11]; ENTITY* temp1; ENTITY* temp2; ENTITY* temp3; ENTITY* temp4; ENTITY* temp5 [4];
VECTOR temper; // new
#define draaien skill1 #define draaien2 skill2 ...
action act_kruis1() { kruis1 = me; while(my) { wait(1); if(me == kruis1){temp1 = vloer;} vec_for_vertex(temp,temp1,340);
my.pan += my.draaien2 + vloer.draaien; if(key_w == 1) { if(my.draaien2 > -2.5 - vloer.draaien) { my.draaien2 -= 0.04*time_step; } } if(my.draaien2 < 0 && vloer.draaien > 0) { if(my.draaien2 < -2.5 - vloer.draaien) { my.draaien2 += 0.018*time_step; } } if(key_s == 1) { if(my.draaien2 < 0) { my.draaien2 += 0.04*time_step; } } my.roll = -kruiscorrecter1.y; my.tilt = kruiscorrecter1.x; my.x = temp.x; my.y = temp.y; my.z = temp.z; wait(1); } }
action act_kruiscorrecter1() { kruiscorrecter1 = me; while(my) { wait(1); if(me == kruiscorrecter1){temp5 = kruisdraaier1;} vec_for_vertex(temper,temp5,2); my.x = temper.x; my.y = temper.y; my.z = temper.z; wait(1); } }
action act_kruisdraaier1() { while(my) { wait(1); my.pan += my.draaien2 + vloer.draaien - my.draaien; if(key_w == 1) { if(my.draaien2 > -2.5 - vloer.draaien) { my.draaien2 -= 0.04*time_step; } } if(my.draaien2 < 0 && vloer.draaien > 0) { if(my.draaien2 < -2.5 - vloer.draaien) { my.draaien2 += 0.018*time_step; } } if(key_s == 1) { if(my.draaien2 < 0) { my.draaien2 += 0.04*time_step; } } wait(1); } }
Ubi bene, ibi Patria.
|
|
|
Re: Entity error, but where?
[Re: croman]
#232085
10/19/08 10:49
10/19/08 10:49
|
Joined: Feb 2007
Posts: 53
n00bie
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2007
Posts: 53
|
EDIT: with both solutions it gives still the same error.
Last edited by n00bie; 10/19/08 10:51.
|
|
|
Re: Entity error, but where?
[Re: n00bie]
#232086
10/19/08 10:51
10/19/08 10:51
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
then something is wrong with your temp1-5 entities. why have you declared ENTITY* temp[11] like this?
Ubi bene, ibi Patria.
|
|
|
Re: Entity error, but where?
[Re: croman]
#232087
10/19/08 10:53
10/19/08 10:53
|
Joined: Feb 2007
Posts: 53
n00bie
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2007
Posts: 53
|
then something is wrong with your temp1-5 entities. why have you declared ENTITY* temp[11] like this? Because different script files uses the temp entity. And only the movements script uses temp1-5.
|
|
|
Re: Entity error, but where?
[Re: n00bie]
#232088
10/19/08 10:56
10/19/08 10:56
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
i'm sorry but i dont see where the problem is. try commenting line by line to find where are the errors and then...i dont know, try to fix that somehow because i really dont see a solution, sorry.
Ubi bene, ibi Patria.
|
|
|
|