Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, 1 invisible), 19,045 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_trace error #183607
02/13/08 03:07
02/13/08 03:07
Joined: Oct 2003
Posts: 702
Z
zazang Offline OP
User
zazang  Offline OP
User
Z

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: zazang] #183608
02/13/08 13:59
02/13/08 13:59
Joined: Feb 2008
Posts: 9
Germany, Cologne
dinosaur Offline
Newbie
dinosaur  Offline
Newbie

Joined: Feb 2008
Posts: 9
Germany, Cologne
Hi zazang,

i tried your code and it compiled without problems.

You have more of your lite-c script to try? Mayby the error depends from other problems in your program?

Sorry, for not being very helpful.

regards
dinosaur

Re: c_trace error [Re: dinosaur] #183609
02/13/08 15:33
02/13/08 15:33
Joined: Oct 2003
Posts: 702
Z
zazang Offline OP
User
zazang  Offline OP
User
Z

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: zazang] #183610
02/13/08 15:59
02/13/08 15:59
Joined: Feb 2008
Posts: 9
Germany, Cologne
dinosaur Offline
Newbie
dinosaur  Offline
Newbie

Joined: Feb 2008
Posts: 9
Germany, Cologne
Hi zazang,

First: I use A7.07.

I could get the following error :
machine code generator: can not translate GETPVALUE:LONG::FIXED

if i try to declare a member with the name 'result'

'result' is an internal member and should not be declared in your code.
The engine declares this for you.

Hope i could help you with that.

regards
dinosaur

Re: c_trace error [Re: dinosaur] #183611
02/13/08 16:39
02/13/08 16:39
Joined: Oct 2003
Posts: 702
Z
zazang Offline OP
User
zazang  Offline OP
User
Z

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
V
Vadim647 Offline
Senior Member
Vadim647  Offline
Senior Member
V

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 temp

  • 2.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
    Z
    zazang Offline OP
    User
    zazang  Offline OP
    User
    Z

    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..

    Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

    Gamestudio download | Zorro platform | shop | Data Protection Policy

    oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

    Powered by UBB.threads™ PHP Forum Software 7.7.1