YouGroove Posted August 9, 2014 Share Posted August 9, 2014 Would it be possible to have in LE3 collision detected only against some collision shape without having physic objects collisions interaction ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
macklebee Posted August 9, 2014 Share Posted August 9, 2014 If I can understand what you are describing, thats what a trigger collision response does. You would probably have to setup your own custom collision type(s) then set the response for your collision types. entity1:SetCollisionType(10) entity2:SetCollisionType(11) Collision:SetResponse(10, 11, 2) --where SetResponse() has three options for the 3rd parameter: 0: no response 1: collide 2: trigger 4: trigger <<--- edited: LE3 changed it to this 2 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
YouGroove Posted August 9, 2014 Author Share Posted August 9, 2014 Thanks. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
YouGroove Posted August 12, 2014 Author Share Posted August 12, 2014 Actually in LE3 Trigger collision is super limited as it can only collide with characters http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/collision-r778 Collision:SetResponse(10, 11, 2) It seems it's C++ only method ? I don't find it for Lua or am i wrong ? With Lua we would need to be able to define trigger volumes , it is usefull in gameplay in many ways could it be danger zone/spells to only specific characters, trigger event areas etc ... Actually this is not possible. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
macklebee Posted August 13, 2014 Share Posted August 13, 2014 Actually in LE3 Trigger collision is super limited as it can only collide with characters Which is why I suggested above for you to create your own custom types and set the responses as needed. There is a difference between a trigger collision TYPE and and a trigger collision RESPONSE. That table is showing the default (inherent) types and their responses built-into the engine. The collision names shown on the top row and left column are the built-in collision TYPES. The cells that use the red/green/yellow text are denoting what RESPONSE happens when the two types come into contact. So like I posted above, the engine only has three available responses for when any two physics objects come into contact: 0: no response 1: collide 2: trigger <--actually appears to be 4 Actually since LE3, it appears that the value for the trigger response is set to 4 since Josh used the same variable name for trigger type and trigger response instead of numbers. So probably the safest way to setup the response is to use the Collison.* variable names so there is no confusion on what to set the values. So if the built-in collision types and their responses do not fit your needs, then you can create your own custom collision types and set the responses you need (or add new responses to existing types). for example: entity1:SetCollisionType(10) --Custom TYPE entity2:SetCollisionType(11) --Custom TYPE Collision:SetResponse(10, 11, 2) Collision:SetResponse(10, 11, Collision.Trigger) List of inherent types: Collision.Prop = 1 Collision.Scene = 2 Collision.Character = 3 Collision.Trigger = 4 Collision.Debris = 5 Collision.Projectile = 6 Collision.LineOfSight = 7 List of possible responses: Collision.None = 0 Collision.Collide = 1 Collision.Trigger = 4 It seems it's C++ only method ? I don't find it for Lua or am i wrong ? Its been available in lua for a couple of weeks now. 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted August 13, 2014 Share Posted August 13, 2014 You really should stick to using the named constants. Technically, the values of these are allowed to change at any time, without breaking the spec. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
YouGroove Posted August 13, 2014 Author Share Posted August 13, 2014 The main issue is in Lua you don't have the function : Collision:SetResponse(a, b, type) Quote Stop toying and make games Link to comment Share on other sites More sharing options...
macklebee Posted August 13, 2014 Share Posted August 13, 2014 The main issue is in Lua you don't have the function : Collision:SetResponse(a, b, type) yes you do. maybe you need to update your project. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
YouGroove Posted August 13, 2014 Author Share Posted August 13, 2014 Ok thanks, i was misunderstood as i didn't seen it on doc "command reference". Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.