Importing Models and Textures

From Star Ruler

Jump to: navigation, search

(This tutorial to be improved) We can import the following files into Star Ruler: .OBJ, .3DS, and .X. 3DS has proved to be the most stable of the filetypes we can support.

Importing models into Star Ruler is a four step process. I'll guide you through each step. The way we'll be doing it, we'll be making a mod for the game at the same time. If you're unsure how to modify your materials, go to Data File Modding [[1]] before continuing.


Each line assumes that you're starting out in the Star Ruler directory. By default, it installs to Program Files\Star Ruler

Step 1: Where to put model and texture files

TEXTURES Ship textures go in "\[Your mod]\Images\Ships\" GUI textures go in "\[Your mod]\Images\GUI\" Menu textures go in "\[Your mod]\Images\Menu\" *these have to be the same names as they are loaded manually Planet textures go in "\[Your mod]\Images\Planets\" Background images (Distant Galaxies) go in "\[Your mod]\Images\"

Once you've placed all the textures in their appropriate directories, open up "\[Your mod]\Materials\": If the directory doesn't exist yet, make it.

If you're overriding one of the default images, copy over the associated file from materials into your Mod directory, following the same directory structure.

Ship textures: ship_textures.txt
GUI textures: gui_images.txt
Planet textures: planet_textures.txt
Asteroid textures: rock_textures.txt
Distant Galaxies: distant_galaxies.txt

For textures, place them in "\[Your mod]\Images". Depending on what you are adding, it should go in a specific directory. For example, to add a new ship texture, copy your file to "\[Your mod]\Images\Ships"; for planets, use "\[Your mod]\Images\Planets". We stated that you should for coherency's sake. If it's not your intent to maintain coherency in your mod directory structure, add the files to the root of the mod or wherever you want.

For models, place them in "\[Your mod]\Models". Again, depending on what you are adding, it should go into it's proper directory. For example, if you add a ship model, put it into "\[Your mod]\Models\Ships". Again, this is just for purpose of coherency. Another example: if you have a ship model for a specific vessel class, put it into "\[Your mod]\Models\Ships\[the class]".


Step 2: Setting the models and textures


First, the textures. Open the file "\[Your mod]\materials\materials.txt" (if it doesn't still exist, create one). Now, the most basic thing you need to do is to add these 2 lines, at the end or begining of the file or after or before a previous entry:

Material: [any name you want, must be unique]
 Texture: [the path where you put your texture file, for example, "\[Your mod]\Images\Ships\[your texture file]"]

After these two lines, you can specify, for example, RenderMode, FlagOff, FlagOn and other conf values that are present in the following link: http://starruler.blind-mind.com/wiki/index.php?title=DataFile:Materials

After this, you need to set the model's main settings. To do this, open "\[Your mod]\Models\models.txt" and add, at least, these 3 lines at the end or begining of the file or after or before a previous entry:

Model: [any name you want, must be unique]
 File: [the path where you put your model file, for example, "\[Your mod]\Models\Ships\[your model file]"]
 Material: [the Material name you specified in materials.txt, in the first line]
 Scale 1, 1, 1

In the last line, you specify the scale of the model. If all 3 coordinates are equal, just type one value (for example: 1,1,1 would just be 1). When using just a number, that means that the scale applies to all 3 coordinates. You can use operations like Scale, Rotate and Translate in this file.


Step 3: Adding them to the shipset

Go to "\[Your mod]\GameData\ShipSets\terrakin.txt". In here, you should specify each entry in one of these three ways:

Via a defined class:

if class == [ColonyShip, Carrier, Transport, Cargo, Station or CivStation]{
	Model = [the Model name you specified in models.txt, in the first line]
}

or by associating the model with a tag that a subsystem will have:

tag Colonizer {
   Model = terrakin_colonizer
}

or finally by scale

if scale [<=, >=, <, > OR =] [the ingame scale interval you wish this model to associate] {
	Model = [the Model name you specified in models.txt, in the first line]
}


Now, create a new blueprint with the scale value, sub system with tag or class you defined.

Personal tools