SA-MP Forums Archive
[Include] [alpha] Objects Physics - Handle objects collisions and more. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [alpha] Objects Physics - Handle objects collisions and more. (/showthread.php?tid=446286)

Pages: 1 2 3 4


Respuesta: [alpha] Objects Physics - Handle objects collisions and more. - Malganys - 06.02.2014

No more updates?


Re: [alpha] Objects Physics - Handle objects collisions and more. - Banditukas - 23.12.2014

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


Re: [alpha] Objects Physics - Handle objects collisions and more. - $$inSane - 24.12.2014

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


Re: [alpha] Objects Physics - Handle objects collisions and more. - newbie scripter - 01.02.2015

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


Re: [alpha] Objects Physics - Handle objects collisions and more. - newbie scripter - 04.02.2015

bump.


Re: [alpha] Objects Physics - Handle objects collisions and more. - Crayder - 04.02.2015

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


Re: [alpha] Objects Physics - Handle objects collisions and more. - newbie scripter - 30.03.2015

SetObjectVelocity doesnt work for me .-.


Re: [alpha] Objects Physics - Handle objects collisions and more. - Crayder - 30.03.2015

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


Re: [alpha] Objects Physics - Handle objects collisions and more. - newbie scripter - 31.03.2015

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.


Re: [alpha] Objects Physics - Handle objects collisions and more. - newbie scripter - 02.04.2015

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


Re: [alpha] Objects Physics - Handle objects collisions and more. - PeppeAC - 02.04.2015

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


Re: [alpha] Objects Physics - Handle objects collisions and more. - PeppeAC - 06.07.2015

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


Re: [alpha] Objects Physics - Handle objects collisions and more. - Battlezone - 12.08.2015

Great updates, waiting for more incoming ones


Respuesta: [alpha] Objects Physics - Handle objects collisions and more. - Malganys - 13.08.2015

Great! I need this.


Re: [alpha] Objects Physics - Handle objects collisions and more. - Stanford - 22.12.2015

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


Re: [alpha] Objects Physics - Handle objects collisions and more. - Pottus - 22.12.2015

Streamer objects update too slowly to be viable.


Re: [alpha] Objects Physics - Handle objects collisions and more. - Stanford - 23.12.2015

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;
}



Re: [alpha] Objects Physics - Handle objects collisions and more. - Stanford - 24.12.2015

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


Re: [alpha] Objects Physics - Handle objects collisions and more. - Stanford - 19.01.2016

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!


Re: [alpha] Objects Physics - Handle objects collisions and more. - Crayder - 19.01.2016

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!