Blockland Welcome, Guest. Please login or register.
Did you miss your activation email?
January 16, 2018, 07:03:19 PM

Home Help Login Register
+  Blockland Forum
|-+  Blockland Forums
| |-+  Modification Help
| | |-+  How do I add collision to a brick?
Pages: [1]
Author Topic: How do I add collision to a brick?  (Read 877 times)
Cowboy Dude

« May 15, 2017, 09:22:43 PM »

So I'm working on a larger version of a wedge brick to reduce brickcount. The brick shows up in-game but has no collision nor can it be hammered. All I have is the model in blender with nothing else, what more would I need?
Logged
Ad Bot

Full members do not see ads

Demian

« May 15, 2017, 10:04:53 PM »

In my BLB Exporter thread there is a link to an example brick that has DTS collision which is required if you want the collision to follow that diagonal bit correctly: https://forum.blockland.us/index.php?topic=304534.msg9322793
Logged
Cowboy Dude

« May 16, 2017, 07:24:49 PM »

Tried my best to follow the example but failed, tell me where I fucked up if you can.
[link is now outdated]
« Last Edit: May 16, 2017, 11:53:13 PM by Cowboy Dude » Logged
Cowboy Dude

« May 16, 2017, 11:55:46 PM »

Double bump but I had no idea what layers were, somewhat of a beginner to blender. Now that I do I tried and did my best to copy the other .blend files as similarly as I could. I still cannot get my brick to have collision. Perhaps I messed up the exporting process or maybe I missed a crucial element.

https://www.dropbox.com/s/aod8e6tra1d4vz0/8x12x5WedgeR.blend?dl=0
Logged
Cowboy Dude

« May 22, 2017, 11:31:41 PM »

Triple bump (sorry) but I can't wrap my head around this and it's really delaying a project I want to work on.
Logged
Tendon

« May 23, 2017, 01:10:33 AM »

1. Get the brick working without collision.
2. Get port's dts exporter
3. Make a collision shape, no surfaces with more than 4 points, convex shape(that means no dents, or outside angles less than 180 degrees)
3a. Blender has a tool for this.  Edit Mode > A(Select all) > delete(edges and faces only) > complete operation
3b. A(again, to select all vertices) > V(or was it ctrl+V, I don't remember) > "Convex shape"(it should make a convex shape and delete unused vertices)
4. Add the collision shape to a group.
5. Name the group "Collision-1"
6. Select ONLY the collision shape.
7. Use port's exporter to export the shape as dts( make sure you check the "selection only" box when exporting)
8. Move the exported .dts to your brick folder.
9. Modify your brick datablock (in server.cs?)  add the field "CollisionShapeName = "folder/folder/folder/folder/shapename.dts";"
10. Profit???

I hope that helps.
Logged
Conan

« May 23, 2017, 09:32:12 AM »

you dont need to do the collision shape as group or deleting surfaces. you do have to make sure the shape fits inside the bounds of the brick or else it will have problems (keep in mind dts shapes are doubled in size ingame). on top of that, if the rotation is wrong you have to restart bl entirely for the any new dts collision to be used.
« Last Edit: May 23, 2017, 09:47:23 AM by Conan » Logged
RallyBlock

« May 24, 2017, 05:12:15 PM »

I've found scaling the shape down 50% before exporting to dts usually is the correct scaling.
Logged
Conan

« May 24, 2017, 05:59:01 PM »

I've found scaling the shape down 50% before exporting to dts usually is the correct scaling.
it is. dts scaling is 50% the size of brick scaling.
Logged
Cowboy Dude

« May 25, 2017, 01:03:43 AM »

1. Get the brick working without collision.
2. Get port's dts exporter
3. Make a collision shape, no surfaces with more than 4 points, convex shape(that means no dents, or outside angles less than 180 degrees)
3a. Blender has a tool for this.  Edit Mode > A(Select all) > delete(edges and faces only) > complete operation
3b. A(again, to select all vertices) > V(or was it ctrl+V, I don't remember) > "Convex shape"(it should make a convex shape and delete unused vertices)
4. Add the collision shape to a group.
5. Name the group "Collision-1"
6. Select ONLY the collision shape.
7. Use port's exporter to export the shape as dts( make sure you check the "selection only" box when exporting)
8. Move the exported .dts to your brick folder.
9. Modify your brick datablock (in server.cs?)  add the field "CollisionShapeName = "folder/folder/folder/folder/shapename.dts";"
10. Profit???

I hope that helps.
It's so simple but I can't do it sorry. It's not working out for me. Absolutely 0 collision.
Logged
Super Suit 12

« May 27, 2017, 07:20:11 PM »

Is it possible to use multiple .dts meshes to get a concave collision mesh? I'm turning the 8x8 grill into a ramp, and the border is flat on either end so that you can actually attach it to stuff. I can't remove that or there's no flat surface to attach it to, but if I don't, it's a concave shape.
Sorry if I'm kind of hijacking the thread, but it's relevant.
Logged
Tendon

« May 27, 2017, 11:10:46 PM »

Yes, but the collision may not work well with vehicles.

Also, from what you're describing I don't think that would be concave.  But I'm not looking at it so maybe you know better. :-[]
Logged
Tendon

« May 27, 2017, 11:44:38 PM »

Well, I fiddled and got a working collision shape.
https://leopard.hosting/download.php?f=eeoch&name=COL8x12x5WedgeR.dts

I also recorded while I did it- so maybe you can figure out what you did wrong?
https://youtu.be/beZm2ZZ1IEE
« Last Edit: May 28, 2017, 12:28:49 AM by Tendon » Logged
Cowboy Dude

« May 28, 2017, 03:54:44 AM »

I also recorded while I did it- so maybe you can figure out what you did wrong?
https://youtu.be/beZm2ZZ1IEE
Yeah so that weird ass shit you saw was me trying to copy an example of Demian's blb file. My mistake there was not knowing there was an add to group thing if you scrolled down that menu, assumed it was that ctrl-j command or something. Your instructions were very clear but again it was one of those things where I'm idiot and the answer becomes very clear when shown.
Logged
Conan

« May 28, 2017, 08:02:24 PM »

Is it possible to use multiple .dts meshes to get a concave collision mesh? I'm turning the 8x8 grill into a ramp, and the border is flat on either end so that you can actually attach it to stuff. I can't remove that or there's no flat surface to attach it to, but if I don't, it's a concave shape.
Sorry if I'm kind of hijacking the thread, but it's relevant.
You can. Use multiple meshes named Collision-100, -101, -102, etc
Logged
Pages: [1]  


Login with username, password and session length

Powered by SMF 1.1.20 | SMF © 2013, Simple Machines
Page created in 0.019 seconds with 19 queries.