Yes, we should look into this issue. I think we need to open up editor scripts a bit more to make them more flexible.
We do in fact include a luajit exe in both bob and in the editor (unpacked when the editor starts). We should maybe look into making these a bit more accessible.
Sorry for the delay, something came up irl
The lua script worked correctly, and the map converted successfully (except for the textures, but I probably know where the problem is)
Tomorrow I’ll experiment a bit more with the extension.
Thank you
The player, and therefore the collision capsule, is 175cm tall, with a 50cm radius. The camera is at a height of 152.5cm with an FOV of 90º.
The speed then should be 1200 cm per second.
These calculations come from various wikis that talk about how Doom works and applying the 32:1 rule, so it really feels like Doom.
And since Quake uses the same units, anything made with Trenchbroom should work.
You can try this demo I made some time ago. I used Sketchup8 as a level editor but the result should be the same as long as you apply the 32:1 conversion.
Well, I installed Windows 10 in VirtualBox on my old mac, so hopefully all the related bugs are fixed. I added a powershell script running for the Windows environment, so now it’s also possible to use the editor extension on Windows.
Added the textureN property to entities to allow set additional material textures 1-7. The next patterns are available:
/path/to/texture.png — a specific texture.
/path/to/prefix_*_suffix.png — a specific path where * is texture0 original name.
/path/to/alternative/* — a specific folder with the same texture file name.
prefix_*_suffix.png — the same folder.
prefix_*_suffix — the same folder and extension.
Script properties overriding
Added override of script properties with #component_id.property. Now you can avoid using the automatically generated properties.script if you just need to set the property value in your own script.
_color to color
Added automatic conversion of property name from _color to color. TrenchBroom only shows the colour picker if the property ends in _color, but in the script we often want name the property just a color.
I guess the answer is yes but, is it posible to import JUST the collisions?
Let’s say I want to make a Resident Evil clone, I make a mansion with Trenchbroom and I just need the collisions because, in-game, only the characters and high quality pre-rendered images will be shown.
When I wrote the post I was thinking about untextured meshes yes, but now I believe it could be impractical because having some sort of “debug” texture would come in handy.
But if you can have two different layers, then that’s great. In Unreal Engine is posible to import collision volumes having the prefix UCX in their names.
Anyway, if you want to tweak something in texture flags for your purposes, you can do it easily here. Including adding custom prefixes for the textures you want to export as collisions.
The idea with prefixes or advanced settings is good, but I just don’t understand where to place it now, since the extension has no any UI other than Defold Editor’s context menu and TrenchBroom’s entities and faces.
Should we add the clip_ prefix for textures that we don’t want to export as meshes? May be it’s a good idea?
Not sure if this is the right place to ask, but using my own Trenchbroom map is causing my game to crash.
I made a simple map file (literally just a box) in Trenchbroom and loaded it into Defold using the instructions on the extension’s GitHub page, but when I build the game I get this error:
Assertion failed: (edge.LengthSquared() > 1.19209290e-7F * 1.19209290e-7F), function Set, file b2PolygonShape.cpp, line 146.
INFO:CRASH: Successfully wrote Crashdump to file: /Users/mak/Library/Application Support/Defold/_crash
ERROR:CRASH: CALL STACK:
# 0 pc 0x281a54 dmengine _ZN7dmCrashL7HandlerEiP9__siginfoPv+36
# 1 pc 0x80c1d libc++abi.dylib _sigtramp+29
# 2 pc 0x1e30f libc++abi.dylib __pthread_kill+11
# 3 pc 0x55f7b libc++abi.dylib pthread_kill+263
# 4 pc 0x1e7ca5 libxpc.dylib abort+123
# 5 pc 0x1e6fbe libxpc.dylib err+0
# 6 pc 0x2d6893 dmengine _ZN14b2PolygonShape3SetEPK6b2Vec2i.cold.2+35
# 7 pc 0xe32c9 dmengine _ZN14b2PolygonShape3SetEPK6b2Vec2i+505
# 8 pc 0x82166 dmengine _ZN9dmPhysics17NewPolygonShape2DEPNS_9Context2DEPKfj+358
# 9 pc 0x671aa dmengine _ZN12dmGameSystem16AcquireResourcesEPNS_14PhysicsContextEPN10dmResource16SResourceFactoryEPKvjPNS_23CollisionObjectResourceEPKc+1690
#10 pc 0x674f6 dmengine _ZN12dmGameSystem24ResCollisionObjectCreateERKN10dmResource20ResourceCreateParamsE+118
#11 pc 0x35e50 dmengine _ZN10dmResource3GetEPNS_16SResourceFactoryEPKcPPv+2064
#12 pc 0x2b148 dmengine _ZN12dmGameObjectL16AcquireResourcesEPN10dmResource16SResourceFactoryEPNS_8RegisterEPN15dmGameObjectDDF13PrototypeDescEPNS_9PrototypeEPKc+328
#13 pc 0x2ad6b dmengine _ZN12dmGameObjectL19ResGameObjectCreateERKN10dmResource20ResourceCreateParamsE+91
#14 pc 0x35e50 dmengine _ZN10dmResource3GetEPNS_16SResourceFactoryEPKcPPv+2064
#15 pc 0x2a4b7 dmengine _ZN12dmGameObjectL16AcquireResourcesEPKcPN10dmResource16SResourceFactoryEPNS_8RegisterEPN15dmGameObjectDDF14CollectionDescES1_PPNS_16CollectionHandleE+391
#16 pc 0x2a080 dmengine _ZN12dmGameObjectL19ResCollectionCreateERKN10dmResource20ResourceCreateParamsE+48
#17 pc 0x35e50 dmengine _ZN10dmResource3GetEPNS_16SResourceFactoryEPKcPPv+2064
#18 pc 0x7b4d dmengine _ZN8dmEngine4InitEPNS_6EngineEiPPc+9197
#19 pc 0x8b5a dmengine _Z14dmEngineCreateiPPc+170
#20 pc 0x96ef dmengine _ZN8dmEngine7RunLoopEPKNS_13RunLoopParamsE+95
#21 pc 0x9662 dmengine _Z11engine_mainiPPc+98
It sounds like something is going wrong when Defold tries to load the .convexshape file?
I’m on macOS with Defold version 1.4.1, and Trenchbroom extension version 1.5.
I tried your map data, everything looks fine. Maybe the size is too big, it’s a 500+ m floor platform… Perhaps you would like to adjust the textel_size parameter to get the correct scale. But I’m not sure that this is a reason of the crash.
Please, attach the reproducing project here to understand what’s going wrong.
I don’t have that version anymore, but it was basically an empty project.
The “default box” I’m referring to is the first object that you see in Trenchbroom after making a new Defold map. I think it’s called a brush in Trenchbroom.
My broken map was just an empty project with a slightly modified “default box”, I changed its position and length/width.