[Plugin] cimulator - collision detection and physics simulation
#61

Is it only me or?
Код:
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(34) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(35) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(36) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(38) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(39) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(40) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(42) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(43) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(44) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(45) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(73) : warning 217: loose indentation
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(101) : error 017: undefined symbol "CR_IsDynamicIdxAvailable"
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(107) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(162) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
These I get when I compile blow up code....

Also here are the line which are causing this errors:
pawn Код:
CR_CreateDynamicCol(0, obj[0], 1221, 1.5, 135.68100, -91.73073, 1.06152,   0.00000, 0.00000, 0.00000);
    CR_CreateDynamicCol(1, obj[1], 1221,1.5, 134.53696, -91.79777, 1.06152,   0.00000, 0.00000, 0.00000);
    CR_CreateDynamicCol(2, obj[2], 1221,1.5, 133.09566, -91.88223, 1.06152,   0.00000, 0.00000, 0.00000);

    CR_CreateDynamicCol(3, obj[3], 1221,1.5, 131.76138, -91.96041, 1.06152,   0.00000, 0.00000, 0.00000);
    CR_CreateDynamicCol(4, obj[4], 1221,1.5, 134.45720, -91.80853, 3.18867,   0.00000, 0.00000, 0.00000);
    CR_CreateDynamicCol(5, obj[5], 1221,1.5, 133.84770, -91.83816, 2.07358,   0.00000, 0.00000, 0.00000);

    CR_CreateDynamicCol(6, obj[6], 1221,1.5, 132.42287, -91.92165, 2.07358,   0.00000, 0.00000, 0.00000);
    CR_CreateDynamicCol(7, obj[7], 1221,1.5, 135.06685, -91.76672, 2.07358,   0.00000, 0.00000, 0.00000);
    CR_CreateDynamicCol(8, obj[8], 1221,1.5, 133.13399, -91.89931, 3.18867,   0.00000, 0.00000, 0.00000);
    CR_CreateDynamicCol(9, obj[9], 1221,1.5, 133.73849, -91.85670, 4.15000,   0.00000, 0.00000, 0.00000);

        if(!CR_IsDynamicIdxAvailable(10))

        CR_CreateDynamicCol(10, bullet, 19342, 1.5, x + 5 * floatsin(-angle, degrees), y + 5 * floatcos(-angle, degrees), z,   0.00000, 0.00000, 0.00000, 1);
        CR_CreateVehicleCol(0, vid, 418, vx, vy, vz, rx, ry, rz, rw);
Reply
#62

Sorry for double posting It went wrong.
Reply
#63

Yes, I haven't edited the blowup.pwn according to the latest release yet. I will, soon.

For now try out this code:

Код:
if (!strcmp("/throw", cmdtext, true)) //throws an object
{
	new index;
	new Float:vx, Float:vy, Float:vz;
        GetPlayerPos(playerid, vx, vy, vz);
 	new Float:facing;
 	GetPlayerFacingAngle(playerid, facing);
 	new ob = CreateDynamicObject(19342, vx + 5 * floatsin(-facing, degrees), vy + 5 * floatcos(-facing, degrees), vz, 0.0, 0.0, 0.0);
	 index = CR_CreateDynamicCol(ob, 19342, 1.7, vx + 1 * floatsin(-facing, degrees), vy + 1 * floatcos(-facing, degrees), vz, 0.0, 0.0, 0.0, 1);
 	CR_ThrowObject(playerid, index, 15.0);
	return 1;
}
Reply
#64

Quote:
Originally Posted by codectile
Посмотреть сообщение
Yes, I haven't edited the blowup.pwn according to the latest release yet. I will, soon.

For now try out this code:

Код:
if (!strcmp("/throw", cmdtext, true)) //throws an object
{
	new index;
	new Float:vx, Float:vy, Float:vz;
        GetPlayerPos(playerid, vx, vy, vz);
 	new Float:facing;
 	GetPlayerFacingAngle(playerid, facing);
 	new ob = CreateDynamicObject(19342, vx + 5 * floatsin(-facing, degrees), vy + 5 * floatcos(-facing, degrees), vz, 0.0, 0.0, 0.0);
	 index = CR_CreateDynamicCol(ob, 19342, 1.7, vx + 1 * floatsin(-facing, degrees), vy + 1 * floatcos(-facing, degrees), vz, 0.0, 0.0, 0.0, 1);
 	CR_ThrowObject(playerid, index, 15.0);
	return 1;
}
I tried but there are tons of warnings:
Код:
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(34) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(35) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(36) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(38) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(39) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(40) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(42) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(43) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(44) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(45) : warning 213: tag mismatch
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(116) : warning 219: local variable "vx" shadows a variable at a preceding level
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(116) : warning 219: local variable "vy" shadows a variable at a preceding level
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(116) : warning 219: local variable "vz" shadows a variable at a preceding level
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(175) : warning 202: number of arguments does not match definition
D:\Server\Server\SA-MP Server\gamemodes\blowup.pwn(330) : warning 203: symbol is never used: "bullet"
Reply
#65

Try it on a new gamemode. Blowup.pwn will cause error as I have not updated it.

Under OnGameModeInit add:
Код:
CR_Load();
CR_SetWorldGravity(0.0, 0.0, -3.5);
CR_EnableSimulation();
Under OnPlayerCommandText add:

Код:
if (!strcmp("/throw", cmdtext, true)) //throws an object
{
	new index;
	new Float:vx, Float:vy, Float:vz;
        GetPlayerPos(playerid, vx, vy, vz);
 	new Float:facing;
 	GetPlayerFacingAngle(playerid, facing);
 	new ob = CreateDynamicObject(19342, vx + 5 * floatsin(-facing, degrees), vy + 5 * floatcos(-facing, degrees), vz, 0.0, 0.0, 0.0);
	 index = CR_CreateDynamicCol(ob, 19342, 1.7, vx + 1 * floatsin(-facing, degrees), vy + 1 * floatcos(-facing, degrees), vz, 0.0, 0.0, 0.0, 1);
 	CR_ThrowObject(playerid, index, 15.0);
	return 1;
}
Reply
#66

Код:
enum MatrixParts
{
	mp_PITCH,
	mp_ROLL,
	mp_YAW,
	mp_POS
};

enum MatrixIndicator
{
	Float:mi_X,
	Float:mi_Y,
	Float:mi_Z
};

stock GetVehicleMatrix(vehicleid,Mat4x3[MatrixParts][MatrixIndicator])
{
//initial processing step - gathering information
	new
		Float:x,
		Float:y,
		Float:z,
		Float:w,
		Float:Pos[3];

	GetVehicleRotationQuat(vehicleid,w,x,y,z);
	GetVehiclePos(vehicleid,Pos[0],Pos[1],Pos[2]);
	new
		Float:x2 = x * x,
	 	Float:y2 = y * y,
	 	Float:z2 = z * z,
	 	Float:xy = x * y,
	 	Float:xz = x * z,
		Float:yz = y * z,
		Float:wx = w * x,
		Float:wy = w * y,
		Float:wz = w * z;
	Mat4x3[mp_PITCH][mi_X] = 1.0 - 2.0 * (y2 + z2);
	Mat4x3[mp_PITCH][mi_Y] = 2.0 * (xy - wz);
	Mat4x3[mp_PITCH][mi_Z] = 2.0 * (xz + wy);
	Mat4x3[mp_ROLL][mi_X] = 2.0 * (xy + wz);
	Mat4x3[mp_ROLL][mi_Y] = 1.0 - 2.0 * (x2 + z2);
	Mat4x3[mp_ROLL][mi_Z] = 2.0 * (yz - wx);
 	Mat4x3[mp_YAW][mi_X] = 2.0 * (xz - wy);
 	Mat4x3[mp_YAW][mi_Y] = 2.0 * (yz + wx);
 	Mat4x3[mp_YAW][mi_Z] = 1.0 - 2.0 * (x2 + y2);
  	Mat4x3[mp_POS][mi_X] = Pos[0];
  	Mat4x3[mp_POS][mi_Y] = Pos[1];
  	Mat4x3[mp_POS][mi_Z] = Pos[2];
  	
	return 1;
}

stock PositionFromVehicleOffset(vehicle,Float:offX,Float:offY,Float:offZ,&Float:x,&Float:y,&Float:z)
{
    new Mat4x3[MatrixParts][MatrixIndicator];
    GetVehicleMatrix(vehicle,Mat4x3);


	x = offX * Mat4x3[mp_PITCH][mi_X] + offY * Mat4x3[mp_ROLL][mi_X] + offZ * Mat4x3[mp_YAW][mi_X] + Mat4x3[mp_POS][mi_X];
	y = offX * Mat4x3[mp_PITCH][mi_Y] + offY * Mat4x3[mp_ROLL][mi_Y] + offZ * Mat4x3[mp_YAW][mi_Y] + Mat4x3[mp_POS][mi_Y];
	z = offX * Mat4x3[mp_PITCH][mi_Z] + offY * Mat4x3[mp_ROLL][mi_Z] + offZ * Mat4x3[mp_YAW][mi_Z] + Mat4x3[mp_POS][mi_Z];

	return 1;
}
use:
Код:
PositionFromVehicleOffset(vehid,0.0, 0.0, 2.0,x, y, z);
CreateObject(343, x, y, z, 0.0, 0.0, 0.0); // creates a point at a height of 2 meters from the car no matter how it is tilted
Reply
#67

Quote:
Originally Posted by VAWYLoN
Посмотреть сообщение
Код:
enum MatrixParts
{
	mp_PITCH,
	mp_ROLL,
	mp_YAW,
	mp_POS
};

enum MatrixIndicator
{
	Float:mi_X,
	Float:mi_Y,
	Float:mi_Z
};

stock GetVehicleMatrix(vehicleid,Mat4x3[MatrixParts][MatrixIndicator])
{
//initial processing step - gathering information
	new
		Float:x,
		Float:y,
		Float:z,
		Float:w,
		Float:Pos[3];

	GetVehicleRotationQuat(vehicleid,w,x,y,z);
	GetVehiclePos(vehicleid,Pos[0],Pos[1],Pos[2]);
	new
		Float:x2 = x * x,
	 	Float:y2 = y * y,
	 	Float:z2 = z * z,
	 	Float:xy = x * y,
	 	Float:xz = x * z,
		Float:yz = y * z,
		Float:wx = w * x,
		Float:wy = w * y,
		Float:wz = w * z;
	Mat4x3[mp_PITCH][mi_X] = 1.0 - 2.0 * (y2 + z2);
	Mat4x3[mp_PITCH][mi_Y] = 2.0 * (xy - wz);
	Mat4x3[mp_PITCH][mi_Z] = 2.0 * (xz + wy);
	Mat4x3[mp_ROLL][mi_X] = 2.0 * (xy + wz);
	Mat4x3[mp_ROLL][mi_Y] = 1.0 - 2.0 * (x2 + z2);
	Mat4x3[mp_ROLL][mi_Z] = 2.0 * (yz - wx);
 	Mat4x3[mp_YAW][mi_X] = 2.0 * (xz - wy);
 	Mat4x3[mp_YAW][mi_Y] = 2.0 * (yz + wx);
 	Mat4x3[mp_YAW][mi_Z] = 1.0 - 2.0 * (x2 + y2);
  	Mat4x3[mp_POS][mi_X] = Pos[0];
  	Mat4x3[mp_POS][mi_Y] = Pos[1];
  	Mat4x3[mp_POS][mi_Z] = Pos[2];
  	
	return 1;
}

stock PositionFromVehicleOffset(vehicle,Float:offX,Float:offY,Float:offZ,&Float:x,&Float:y,&Float:z)
{
    new Mat4x3[MatrixParts][MatrixIndicator];
    GetVehicleMatrix(vehicle,Mat4x3);


	x = offX * Mat4x3[mp_PITCH][mi_X] + offY * Mat4x3[mp_ROLL][mi_X] + offZ * Mat4x3[mp_YAW][mi_X] + Mat4x3[mp_POS][mi_X];
	y = offX * Mat4x3[mp_PITCH][mi_Y] + offY * Mat4x3[mp_ROLL][mi_Y] + offZ * Mat4x3[mp_YAW][mi_Y] + Mat4x3[mp_POS][mi_Y];
	z = offX * Mat4x3[mp_PITCH][mi_Z] + offY * Mat4x3[mp_ROLL][mi_Z] + offZ * Mat4x3[mp_YAW][mi_Z] + Mat4x3[mp_POS][mi_Z];

	return 1;
}
use:
Код:
PositionFromVehicleOffset(vehid,0.0, 0.0, 2.0,x, y, z);
CreateObject(343, x, y, z, 0.0, 0.0, 0.0); // creates a point at a height of 2 meters from the car no matter how it is tilted
Uhh... Why are you posting this here? This code is not even yours, I recognized it at first glance. And why is that relative?
Reply
#68

how to return indicator car checking collision?
Reply
#69

cimulator-1.10 has been released.
Update Notes:

- added support for water collisions.


Thank you for supporting this plugin, I am signing off today from SAMP.
Keep increasing the limit of this community.

-codectile
Reply
#70

Quote:
Originally Posted by codectile
Посмотреть сообщение
cimulator-1.10 has been released.
Update Notes:

- added support for water collisions.


Thank you for supporting this plugin, I am signing off today from SAMP.
Keep increasing the limit of this community.

-codectile
So you're leaving, for good? Or will you be around to support the plugin still? You should still visit every once in a while at the least.
Reply
#71

hello everyone, please you can help me?
I need test this awesome plugin, but why this?
I have read the "readme" and i do all of sptep.

Code:
[14:36:47] Time taken to load the collision map: 1ms
[14:36:47] [debug] Server crashed while executing gm.amx
[14:36:47] [debug] AMX backtrace:
[14:36:47] [debug] #0 native CR_Load () from cimulator.DLL
[14:36:47] [debug] #1 001b7288 in public VFUNC_OnGameModeInit () from gm.amx
[14:36:47] [debug] #2 0004c318 in public Itter_OnGameModeInit () from gm.amx
[14:36:47] [debug] #3 native CallLocalFunction () from samp-server.exe
[14:36:47] [debug] #4 0004b5f0 in public ScriptInit_OnGameModeInit () from gm.amx
[14:36:47] [debug] #5 0004a5d8 in public SSCANF_OnGameModeInit () from gm.amx
[14:36:47] [debug] #6 000401d4 in public ac_OnGameModeInit () from gm.amx
[14:36:47] [debug] #7 000217a4 in public WC_OnGameModeInit () from gm.amx
[14:36:47] [debug] #8 00004b04 in public OnGameModeInit () from gm.amx
[14:36:47] [debug] Native backtrace:
[14:36:47] [debug] #0 7130504c in ?? () from plugins\cimulator.DLL
[14:36:47] [debug] #1 71307f50 in ?? () from plugins\cimulator.DLL
[14:36:47] [debug] #2 004010b6 in ?? () from samp-server.exe
[14:36:47] [debug] #3 711562ca in ?? () from plugins\crashdetect.DLL
[14:36:47] [debug] #4 71158b28 in ?? () from plugins\crashdetect.DLL
[14:36:47] [debug] #5 711509c7 in ?? () from plugins\crashdetect.DLL
[14:36:47] [debug] #6 7115631a in ?? () from plugins\crashdetect.DLL
[14:36:47] [debug] #7 70fa4509 in ?? () from plugins\streamer.DLL
[14:36:47] [debug] #8 004746be in ?? () from samp-server.exe
[14:36:47] [debug] #9 004010b6 in ?? () from samp-server.exe
[14:36:47] [debug] #10 711562ca in ?? () from plugins\crashdetect.DLL
[14:36:47] [debug] #11 71158b28 in ?? () from plugins\crashdetect.DLL
[14:36:47] [debug] #12 711509c7 in ?? () from plugins\crashdetect.DLL
[14:36:47] [debug] #13 7115631a in ?? () from plugins\crashdetect.DLL
[14:36:47] [debug] #14 70fa4509 in ?? () from plugins\streamer.DLL
[14:36:47] [debug] #15 0046f654 in ?? () from samp-server.exe
[14:36:47] [debug] #16 65646f6d in ?? () from samp-server.exe
[14:36:47] [debug] #17 61622f73 in ?? () from samp-server.exe
[14:36:47] [debug] #18 612e6572 in ?? () from samp-server.exe
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)