SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 19/08/2015, 01:40 AM   #1
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,843
Reputation: 560
Default ColAndreas - Collision Detection

__________________________________________________ __________________________________________________

Developers:

Initial Developers:
[uL]Slice
[uL]Chris420
[uL]Pottus
Latest Developers:
uint32 (new developer ?) (Where'd ya go?) - This guy fixed some major shit, including the initial SA-MP object thing.
Crayder
Codectile
__________________________________________________ __________________________________________________

Download today!
__________________________________________________ __________________________________________________

Installation Instructions:
  1. Navigate to the github repository's release section (link above) and download the latest version.
  2. If you don't need the source just download the wizard, the plugin, and include.
  3. Run the binary builder application. This will generate a binary in which ColAndreas load data from.
  4. Create a folder in your scriptfiles called "colandreas" and place the binary file there.
  5. Add ColAndreas to your server.cfg.
__________________________________________________ __________________________________________________

Current Functions:
Code:
CA_ContactTest(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
CA_CreateDynamicObject_DC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, vw = -1, interior = -1, playerid = -1, Float:streamdist = 300.0, Float:drawdist = 300.0)
CA_CreateDynamicObject_SC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, vw = -1, interior = -1, playerid = -1, Float:streamdist = 300.0, Float:drawdist = 300.0)
CA_CreateDynamicObjectEx_DC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 0.0, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players)
CA_CreateDynamicObjectEx_SC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 0.0, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players)
CA_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, bool:add = false)
CA_CreateObject_DC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 300.0)
CA_CreateObject_SC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 300.0)
CA_DestroyAllObjects_DC()
CA_DestroyObject(index)
CA_DestroyObject_DC(index)
CA_EulerToQuat(Float:rx, Float:ry, Float:rz, &Float:x, &Float:y, &Float:z, &Float:w)
CA_FindZ_For2DCoord(Float:x, Float:y, &Float:z)
CA_GetModelBoundingBox(modelid, &Float:minx, &Float:miny, &Float:minz, &Float:maxx, &Float:maxy, &Float:maxz)
CA_GetModelBoundingSphere(modelid, &Float:offx, &Float:offy, &Float:offz, &Float:radius)
CA_GetObjectExtraID(index, type)
CA_Init()
CA_IsPlayerBlocked(playerid, Float:dist=1.5, Float:height=0.5)
CA_IsPlayerInWater(playerid, &Float:depth, &Float:playerdepth)
CA_IsPlayerNearWater(playerid, Float:dist=3.0, Float:height=3.0)
CA_IsPlayerOnSurface(playerid, Float:tolerance=1.5)
CA_QuatToEuler(Float:x, Float:y, Float:z, Float:w, &Float:rx, &Float:ry, &Float:rz)
CA_RayCastLine(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z)
CA_RayCastLineAngle(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz)
CA_RayCastLineAngleEx(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz, &Float:ocx, &Float:ocy, &Float:ocz, &Float:orx, &Float:ory, &Float:orz)
CA_RayCastLineExtraID(type, Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z)
CA_RayCastLineEx(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz, &Float:rw, &Float:cx, &Float:cy, &Float:cz)
CA_RayCastLineID(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z)
CA_RayCastLineNormal(Float:startx, Float:starty, Float:startz, Float:endx, Float:endy, Float:endz, &Float:x, &Float:y, &Float:z, &Float:nx, &Float:ny, &Float:nz)
CA_RayCastMultiLine(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, Float:retx[], Float:rety[], Float:retz[], Float:retdist[], ModelIDs[], size = sizeof(retx))
CA_RayCastReflectionVector(Float:startx, Float:starty, Float:startz, Float:endx, Float:endy, Float:endz, &Float:x, &Float:y, &Float:z, &Float:nx, &Float:ny, &Float:nz)
CA_RemoveBarriers()
CA_RemoveBreakableBuildings()
CA_RemoveBuilding(modelid, Float:x, Float:y, Float:z, Float:radius)
CA_SetObjectExtraID(index, type, data)
CA_SetObjectPos(index, Float:x, Float:y, Float:z)
CA_SetObjectPos_DC(index, Float:x, Float:y, Float:z)
CA_SetObjectRot(index, Float:rx, Float:ry, Float:rz)
CA_SetObjectRot_DC(index, Float:rx, Float:ry, Float:rz)
Float:CA_GetRoomHeight(Float:x, Float:y, Float:z)
__________________________________________________ __________________________________________________

Loading ColAndreas:

I recommend using a filterscript to help organize your objects. There is a specific order of operations required to load successfully.

Code:
public OnFilterScriptInit()
{
	// Add any remove buildings (This only works once)
	CA_RemoveBuilding();
	
	// Initialize the collision world (This creates San Andreas, the entire map, excluding removed buildings)
	CA_Init();
	
	// Create objects
	CA_CreateDynamicObject_SC();

	return 1;
}
__________________________________________________ __________________________________________________

Capability Demo:
[ame]http://www.youtube.com/watch?v=aSabQWqQBkI[/ame]
__________________________________________________ __________________________________________________

Known Issues:
  • There is no virtual world / interior support (there may never be).
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!

Last edited by Crayder; 07/03/2017 at 05:36 PM.
Crayder is offline   Reply With Quote
Old 19/08/2015, 01:54 AM   #2
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,419
Reputation: 403
Default Re: ColAndreas - Collision Detection

good luck crayder
Abagail is offline   Reply With Quote
Old 19/08/2015, 02:03 AM   #3
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,843
Reputation: 560
Default Re: ColAndreas - Collision Detection

Quote:
Originally Posted by Abagail View Post
good luck crayder
Still just maintaining the thread, so not much luck needed!
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 19/08/2015, 07:48 PM   #4
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,278
Reputation: 1141
Default Re: ColAndreas - Collision Detection

Make sure you add uint32 as a developer his updates have been absolutely invaluable in terms of fixing bugs and polishing this plugin.
Pottus is offline   Reply With Quote
Old 19/08/2015, 08:32 PM   #5
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,843
Reputation: 560
Default Re: ColAndreas - Collision Detection

Quote:
Originally Posted by Pottus View Post
Make sure you add uint32 as a developer his updates have been absolutely invaluable in terms of fixing bugs and polishing this plugin.
Done, and I did some formatting. I'll add the function list now, tell me if anything else should be noted.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 19/08/2015, 08:54 PM   #6
Mauzen
Godfather
 
Mauzen's Avatar
 
Join Date: Jun 2007
Location: Western Germany
Posts: 5,097
Reputation: 1522
Default Re: ColAndreas - Collision Detection

Id suggest adding a link to the old thread. Contains tons of information, and once it was pushed from the first page in this section it will practically be lost for new users.
Mauzen is offline   Reply With Quote
Old 19/08/2015, 09:26 PM   #7
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,843
Reputation: 560
Default Re: ColAndreas - Collision Detection

Quote:
Originally Posted by Mauzen View Post
Id suggest adding a link to the old thread. Contains tons of information, and once it was pushed from the first page in this section it will practically be lost for new users.
The thread will be deleted, I'll go through the replies for some stuff real quick. Tell me what you think should be here.

EDIT: I'm through the first 8 pages, but haven't found much other than my spam (I'm ashamed now that I see it) and bugs that have been fixed.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 19/08/2015, 10:04 PM   #8
Neutralneu
Big Clucker
 
Join Date: Oct 2012
Location: Russia
Posts: 192
Reputation: 37
Default Re: ColAndreas - Collision Detection

Big thanks for you and your team, you, guys, did really great job, I appreciate that
__________________
Nightfall AI Laboratory 185.12.95.47:7777
Neutralneu is offline   Reply With Quote
Old 20/08/2015, 01:47 AM   #9
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,278
Reputation: 1141
Default Re: ColAndreas - Collision Detection

One more thing I suggest separating native functions from include functions.
Pottus is offline   Reply With Quote
Old 20/08/2015, 02:19 AM   #10
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,843
Reputation: 560
Default Re: ColAndreas - Collision Detection

Quote:
Originally Posted by Pottus View Post
One more thing I suggest separating native functions from include functions.
Yea I will do that, I just posted it all together for the time being because I was busy. I'm going to categorize and document them later.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] ColAndreas - (Released) Pottus Plugin Development 415 19/08/2015 12:31 AM
No veh collision vs vehicles with collision issue Kar 0.3.7 RC Scripting 5 10/05/2015 11:08 PM
ColAndreas Pottus Screenshots and Videos 73 17/12/2014 08:32 PM
Collision Detection (Plugin) Deduction Scripting Help 0 27/12/2013 04:24 AM
Collision Detection? NumbSkull Scripting Help 4 13/11/2012 03:27 AM


All times are GMT. The time now is 11:36 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.