YouGroove Posted March 19, 2015 Share Posted March 19, 2015 I would want mobs to have raycast only colliding with : - player -scene - physic objects decoration But have the raycast not colliding with some static barriers. (The mobs will fire at player even when it is hidden behind some specific cover objects) How to code that declaring new collisions ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
macklebee Posted March 20, 2015 Share Posted March 20, 2015 http://www.leadwerks.com/werkspace/topic/11744-defining-new-collision-constantstypes/#entry84834 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...
gamecreator Posted March 20, 2015 Share Posted March 20, 2015 Also, SetCollisionType says it can take an integer between 0 and 99. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted March 20, 2015 Author Share Posted March 20, 2015 It's again info hidden on the forums. It would be good to have some official custom collision tutorial and official documentation page showing use cases Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Olby Posted March 20, 2015 Share Posted March 20, 2015 Remember, you can always add comments to documentation if you feel like something is missing. 1 Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64) Link to comment Share on other sites More sharing options...
macklebee Posted March 20, 2015 Share Posted March 20, 2015 It's again info hidden on the forums. Agree that Collision:SetResponse() needs to be added to the documentation... but you have asked and been given this answer before...http://www.leadwerks.com/werkspace/topic/10362-physics-collision-overlap/page__hl__overlap 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 March 20, 2015 Author Share Posted March 20, 2015 I have some question as this is still not clear for me : - mobs raycast shound not detect a cover object - player raycast should detect cover barrier How does this works in Lua ? Cover.lua function Script:Start() entity:SetCollisionType(30) Collision:SetResponse(30, Collision.Prop, Collision.Trigger) end What must be the mob code and player code to have in one case the raycast not detect that barrier and in the other case the raycast detecting that barrier ? Agree that Collision:SetResponse() needs to be added to the documentation... but you have asked and been given this answer before... When i come back to LE3 i forgot many things, having some solid tutorials and docs is what really matters with 3D engines Quote Stop toying and make games Link to comment Share on other sites More sharing options...
macklebee Posted March 20, 2015 Share Posted March 20, 2015 You can set the collisiontype for any of the raycast commands, so you would setup a response between the player raycast's and the cover's collisiontypes. For the mob's raycast, you have to set the collisiontype to something other than 0 as this will detect everything. 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 March 20, 2015 Author Share Posted March 20, 2015 You mean : Mob.lua : Start() Collision:SetResponse(30, Collision.Prop, Collision.none) ... end player.lua Start() Collision:SetResponse(30, Collision.Prop, Collision.Trigger) ... end coverAsset.lua Start() entity:SetCollisionType(30) -- collision between cover and characters Collision:SetResponse(30, Collision.character, Collision.Trigger) -- collision between cover and physic moving objects Collision:SetResponse(30, Collision.Prop, Collision.Trigger) ... end Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rick Posted March 20, 2015 Share Posted March 20, 2015 It's probably best to set all of these in App.lua Start() so you know where they all are. It's best to write down on paper what responses you want first can it can get complicated quickly. Also note these are global flags. So not sure why you would set 30 and prop to trigger in 2 different places. You only have to do it once and it'll be global response. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted March 20, 2015 Author Share Posted March 20, 2015 I needed the asset cover to be type 30 , a particular type that is a cover. And i need - any physic object to collide with this asset cover - mob raycast should not detect the cover physics - only player raycast detect the cover as a prop asset So what is the Lua Collision:SetResponse() for both mobs and player ? The goal is to have the mobs firing at the player even if he is hidden behind the cover asset. So the player is covered but mobs are still firing at it's position, if the player moves a little outside of the cover it will receive fire damage already. It's some Gears Of War touch 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.