|
c_trace error
#183607
02/13/08 03:07
02/13/08 03:07
|
Joined: Oct 2003
Posts: 702
zazang
OP
User
|
OP
User
Joined: Oct 2003
Posts: 702
|
Hi This is the code that I am using :- Code:
vec_set(temp,my.x); temp[2] -= 4000; // calculate a position 4000 quants below the player result=c_trace(my.x,temp,IGNORE_ME|IGNORE_MODELS|IGNORE_SPRITES|IGNORE_PASSENTS);
It is giving me an error "machine code generator : cannot translate GETPVALUE : FIXED " on line 3(the line with c_trace) I'm using A7.07 Pro.Anyone ? regards zazang
I like good 'views' because they have no 'strings' attached..
|
|
|
Re: c_trace error
[Re: dinosaur]
#183609
02/13/08 15:33
02/13/08 15:33
|
Joined: Oct 2003
Posts: 702
zazang
OP
User
|
OP
User
Joined: Oct 2003
Posts: 702
|
Hi dinosaur, Thanks for trying it for me. Here is the full code :- Code:
action puddle() { ent_playsound(my,smallsplash,120); set(my,PASSABLE); my.scale_x = 1.3; my.scale_y = 1.3; my.scale_z = 1.3; my.skill28 = 0;
vec_set(temp,my.x); temp[2] -= 4000; result = c_trace(my.x,temp,IGNORE_ME|IGNORE_MODELS|IGNORE_SPRITES|IGNORE_PASSENTS);// subtract vertical distance to ground if (result < 10) { my.z -= (result - 1); vec_to_angle(temp,normal.x); my.tilt = temp[1]; my.pan = temp[0]; } vec_set(temp,my.x); temp[0] += 70 * cos(player.pan); temp[1] += 70 * sin(player.pan); result = c_trace(my.x,temp,IGNORE_ME|IGNORE_MODELS|IGNORE_SPRITES|IGNORE_PASSENTS); if (result < 10 && result > 0) { my.z -= (result - 1); vec_to_angle(temp,normal.x); my.tilt = temp[1]; my.pan = temp[0]; my.z += 30; if (my.tilt < 30) { my.skill28 = 1; } }
set(my,TRANSLUCENT); my.alpha = 18; while (my.alpha > 0) { my.alpha -= 0.4 * time_step; my.scale_x += 0.06 * time_step; my.scale_y += 0.06 * time_step; my.scale_z += 0.06 * time_step; if (my.skill28 == 1) { my.z -= 4.5 * time_step; my.scale_x -= 0.02 * time_step; my.scale_y += 0.06 * time_step; } wait(1); } ent_remove(my); }
The problem is happening in every line that has "result" in it. Which version of the engine did u try this ? Thanks ! regards zazang
Last edited by zazang; 02/13/08 15:35.
I like good 'views' because they have no 'strings' attached..
|
|
|
Re: c_trace error
[Re: dinosaur]
#183611
02/13/08 16:39
02/13/08 16:39
|
Joined: Oct 2003
Posts: 702
zazang
OP
User
|
OP
User
Joined: Oct 2003
Posts: 702
|
Thanks so much for the quick reply but I have not declared result anywhere  regards zazang
I like good 'views' because they have no 'strings' attached..
|
|
|
Re: c_trace error
[Re: zazang]
#183612
02/13/08 19:22
02/13/08 19:22
|
Joined: Feb 2008
Posts: 337
Vadim647
Senior Member
|
Senior Member
Joined: Feb 2008
Posts: 337
|
I fixed it. Reasons why it made an error: 1.LiteC isn't so friendly with predefined vectors to use temp2. Temp vector isn't the best solution anyway. 3.Nothing were wrong with result. So, the mighty script: Code:
#include <acknex.h> #include <default.c> VECTOR t_v;
function puddle_a() { // ent_playsound(my,smallsplash,120); set(my,PASSABLE); vec_set(my.scale_x,vector(1.3,1.3,1.3)); my.skill28 = 0;
vec_set(t_v,my.x); t_v.z -= 4000; result = c_trace(my.x,t_v,IGNORE_ME|IGNORE_MODELS|IGNORE_SPRITES|IGNORE_PASSENTS);// subtract vertical distance to ground if (result < 10) { my.z -= (result - 1); vec_to_angle(t_v,normal.x);my.tilt = t_v.y;my.pan = t_v.x; } vec_set(t_v,my.x); t_v.x += 70 * cos(camera.pan);t_v.y += 70 * sin(camera.pan); result = c_trace(my.x,t_v,IGNORE_ME|IGNORE_MODELS|IGNORE_SPRITES|IGNORE_PASSENTS); if (result < 10 && result > 0) { my.z -= (result - 1); vec_to_angle(t_v,normal.x); my.tilt = t_v.y;my.pan = t_v.x;my.z += 30; if (my.tilt < 30) { my.skill28 = 1; } }
set(my,TRANSLUCENT); my.alpha = 18; while (my.alpha > 0) { my.alpha -= 0.4 * time_step; my.scale_x += 0.06 * time_step;my.scale_y += 0.06 * time_step;my.scale_z += 0.06 * time_step; if (my.skill28 == 1) { my.z -= 4.5 * time_step; my.scale_x -= 0.02 * time_step;my.scale_y += 0.06 * time_step; } wait(1); } ent_remove(my); } function main() {video_window(nullvector,nullvector,1,"c_rotate test");video_switch(8,0,1); fps_max = 64;detail_size = 64;vec_set(sky_color,vector(192,160,128)); level_load("map_water.hmp"); wait(3); ent_create("test.mdl",vector(-256,0,128),puddle_a); }
I switched to other account since marth 2010. Guess which.
|
|
|
Re: c_trace error
[Re: Vadim647]
#183613
02/14/08 01:49
02/14/08 01:49
|
Joined: Oct 2003
Posts: 702
zazang
OP
User
|
OP
User
Joined: Oct 2003
Posts: 702
|
Hi Even this code did not help.However I finally fixed it. I replaced "REsult" with my own var like this :- Code:
vec_set(temp,my.x); temp[2] -= 4000; dist = c_trace(my.x,temp,IGNORE_ME|IGNORE_MODELS|IGNORE_SPRITES|IGNORE_PASSENTS); if (dist < 10) { my.z -= (dist - 1); vec_to_angle(temp,normal.x); my.tilt = temp[1]; my.pan = temp[0]; }
I think this error looks like machine specific,which is scary ! Thanks so much for the help. regards zazang
I like good 'views' because they have no 'strings' attached..
|
|
|
|