Add On Room Tutorial
Add On Room Tutorial
By: johnnyutah
Introduction
Hello, this tutorial will be covering the basics of how to create an add-on room.
The actual instructions will be step-by-step along with images to make them easy
to understand. Everyone has different levels of understanding when it comes to
the game and Blender. As a result, this tutorial is not meant to be extremely
technical. You do not need to have any scripting knowledge at all to understand
this tutorial. However the tutorial does assume the reader has setup the blender
tk17 script and is “ready to go” as far as the tools are concerned.
The tutorial will give a brief overview of the folder structure, the important (.bsb) files to edit, some basic
blender functions, followed by step-by-step instructions for everything.
I really recommend you read the tutorial in order (or at least skim through the sections you think you know
100% about) because later on I will be referencing materials covered in previous sections.
In the end I’ve included a Frequently Asked Questions (F.A.Q.) section of some potential issues the reader
might encounter and potential solutions.
Blender 2.64
TK17 blender script
(.bsb) decode/encode tool
(.txx) decode/encode tool
A sample room has been provided along with this tutorial and the specific instructions will be based on it.
However the general idea can be applied to any other room.
Note 1: This tutorial will reference text and files that has “###”, this is only a placeholder, you need replace it
with a room ID number that is not taken in order for the room to work. (example: Room### Room201).
You can easily do this by re-naming the folder, or file itself.
For the text inside the .bs files, press CTRL+H to find + replace, enter ### and replace it with a room ID.
Note 2: If you already have your own room in mind, you are welcome to use that instead, just make sure you
can get it into a format that Blender can import. Google your file extension + blender import if it isn’t in the
blender default import options.
Folder Structure Overview
In the tutorial package, you should have a folder called “Custom.03.R9ZRoom###” and inside should be three
folders titled: Images, Scenes, and Scripts.
Images – Contains your textures
Scenes – Contains your 3D Mesh data as well as position data
Scripts – Contains various information such as the room ID, description, as well as position reference
Please read the below sections for a more detailed explanation of the files that go in these folders.
Images Folder
This folder contains all the texture for the room including the icons.
\Images\Q=Tex032M\Luder\GUI\ R9ZRoom###_Icon.png is the texture of the icon of the room
\Images\Q=Tex032M\Luder\Room\R9ZRoom###\ R9ZRoom###_Object001.png are the textures for the
various meshes of the room.
The image sizes in pixels must be the following:
128x128
256x256
512x512
1024x1024
2048x2048
4096x4096
Or any combination (ex: 512x1024). The icon is 128x128, you could make it bigger but that is not necessary
since it is just an icon. Make sure the images are in the .png format.
Scenes Folder
This folder contains your actual 3D Mesh file.
\Custom.03.R9ZRoom###\Scenes\Luder\Room\R9ZRoom###\ R9ZRoom###.bs
Right click it and open it with wordpad. You should get something similar to the figure 1 below:
Figure 1
Scroll down and you should see “blocks” for different objects, they are the shader, texture, vertex, normal,
and uv data of the various objects. Note that anything with a “//” in front is not read by the game. If you scroll
near the end you should see position data as well. I will explain more in detail what you need to do with this
file later on in the step-by-step instructions.
Scripts Folder
There are quite a few things in this folder I’ll just briefly explain the important ones.
In Luder\Common
\Scripts\Luder\Common\ R9ZRoom###.bs contains room ID, Icon and other settings.
The only thing you really need to change is the ### to the room ID of your choice.
In Luder\Room###
\Scripts\Luder\Room###\ . . . . .
There are a lot of files in here, however only three needs to be edited:
AcRoom.bs Position and lighting related
AvFurnitures.bs Position (sex-type) related
AvFurnitures.L=EN.bs Position name and description
Step-by-step instructions
Step 1: Import the Body for reference
Open Blender 2.64, first, using the Tk17 addon script import body01 or body02 into blender. Once you do,
press “A” to select all. Now “Shift + Left Click” the body_subdiv_cage (this unselected the body) with
everything except the body selected, press “X” and delete.
What should have happened is you should now only have a female or male body in your blender 3D view
(figure 2). The reason you want to do this is so once we import the room we can use the body as a reference
to how big the scale of the room needs to be.
Figure 2
Before we move on, I want to bring your attention to the Object Mode and Viewport Shading options near
the bottom of blender. Object Mode can be toggled to Edit Mode via “TAB” button on your keyboard. You can
only make edits in Edit Mode and import / export in Object Mode. Viewport Shading give the objects in your
viewport different shading. Try clicking them and see what each of them does.
Wireframe for example is very useful as it lets you basically see through everything. You can press “Z” to
toggle between solid and wireframe shading.
Figure 3
Step 2: Import the room
Next, go to File>Import>wavefront(.obj) and navigate to the simple bedroom folder and import the
simplebedroom.obj into blender.
Now save your file. Save it as something that makes sense to you and in a place you can easily search for later.
I like to give it a name that easily identifies what the file is (ex: simple bedroom) and then save it in the same
location as all the textures and other stuff (ex: simple bedroom folder)
Figure 8
When you are comfortable, click image>save as and save it in the
\Custom.03.R9ZRoom###\Images\Q=Tex032M\Luder\Room\R9ZRoom###
Save it as R9ZRoom###_Object001.png Make sure you choose the .png option. Blender has a built in texture
converter so that is nice. (See figure 9)
NOTE: Replace ### with a correct ID. Example: R9ZRoom123_Object001.png
Now repeat what we just did with the other objects. In your images folder you should have:
R9ZRoom###_Object001.png
R9ZRoom###_Object002.png
R9ZRoom###_Object003.png
….etc
You can also move the cursor to translate (move in the x, y, or z direction) certain objects if you need to.
Figure 10 are the common ones you use.
Remember, in the Viewport Shading, wireframe helps you see the objects visually. Once you are satisfied with
the scale and location, save your file. Then save your file again. as a new file name except with a 2 or _test at
the end. (example: simple bedroom.blend and simple bedroom2.blend).
Figure 17: delete the tool’s mesh so only the room mesh remain
10. With tool_mesh selected, (in object mode) generate with the following options in the export menu:
Figure 18: Export
Okay, you should now have a new window open with a tool09.mod00.bs file available. Click it and open it with
a wordpad.
Figure 19
You should see a bunch of stuff, scroll down till you see SPolygonGeometry
First, you can ignore everything else that is not inside the greenbox. I don’t really want to get too technical
here but the green block contains your vertex, normal, and UV data. Please note the small red boxes.
Figure 20
You should still have your room###.bs file open, position the tool09.bs file and the room###.bs file so they are
side by side like figure 21:
Figure 21
You want to change the red, blue, yellow boxes with the values of the Room###.bs file. This means changing:
Once you have done the following, highlight the green box starting from “SPolygonGeometry” to “};” in
tool09.bs copy and paste it in the room###.bs side. Your final result should look like figure 22 below:
Figure 22
What you have just done is you have copy and pasted z01’s mesh, normal, and uv data into the room file.
After you have done this step, you can close the left wordpad (tool09bs) file. Go back into blender, delete
tool_mesh.
Step 8: Texture Normal Altering
A mesh’s normal is the direction in-game that you will visibly see the texture. You usually do not need to worry
about this, however in certain circumstances, it is better to have the textures only on one side of the mesh
(example walls) so you can see through the wall from the outside, but still see the wall texture from the inside.
So how can you tell which side the textures are facing? In Blender click z02, go into edit mode and under mesh
display click the face normal button as shown in figure 23 below:
The direction that the lines are sticking into are the direction you can see the texture. In this case, in-game
z02’s texture can only be seen when viewed from the inside, and invisible when viewed from the outside.
This can be adjusted in the room###.bs file, if you look under object 002, you should see the lines
RenderShader.MultiDrawLayer I32(37);
RenderShader.CullEnable False;
These two lines causes the game to draw the texture of the object in-game on both sides regardless of the
way the normal is facing. If you do not want this feature, simply highlight these two lines and delete them. On
the other hand, if you want this feature, you just need to copy and paste them in the “RenderShader” block as
shown in Figure 23 below.
Figure 24: Texture Normal and MultiDraw
Generally, walls do not need this feature as they obstruct the player’s view if you can see it from both sides of
the mesh. However in the end you will need to make your own choice whether or not you want this feature or
not for every single object.
Now that we have a basic understanding of texture normal, you need to repeat Step 7: Converting the 3D
mesh for the other objects. Remember to change your local_##, and Object.Name so it corresponds to the
correct object.
I will try to describe what the data in the colored boxes mean below without getting too technical and
confusing.
Blue = Name of the position defined in the room file. In this case, it is called “floor01” this will be referenced in
the script files.
Green = The X,Y,Z translation and rotation of the location. Think of this particular data block as the “master” or
“parent” location. This means that Position02, Position03, and Position04 will all based on this block.
Red = The X,Y,Z, translation and rotation of the location based on Sfloor01_position_group.
What does this mean? It means anything you put in sfloor01_position_group will be added to the position02
values.
Example:
STransform :local_9293 . {
SSimpleTransform.Translation Vector3f( 1, 0, 0 );
SSimpleTransform.Rotation Vector3f( 0, 0, 0 );
Object.Name "Sfloor01_position_group";
};
TTransform :local_9294 . {
TNode.SNode STransform :local_9295;
TNode.Parent TTransform :local_9292;
Object.Name "position02";
};
STransform :local_9295 . {
SSimpleTransform.Translation Vector3f( 1, 0, 2 );
SSimpleTransform.Rotation Vector3f( 0, 0, 0 );
Object.Name "Sposition02";
};
X=1+1=2
Y=0+0=0
Z=0+2=2
Figure 26 below shows the coordinate system. Note that this is if you imported the body01 and did not change the
body’s location or rotation.
This position should move the character forward and rotate it 90° around the y axis. I recommend leaving the other
positions alone for now (they are all 0,0,0 by default). We can always come back here later. Anyways before you do
anything else save the .bs file.
Step 11: Scripts
Okay, we are almost done. Go to the script folder and open the following files with wordpad:
In Luder\Common
1) \Scripts\Luder\Common\ R9ZRoom###.bs contains room ID, Icon and other settings.
The only thing you really need to change is the ### to the room ID of your choice. Save afterwards.
Floor01 should be the same name as the one you have in .ImportNamespace in the previous file, it is also
referenced in another file. “Floor 01” is the actual name that appears in game. You can name this anything
you want. (example: bathroom, kitchen, ceiling…etc)
The only thing you should change here is the text inside the quotation marks: “________” when you are
satisfied, save the file.
---------------------------------------------------------------------------------------------------------------------------------------------
AvFurnitures.bs Position (sex-type) related
Floor01 is referenced here, like it was in the scene file and the two previous .bs files in the script folder.
Floor01_position02 refers to what you think it means: position02 of the floor01_position_group.
Now regarding TYPE, according to the in-game room files the following are the available types:
FLOOR, TABLE, CHAIR, WALL, SOFA
NOTE: I am not an expert in this area, as all the poses can be used in pose edit mode, these commands only
dictates what is available in the other “Play” Modes. I am not 100% sure what controls how a pose is
considered “FLOOR” or “TABLE” but I think it depends on the location it was made in pose editor.
Figure 28
For a given location or position, you need to define the “TYPE” of poses you can use at that location.
Unfortunately, I have not found a way to simply enable all poses for a location without having the location
duplicate. As a result you must define specific TYPES for a given position.
I’ve given examples on how to enable multiple positions here, I think its pretty self-explanatory, all you need
to do is to copy and paste and change the “Floor##” and add in “position##” if you wish to add pose options to
a locations. In the example above, TYPE: FLOOR poses are available for Floor01 and Floor02 position02. While
TYPE: FlOOR, SOFA and TABLE are available for Floor03 position02, 03 and 04. This means floor03 will have
three duplicates. Anyways you do not have to really change anything here unless you want to experiment.
When you are done, save the file.
Step 12: Testing and final touches
So if you followed my instructions and made the necessary changes and saved the file. It is time to go back and
encode all the [.bs] files into [.bsb] files using the bsb tool. Once all the .bs file has been encoded, take the .txx
tool and encode the Custom.03.R9ZRoom### folder into Custom.03.R9ZRoom###.txx
Next, assuming you have everything done, the only thing left is to enable texture support of your room in the
AddOnScript File. So take the latest Custom.02.R9AddOnScripts.v###.txx file and decode it. Go to
\Custom.02.R9AddOnScripts.v4.09\Scripts\Luder\Common\
And open the Mod_R9ZRoomAddon.bs file with a wordpad.
Scroll to the end, add in your room (you can just copy one of the previous rooms and use the “find and
replace” command) Example figure 29 below:
Figure 29
When you are done, save the file, encode it with the bsb tool. Then (Make sure you have a backup
addonscript file) encode the addonscript folder back into a .txx file.
Put the New addonscript file and the Custom.03.R9ZRoom###.txx file into your archives (don’t forget to delete
the older script) Now launch your game and cross your fingers.
A thing to remember here is when you are finally in the room in-game, don’t forget to take a screenshot and
re-size it for the icon (\Images\Q=Tex032M\Luder\GUI\ R9ZRoom###_Icon.png)
Hopefully mostly everything is successful and you at least see a room appear in the room selection. Even
better is if you load the room and it appears.
If everything worked out congratulations! If not, please read below in the FAQ section to diagnose your
problem.
Frequently Asked Questions (FAQ)
1) My room doesn’t show up in the room selection?
Check the addonscript folder, make sure everything is correct, check the semi-colons, brackets and spacing.