thehankinator Posted July 23, 2018 Share Posted July 23, 2018 Does anyone have the collision type table? It doesn't exist in the documentation anymore. Or has something changed in resolving collisions? https://www.leadwerks.com/learn?page=API-Reference_Object_Collision Quote Link to comment Share on other sites More sharing options...
gamecreator Posted July 23, 2018 Share Posted July 23, 2018 Quick forum search found it: https://www.leadwerks.com/community/topic/14500-does-world-pick-ignore-collisiontype/?tab=comments#comment-108277 Quote Link to comment Share on other sites More sharing options...
thehankinator Posted July 23, 2018 Author Share Posted July 23, 2018 Thanks! Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 24, 2018 Share Posted July 24, 2018 Just for giggles... local window = Window:Create("Collision Type Response",0,0,400,300,Window.Titlebar+Window.Center) local context = Context:Create(window) local gui = GUI:Create(context) local base = gui:GetBase() base:SetScript("Scripts/GUI/Panel.lua") function AddingItems(widget,table) for n=1,#table do widget:AddItem(table[n], n==1) end end types = {"PROP","SCENE","CHARACTER","TRIGGER","DEBRIS","PROJECTILE","LINEOFSIGHT"} response = {{1,1,1,4,1,1,0},{1,1,1,0,0,1,1},{1,1,1,4,0,1,0},{4,0,4,0,0,0,0}, {1,0,0,0,0,0,0},{1,1,1,0,0,0,0},{0,1,0,0,0,0,0}} choicebox1 = Widget:ChoiceBox(20,120,170,60,base) choicebox2 = Widget:ChoiceBox(190,60,170,60,base) answer = Widget:Label("COLLIDE",190,120,170,60,base) answer:SetString("align","Center") answer:SetString("valign","Center") answer:SetBool("border",true) AddingItems(choicebox1,types) AddingItems(choicebox2,types) while not window:KeyHit(Key.Escape) do if window:Closed() then return false end while EventQueue:Peek() do local event = EventQueue:Wait() if event.source == choicebox1 or event.source == choicebox2 then local answervalue = response[choicebox1:GetSelectedItem()+1][choicebox2:GetSelectedItem()+1] if answervalue == 0 then answer:SetText("NONE") end if answervalue == 1 then answer:SetText("COLLIDE") end if answervalue == 4 then answer:SetText("TRIGGER") end end end context:Sync() end I never realized before writing this up that you have no way of getting the current response set for the collision types... for the life of me, I could have sworn it was possible - but no. If there was a Collision:GetResponse(type,type) to go with the undocumented Collision:SetResponse(type,type,response), this little example program would be more accurate/trustworthy. As it stands right now, you have to trust that the table that its based upon is correct and will never change. 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...
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.