Import 3D floors/slpes as 3D models (Actors)

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.

Import 3D floors/slpes as 3D models (Actors)

Postby zdusr » Mon Sep 20, 2021 3:43 pm

Hi!

Since I struggled to find short and easy tutorial on how to import 3D models as actors into gzdoom I decided to write one myself.

In Ultimate Doom Builder you can export 3D floors as 3D models. This means that you can also import these 3D models as actors. This means that you can place them as things which is convenient. This also means that you can now have transparent slopes in gzdoom because while slopes cannot be transparent due to gzdoom engine limitations, 3D models from the other can however keep in mind that they dont clip actors movement like real 3D floors do unless you fill them with invisible 3D floors (texture missing from all sides/floor/ceiling). In this tutorial I already assume that you know basics about gzdoom.

Steps:
1) Create 3D floor



2) Draw sector around it and select your 3D floor together with surrounding sector.


3) File > Export > Selection to Wavefront .obj...
3.1) Give your actor name. In this tutorial I name it MyActor.
3.2) Under skip textures add all textures that you do not want to be part of your model. By default UDB includes floor and ceiling textures from containing sector with your model. However you may not desire this.


4) In root directory of your pk3 create file zscript.txt and add the following code:
Code: Select allExpand view
#include "zscript/MyActor.zs"


5) In root directory of your pk3 create file mapinfo.txt and add the following code:
Code: Select allExpand view
DoomEdNums
{
15000 = MyActor
}

15000 is just random number, it can be anything, it just has to be something because UDB needs it.

So your directory structure should look like this:


6) Edit > Map Options
6.1) Add directory where your object is as resource
6.2) Add gzdoom.pk3 as resource


7) Now place the model as thing (note that you can now play around with roll, pitch and angle.):


8) [optional] mark actor as translucent to get your magical translucent 3D Floor/slope. (NB! Current version of UDB may render it incorrectly if it is translucent so check it in game to see how it looks)


9) [optional] add invisible 3D floor/slope to make this model appear as solid:
This 3D floor is not rendered in game but you can still stand on it. Alternative would be to mark actor as solid but gzdoom engine is limited to square shape boundingbox. With 3D floors/slopes you can follow your model exact if you wish although it would be only useful for translucent slopes.
zdusr
 
Joined: 19 Mar 2021

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests