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
4 registered members (dBc, clonman, TipmyPip, 1 invisible), 18,936 guests, and 5 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
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