Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, vicknick, 7th_zorro, 1 invisible), 776 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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 | chip programmers | 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