Gamestudio Links
Zorro Links
Newest Posts
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
Wolfram Mathematica with Zorro
by TipmyPip. 07/30/26 02:07
What are you working on?
by rayp. 07/24/26 22:58
Z9 getting Error 058
by madpower2000. 07/22/26 14:01
New Zorro version 3.11
by jcl. 07/21/26 13:42
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 1,120 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
One frame too late #343656
10/08/10 15:01
10/08/10 15:01
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
Hi,
the propeller is attached to an vertex of my plane. But the faster I get, the propeller sprite is more at the wrong place:
Normal:

High speed:

The code:
Code:
action act_plane_proptrail()
{
    var last_speed;
    
    set(me, PASSABLE);
    ent_scale(me, 0.03);
    vec_set(my.pan, vector(0.01, 0.01, 0.01));
    
    while(ent_player[MY_CLIENTID] == NULL)
    {
        wait(1);
    }
    
    you = ent_player[MY_CLIENTID];
    
    while(ent_player[MY_CLIENTID] != NULL)
    {
        vec_for_vertex(my.x, you, 34);
        vec_set(my.pan, vector(you.pan, you.tilt, my.roll));
        
        if(last_speed > 5 && you.speed <= 5)
        {
            reset(me, TRANSLUCENT);
            my.alpha = 100;
            ent_scale(me, 0.03);
            ent_morph(me, "propeller_ruhig.bmp");
        }
        if(you.speed <= 5)
        {
            my.roll += you.speed * plane_propellerRotationScale * time_step;
        }
        else
        {
            if(last_speed <= 5 && you.speed > 5)
            {
                set(me, TRANSLUCENT);
                my.alpha = 100;
                ent_scale(me, 0.055);
                ent_morph(me, "propeller_lauf.tga");
            }
        }
        if(you.speed > 5)
        {
            my.roll += you.speed * 0.01 * plane_propellerRotationScale * time_step;
        }
        
        last_speed = you.speed;
        
        wait(1);
    }
}


How to change that?

Re: One frame too late [Re: Razoron] #343657
10/08/10 15:04
10/08/10 15:04
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
put proc_mode=PROC_LATE on the action of your proppeler, so the action will update the position at the end of the frame and not in the middle, and it will be placed at the correct position each frame.


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: One frame too late [Re: painkiller] #343684
10/08/10 20:22
10/08/10 20:22
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
That was already there.

EDIT: Sorry, wrong function, it's working now, thanks!

Last edited by Razoron; 10/08/10 20:24.

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