[Include] [alpha] Objects Physics - Handle objects collisions and more.
#41

No more updates?
Reply
#42

How to make object moving in 3D and he move that like you hit ball growing up and then down.
Reply
#43

Thanks for sharing the include, all i would do is, make a SNOWBALL gamemode(any soon)!!!
Reply
#44

i got a problem, when i include this in my GM, i get loose indentation warning but when i use it in his example GM, i don't get that problem. any ideas to fix it? and also in my GM, it doesn't work on objects which are already in samp, i mean it doesn't collide with any object
Reply
#45

bump.
Reply
#46

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
bump.
It's an indentation warning. It doesn't affect the script. All you gotta do is use proper indentation. That's on your side, not ours. The include has no indentation problems for me.

Also, lmgtfy you lazy shit: http://*******/1yJoHzE
Reply
#47

SetObjectVelocity doesnt work for me .-.
Reply
#48

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
SetObjectVelocity doesnt work for me .-.
Did you use the init function first?
Reply
#49

Yes, i've made init first and here is the code
pawn Код:
PHY_InitObject(A1, 342);
                                PHY_SetObjectWorld(A1, 0);
                PHY_RollObject(A1);
                PHY_SetObjectVelocity(A1, vx, vy, vz);
                PHY_SetObjectGravity(A1, GRAVITY);
                PHY_SetObjectFriction(A1, 7);
                PHY_SetObjectAirResistance(A1, 0.1);
                PHY_ToggleObjectPlayerColls(A1, 1, 0.6);
                                PHY_GetObjectVelocity(A1, vx, vy, vz);
i use a timer to explode and i made 2 checks. 1 after initiating and 1 in timer. the value of vx, vy and vz is a'right after i init but in timer, its 0,0,0.

EDIT: i used acceleration but it didnt work.
Reply
#50

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
Yes, i've made init first and here is the code
pawn Код:
PHY_InitObject(A1, 342);
                                PHY_SetObjectWorld(A1, 0);
                PHY_RollObject(A1);
                PHY_SetObjectVelocity(A1, vx, vy, vz);
                PHY_SetObjectGravity(A1, GRAVITY);
                PHY_SetObjectFriction(A1, 7);
                PHY_SetObjectAirResistance(A1, 0.1);
                PHY_ToggleObjectPlayerColls(A1, 1, 0.6);
                                PHY_GetObjectVelocity(A1, vx, vy, vz);
i use a timer to explode and i made 2 checks. 1 after initiating and 1 in timer. the value of vx, vy and vz is a'right after i init but in timer, its 0,0,0.

EDIT: i used acceleration but it didnt work.
someone halp me plz
Reply
#51

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
someone halp me plz
Trying doing one of these things, to see what causes the problem.
1 Remove SetObjectFriction
2 Remove SetObjectAirRestistance
3 Remove TogglePlayerColls
Reply
#52

I noticed that last version didn't compile, so I fixed and also updated foreach syntax.
Reply
#53

Great updates, waiting for more incoming ones
Reply
#54

Great! I need this.
Reply
#55

Just realized that we can change & edit to make it support streamer.
Reply
#56

Streamer objects update too slowly to be viable.
Reply
#57

Alright it looks like "PHY_OnObjectCollideWithSAWorld" same for "ColideWithPlayer" doesn't work properly..
I even used them on the ball example you provided
pawn Код:
public PHY_OnObjectCollideWithSAWorld(objectid, Float:cx, Float:cy, Float:cz) {
    if(objectid == dropid || objectid == drop2) {
        SendClientMessageToAll(-1, "Reached the ground");
        PHY_DeleteObject(dropid);
    }
    return true;
}
public PHY_OnObjectCollideWithPlayer(objectid, playerid) {
    if(objectid == dropid || objectid == drop2) {
        SendClientMessageToAll(-1, "Reached the ground");
        PHY_DeleteObject(dropid);
    }
    return true;
}
pawn Код:
new drop2;
CMD:ball(playerid, params[])
{
    new Float:x, Float:y, Float:z, Float:ang, Float:vz, Float:mass;
    sscanf(params, "F(0.0)F(1.0)", vz, mass);
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, ang);
    new a = CreateObject(1598, x, y, z-0.69, 0, 0, 0);
    drop2 = a;
    PHY_InitObject(a, 1598, mass, _, PHY_MODE_3D);
    PHY_SetObjectVelocity(a, 6.0 * floatsin(-ang, degrees), 6.0 * floatcos(-ang, degrees), vz);
    PHY_RollObject(a);
    PHY_SetObjectFriction(a, 0.25);
    PHY_SetObjectAirResistance(a, 0.1);
    PHY_SetObjectGravity(a, 7.1);
    PHY_SetObjectZBound(a, _, _, 0.5);
    PHY_UseColAndreas(a);
    PHY_ToggleObjectPlayerColls(playerid);
    return 1;
}
Reply
#58

I hope that you guys are going to look at my reply ^^
Reply
#59

Hey gta191977649!, we really appreciate what you have done, however, can you check out my previous reply about the colliding with SAWorld callback? - I think it has something to do with the compatibility with the latest version of ColAndreas and this include.

Thanks!
Reply
#60

Quote:
Originally Posted by Stanford
Посмотреть сообщение
Hey gta191977649!, we really appreciate what you have done, however, can you check out my previous reply about the colliding with SAWorld callback? - I think it has something to do with the compatibility with the latest version of ColAndreas and this include.

Thanks!
ColAndreas's compatibility is not the problem... And the callback works perfectly fine for me, I'm using it right now with my cannons!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)