Interpolating camera pos and lookat doesnt always work propertly
#1

In my server, when player connects and starts selectiong skin, hic camera moves slowly to the place of selecting. But it doesn't always work propertly. Sometimes camera stops on a half of a way. Here is a code:

pawn Код:
new is1st[MAX_PLAYERS];

public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return SpawnPlayer(playerid);
    TextDrawShowForPlayer(playerid,Text:Box);
    TextDrawShowForPlayer(playerid,Text:Box2);
                if(is1st[playerid]==0)
                {
                InterpolateCameraPos(playerid, 2030.1234,1567.5530,29.6463, 2008.1212,1664.7034,14.2188, 5000, CAMERA_MOVE);
                InterpolateCameraLookAt(playerid, 2028.5165,1553.5148,30.8905, 2005.2192,1669.0897,12.7685, 5000, CAMERA_MOVE);
                is1st[playerid]=1;
                }
    SetPlayerPos(playerid, 2005.2192,1669.0897,12.7685);
    SetPlayerFacingAngle(playerid, 228.7617);
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
    CreateExplosion(2005.2192,1669.0897,12.7685, 11, 2.0);
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    is1st[playerid]=0;
    return 1;
}

public OnPlayerConnect(playerid)
{
is1st[playerid]=0;
return 1;
}
Reply
#2

Sometimes it stops, sometimes it skips. It's a frame rate issue with GTA: SA. I reported it in the 0.3e RC stage but nothing got done. It completely ruins this feature.
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
Sometimes it stops, sometimes it skips. It's a frame rate issue with GTA: SA. I reported it in the 0.3e RC stage but nothing got done. It completely ruins this feature.
So, what shall i do with it? I see many servers, there is such feature, but i've never seen this bug there. As an example, United Islands Freeroam. It is very popular, and they use interpolating camera this way too.
Reply
#4

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return SpawnPlayer(playerid);
    TextDrawShowForPlayer(playerid,Text:Box);
    TextDrawShowForPlayer(playerid,Text:Box2);
                if(is1st[playerid]==0)
                {
                InterpolateCameraPos(playerid, 2030.1234,1567.5530,29.6463, 2008.1212,1664.7034,14.2188, 5000, CAMERA_MOVE);
                InterpolateCameraLookAt(playerid, 2028.5165,1553.5148,30.8905, 2005.2192,1669.0897,12.7685, 5000, CAMERA_MOVE);
                is1st[playerid]=1;
                }
             else if(is1st[playerid]==1)
             {
    SetPlayerPos(playerid, 2005.2192,1669.0897,12.7685);
    SetPlayerFacingAngle(playerid, 228.7617);
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
    CreateExplosion(2005.2192,1669.0897,12.7685, 11, 2.0);
           }
    return 1;
}
Reply
#5

Quote:
Originally Posted by James Coral
Посмотреть сообщение
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return SpawnPlayer(playerid);
    TextDrawShowForPlayer(playerid,Text:Box);
    TextDrawShowForPlayer(playerid,Text:Box2);
                if(is1st[playerid]==0)
                {
                InterpolateCameraPos(playerid, 2030.1234,1567.5530,29.6463, 2008.1212,1664.7034,14.2188, 5000, CAMERA_MOVE);
                InterpolateCameraLookAt(playerid, 2028.5165,1553.5148,30.8905, 2005.2192,1669.0897,12.7685, 5000, CAMERA_MOVE);
                is1st[playerid]=1;
                }
             else if(is1st[playerid]==1)
             {
    SetPlayerPos(playerid, 2005.2192,1669.0897,12.7685);
    SetPlayerFacingAngle(playerid, 228.7617);
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
    CreateExplosion(2005.2192,1669.0897,12.7685, 11, 2.0);
           }
    return 1;
}
If i use this, when player will connect, he won't see the character the first time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)