Don't worry i already did tuto about making models for source by the past. It's just i like to have a grasp on what i'm doing befor making a tuto about it.
I'll try to summarise "quickly" what I know as of right now about making ship into the game.
First is instaling the exporter
which is more tricky than it sound depending of your folder settup.
What i know:
If like a lot of people you have a hard drive/partition reserved for windows and have moved your documents and stuff on another drive/partition know that the installer of the exporter will instal the plugin for maya and its setting file on the system drive anyway ( default C: )
If you are in this case download the installer here:
https://accounts.paradoxplaza.com/profile/downloads and follow the installation instruction here:
http://www.stellariswiki.com/Maya_exporter
Once you did that you have 2 folder to check.
First is C:/windows/users/#yourname#/documents/maya/scripts
It should contain the pdx_exporter_ui.mel needed to run the exporter. You want to move it out of C: and put it to your proper document/maya/scripts folder.
Next folder that the installer instal on C: no mater what is C:/windows/users/#yourname#/documents/paradox interactive/pdxexporter
This folder contain a settings folder which contain clausewitz.txt and texture_exporter.txt
You also want to move all that paradox interactive folder to your proper documents.
Ok now make sure that in your Whatever:/program files/autodesk/mayaWhateverversion/bin/plug_ins you have something called pdx_exporter.mll and eventually pdx_exporter_RD.mll (no idea if this one is needed)
If something is missing the folder that you create during the installation of the exporter should contain all the missing bit (The folder you specified during the instalation).
What i don't know:
If you're a normal person and have everything installed on C: then technically you should be good without touching anything... But then again I have no idea if people with that kind of setup have the same sorts of problems when instaling.
Now is The part of setting up the exporter on maya
yes it's not just file -> export -> stuff.mesh
For that part you can simply follow paradox's guide:
Code:
Run Maya and make the below commands into a shortcut, most easily done by following these instructions:
Go into your plugin manager (At the top menu in Maya navigate trough Windows > Settings/Preferences > Plug-in Manager) and enable the “pdx_exporter.mll” plugin.
If it's not there you need to click Browse and search for it, in the directory where you installed PdxExporterInstall.exe to (default C:/Users/YOUR_USER/pdx_exporter/maya/maya_20xx_sdk_x64 (Don't ask me why it doesn't defaultly installed in /documents/ there)). Make sure you've selected the right exporter according to the version of Autodesk Maya you have installed.
Paste the following in the MEL input area at the bottom of your screen: rehash; source pdx_export_ui.mel; showPdxExport;
// Error: Line 1.33: Cannot find file "pdx_export_ui.mel" for source statement. -> Just add the directory. (e.g. rehash; source "C:/Users/YOUR_USER/Documents/maya/scripts/pdx_export_ui.mel"; showPdxExport;)
Select the entire command string that you've just entered in the MEL field, and while pressing the middle mouse button, you can drag the command string to your shelf (top bar, you will notice when there's a [+] sign at your pointer) in Maya.
Click on "MEL" when it says "Save script to shelf as type:".
Ok and now for the actual modeling and texturing
There's a lot of software that can be used to create DDS textures. I personaly use GIMP with a dds plugin and it work fine.
What i don't know:
The installer is also supposed to instal a dds plugin for photoshop but since i don't use toshop i have no idea what so ever about installing it properly if something is wrong with it.
I'll assume you already know how to make assets (texture and models) and know how chanel maping work. If not then i'm sure you'll find better tuto on youtube about those topics. Chanel maping is a bit tough to understand tho....
Ok moving on to what you need to know for your textures to work properly on the game.
Befor starting to work on the model you want to have your material ready. Materials for stellaris are composed of 3 textures: texturename_diffuse.dds , texturename_specular.dds , texturename_normal.dds
Acording to the wiki textures must be named that way. Something tell me that it is not mandatory but for the sake of simplicity just do what the wiki say.
The wiki (
http://www.stellariswiki.com/Maya_exporter) explain what each chanel on each texture does:
Once you have your textures ready it's time to move to the modeling/riging part.
From now on everything is just theory and there's nothing certain.
Step 1: Make or import your model from another editor if like me you are unfamiliar with maya.
For my example i'll take a corvette sized ship because that's probably the easiest ship size you can do and the only ship size i made into the game yet.
Note that the front of the ship must be facing toward the Z axis.
Step 2: Look for something called "hypershade" it should look like a blue ball in the top shelf. You can also find it in windows -> randering editors -> hypershade . For some reason autodesk though it was a good idea to call the material editor like that.
Once this thing is open on the top window in the "materials" tab you should see a couple of a balls called lambert1, particlecloud1, and shaderglow1. Right clic
and hold (again.... why....) in that very same window and go to create -> materials -> phong
Once you created your phong clic on it in the window bellow and clic on the little chessboard next to color:
It should have now opened a window called "create render node" with a list of things in it. Clic on "file"
This should add a bunch of stuff in the window where you selected the phong. I recomand you to grab and move them properly to see what you're doing.
Select the newly created "file1" in that window and clic on the folder on the right:
Here you want to find and select your _diffuse.dds you created earlier.
Now select your phong again and repeat this process with the chessboard next to "specular color"
This time instead of your diffuse you want to select your _specular.dds texture (obviously)
Now that you've done that select the phong one last time and clic the chessboard next to map under the bump/normal mapping category.
Thise should create a bunch of stuff including a box that place itself between the file and the phong: Don't panic it's normal just place those box nicely and set file3 to your _normal.dds texture.
It should now look like that:
If things went messy and you unlinked stuff and you're not sure etc don't be efraid to remove what you did (select -> del key) and try again with a fresh new phong.
Now that the material is set you can close the hypershade window and it's time for...
Step 3: Back to the model. on top of the viewport window clic the tiny icon next to the light bulb that look like another chessboard. It should be called "textured" and will turn the viewport into textured mod (so you can see if everything went right when applying the material). Select the model by clicking it. It should now be highlighted with green wireframe. Right clic and hold -> go all the way down to "assign existing material" -> phong1
You should now have a textured model. (the 3d view controls are alt+leftclic&drag for moving around the object and alt+midleclic&drag for panning the view)
Ok so now this thing need bones and locator in order to be used in the game.
Step 4: First we need to have viewport properly set. Look for this icon on the left of the screen:
This should turn the viewport into the classic top/front/side/perspective view. This will help placing the bones, joins and locators but first you also want to turn the top, front and side view in wireframe mod by clicking this icon on top of each viewport:
Step 5: We are now reaching the limits of what i know for sure. so expect a lot of "what i don't know".
Ok so now we need a bone for that thing so on top of the window look for the "rigging" tab and select "create joins"
Now on the top view clic once somewhere in the midle of the ship and right after that select the icon that look like a mouse cursor on the left. That way you go back to select mod and avoid placing more bones (aka joins) by accident.
What i don't know:
I usualy parent the bone to the shape by selecting both the shape and the bone and clicking the "parent contraint" button in the rigging tab. I have no idea if this is necessary... aparently it is not... but i feel it would be weird not to have any form of relationship or rigging between the bone and the shape. I don't even know if doing that is the proper way of riging a shape to a bone.
Step 6: Now On the right of the screen you should have a bunch of information and parameters. If that's not the case clic on this icon in the top right corner of the screen:
On the top of that menu that just poped out you should have something that look like join: joint1 in a text box.
This is the name of the joint. Names are
EXTREMELY IMPORTANT. We will need to anticipate a bit for the future.
I want you to select joint1's name in that text box and name it:
NameOfYourNewRace_01_corvette_frame
Obviously replace "nameofyournewrace" by the actual name of the race you plan to do in the game. Keep it simple if possible a single word and if the name of your race/faction/whatever is too long don't hesitate to crop it.
For my example this will be:
gallente_01_corvette_frame
Step 7: The shape also need a name. Select the shape. Now that's where i often get myself fucked. You see... if you created your model directly in maya you should have 2 tabs: pcube1 and pcubeshape1 but since i import stuff in obj i get something:shape and something:shapeshape. The one you want to select is the second tab. The shapeshape one in my case the one that says "mesh:" next to the text box where you set the name.
For my example i will replace the frigate type that only have 1 turret. Again the names are supper important as the game tend to do things automaticaly acording to how you named your stuff.
Name your shape:
NameOfYourNewRace_01_corvette_mid_s1
In my case i want to rename the shape: gallente_01_corvette_mid_s1
Step 8: Now the ship need a gun mounting point. To do that we want to go back into the rigging tab and clic the very first icon: "create locator"
This should imediatly create and select a locator in the midle of your ship.
Using the move and rotate tool on the left:
place your locator where you want the turret to apear. Know that by default the turret's barrel will point forward and that the locator is the lowest point of the default turret's model. There no much way to know how the locator is oriented after rotating it tho so try to rotate it only if you really need it. It can take a few try befor placing the turret corectly so once we are done porting the model in the game don't hesitate to come back on the model and try to ajust that.
Step 9: Naming....again. This time naming the locator. Second tab, locator: locatorShape1
You want to rename that acording to the type of gun that will be mounted on the ship. Since our ship is a corvette with only one small gun (corvette_mid_
s1) you want to name the locator:
small_gun_01
What i don't know:
Earlier i successfully managed to add engine trails on a shape in game. Problem is once the shape is turned into an actual working ship the trails no longer come out of the locators i set but instead come out from the central joint.
My theory is that the locators for the engine trails unlike the turret hardpoint must be located on the frame which we will talk about later. For now we will just make a single trail coming out of the midle because it would look worst without it anyway.
Step 10: The engine trail locator. Ok so now you want to click once again on the create locator button to create a new locator. This time you don't really need to move it since like i stated befor it won't make any diference in the end. Now again name it. This time you're free on the name you want for the locator. I'll call it "engine1"
Step 11: Now this is something a bit weird and i have no idea what it mean but if you try to run the exporter now you'll have an error saying "joint doesn't have a bind pose". To fix that you want to select the joint and once it is selected type this in the MEL text box at the botom of the screen:
dagPose -bp -save;
This should give you a confirmation "// Result: bindPose1"
Again: no idea what this does and why it is necessary.
Step 12: Ok now everything is in place and name. I want you to save your scene by going into file -> save scene as
Later we will have to do some nasty things. So yeah... save. But now it's time for
Step 13: Exporting. Now if you followed the guides about instaling the exporter and seting it up in maya you should now have somewhere a button to open the pdx exporter menu. I want you to clic that button.
Ok this is where it gets tricky. you see on the botom right of the exporter you have a couple of thing you can sellect:
standard_previewer
hearts_of_iron
terra
Those are presets for the exporter. In our case we want to select terra which i believe (i might be wrong) was the original name of stellaris. The setings for those presets are set in documents/paradox interactive/pdxExporter/settings folder in the clausewitz.txt file. You might want to take a look at it. You don't have to change anything but the output folder for the exported model might be a bit odd so check that file to see where the models will be thrown after exporting. in my case the instaler decided to put my output folder in X:/project/project_terra/game (don't ask why i have no idea... this is my archive drive)
Ok so back on the exporter window under the "terra" preset you have filename and output directory.
The output directory will be right after the path in the clausewitz.txt file so in my case models will be created in X:/project/project_terra/game/output
Now for the filename again it's important. It has to be:
NameOfYourNewRace_01_corvette_mid_s1
In my case gallente_01_corvette_mid_s1
Ok in general you now want to make sure that "create .gfx and .asset", "export skeleton", and "export mesh" are checked.
And now for the final part you want to reopen the good old hypershade (aka material editor).
Once it is open select your phong by clicking on it and go back to the export window.
Clic the " add "shader" attr. " button.
And finaly clic in the botom right corner of the export window the "export button"
I did it as i was writing it and got an error that i've never seen befor so i'll assume you didn't had this error when pressing the export button....
This should now have created 3 files in your output folder:
NameOfYourNewRace_01_corvette_mid_s1.asset
NameOfYourNewRace_01_corvette_mid_s1.gfx
NameOfYourNewRace_01_corvette_mid_s1.mesh
So! Now we have our ship mesh. We now need the frame. I still having trouble understanding exactly how this work and what should be on the frame and what should be on the actual ship shape. For our corvette it will be quite simple.
Step huuuh.... step 14! Make sure you
SAVED.
Step 15: select the shape and hit the del key then select the engine1 locator and hit the del key and finaly select the turret hardpoint and hit the del key again. Yep you just deleted everything excepted the bone.
Step 16: Save
AS A NEW SCENE. This is just in case you accidentaly hit the save button or do the wrong shortcut and overwrite what you saved earlier or... just do it.
Step 17: Now that the model is bare bones
(hehe get it?) go to the polygon tab and clic on the icon that look like a cube called "polygon cube":
You probably guessed it... it create a cube.
Step 18: As the lead designer of the game once told us in another thread:
It mean (I think) That whatever model you're trying to export must have a material assigned to it or else it is just ignored just like when you're making model for source. So like the real ship you want to select the cube, right clic and hold, go to assign existing material -> phong1
Step 19: I don't know if there's better way to do that but for now we are going for the simplicity. You see this cube is small and is likely to not show once the ship shape will be applied over it by the game BUT right now it is large enough to still be seen in the ship editor when no "section" is selected. There might be clean way to make the cube invisible or even totaly get rid of it but for now we are just going to resize so small it will be nearly impossible to see ingame. Select the resize tool on the left:
Now clic on the cube if it is not already selected and once you see the "widgets" clic and drag the yellow one in the midle until your cube is really small:
What i don't know:
Since we won't rename the cube i'm not even sure if it ever apear in the game since it doesn't have a proper name like gallente_01_corvette_frame stuff. However since i wasn't paying much atention to names in my first atempt in porting models into the game but they were still apearing when manualy spawned as entity i really have no idea...
At least now you know where the resize button is right?
Step 20: It's now time to export the frame. Clic on that exporter button thing. The process is basically the same as for the ship. You just need to change the filename to something like that:
NameOfYourNewRace_01_corvette_frame
Again in my case it's gallente_01_corvette_frame
Make sure that the phong is properly taken into acount by selecting it in hypershade and clicking the "add 'shader' attr." button in the exporter window.
Ok so everything is set? Hit the export button.
You should now have you output folder filled with 6 files. The 3 files of the ship and the 3 files of the frame.
Next step is the most boring part and the one i'm the least confortable with. The "coding" and addon making where a single typo can fuck your addon up and throw you in hours of code checking to find where the problem is....
Now is time to mod the ship into the game
Ok so in this part we will see how mod works and how much of a flustercuck moding for this game is....
Shoutout to endzeit666 who bascially tought me everything i curently know about making an addon for this game and what file you need to change and stuff.
Keep in mind that everything at this point is experimental even for me.
What i don't know
I curently have no idea if it is possible to make a stand alone "addon" that doesn't just overwrite entire chunk of game files. The mod we will create in a moment WON'T be compatible with any other race mod because of that.
Fine let's get started shale we?
Moding will be done in your documents. You don't want to alter any of the game file like i did when i started moding for the game. Doing so would unable the game to work in multiplayer even if all you did is just creating an new empty folder in the game file.
Ok
Step 1: Go to your documents/paradox interactive/stellaris folder. Inside of it you probably already have a folder called "mod" If that's not the case create it. Inside that mod folder you will find mods you downloaded on the workshop and this is where we want to create our new mod. So for that create a new folder and name it whatever you want. It's your mod.
You also need a .mod file. It should be named like the folder of the mod.
Edit that .mod file with a text editor and bast this in it:
Code:
name="NameOfYourMod"
path="mod/NameOfYourMod"
tags={
"whatever"
}
supported_version="1.0.0"
Step 2: Inside your new mod folder you just created everything will have to be aranged the same way folders are arranged inside the game starting from steam/steamapps/common/stellaris/ So inside of your mod you want to create 2 folders. First one must be called "common" and the second one "gfx"
Now go into the common folder (Note that, since the folder in the mod are exactly the same as in the game always consider that i'm talking about folder IN THE MOD unless specified otherwise)
Inside that common folder you'll need 2 other folder "graphical_culture" and "species_classes"
Go inside "graphical_culture"
For the sake of simplicity we will just take the original game file and edit it here. So go into your actual game files in steam/steamapps/common/stellaris/common/graphical_culture , copy the text file called "00_graphical_culture.txt" and past it into your own graphical_culture folder (the one in your mod)
Step 3: It is preferable to have something like notepad++ to edit the files tho it is still possible to do it with regular notepad... anyway open the 00_graphical_culture.txt file you just pasted into your mod.
In this file you have each race type and some parameters. I have no idea what so ever of what those parameters are. Ok now you want to copy the entire mammalian block, past it after the first 4 commented lines (The ones that start with #) rename it and add a line "fallback = mammalian_01"
.....or just copy past that after the first 4 commented lines and change the name of the race(use the same you used on maya when exporting the models):
Code:
YourRace_01 = {
fallback = mammalian_01
ship_lighting = {
cam_light_1_dir = { 1.0 0.0 0.5 }
cam_light_2_dir = { -0.5 0.2 0.0 }
cam_light_3_dir = { 0.5 -1.0 0.0 }
intensity_near = 1.0
intensity_far = 1.0
near_value = 700
far_value = 4000
rim_start_near = 0.5
rim_stop_near = 0.99
rim_start_far = 0.3
rim_stop_far = 0.99
#rim_start_far = 1.5
#rim_stop_far = 2.0
ambient_near = 0.1
ambient_far = 50.0
}
}
Again in my case my race will be gallente_01
Save.
Ok now that's done....
Step 4: go into /common/species_classes in both the mod and the game files. This time you have to copy 00_species_classes.txt from the game to the mod and start editing the one you just pasted in your mod.
Once again you could copy an entire block and edit it or just copy that and past it after the first few commented lines:
Code:
NameOfTheRace = {
portraits = {
"human"
"mam5"
"mam13"
"mam10"
"mam14"
"mam4"
"mam9"
"mam11"
"mam6"
"mam3"
"mam12"
"mam7"
"mam15"
"mam2"
"mam8"
"mam1"
}
graphical_culture = NameOfYourRace_01
move_pop_sound_effect = "moving_pop_confirmation"
}
The first line will be the actual name of you race as displayed when creating a new race in the game however i do believe there's a way to change that manualy afterward since all other race just have stuff like MAM for mammalian or REP for reptilian etc... I don't know how though. I don't know what happen if you add a space in that name so again try to keep it simple with a single word. In my case it's simply "Gallente".
Ok then you have portraits = { "stuff" } This is where you would set custom portraits if you had some i guess but for this tuto we will just keep vanilla portraits since i never tried to mod custom portraits. (if you don't want mamalian just scrolldown and copy the list of portraits from another race it doesn't really matter for the sake of this tuto... Just don't screw everything up ok?)
And then you have graphical_culture = NameYOfYourRace_01
Now as you probably guess you have to replace this by the name you've been using until now. Just keep the _01 at the end. For me it will be gallente_01
Save and it should be done for this file.
Step 5: Go back to the root of the mod and go inside the "gfx" folder. In that "gfx" folder create a "models" folder. In that "models" folder create a "ships" folder. And finaly inside that "ships" folder create a "NameOfYourRace_01" folder. That same name you edited in the 2 txt which for me is "gallente_01"
Ok so now pay atention because this will get real finicky and this is where you are most likely to fail somewhere.
In this "NameOfYourRace_01" folder you want to copy/past the 2
.mesh you exported earlier with maya. "whatever_01_corvette_frame.mesh" and "whatever_01_corvette_mid_s1.mesh". In this same folder greate 2 text file and name them
"_NameOfYourRace_01_ships_entities.asset"
and
"_NameOfYourRace_01_ships_meshes.gfx"
Finaly grab the 3 .dds texture you made at the very begining of the tuto and past them in that same folder
You should now have something like that:
Step 6: Open the .gfx file and past this in it:
Code:
objectTypes = {
pdxmesh = {
name = "NameOfYourRace_01_corvette_frame_mesh"
file = "gfx/models/ships/NameOfYourRace_01/NameOfYourRace_01_corvette_frame.mesh"
scale = 1
meshsettings = {
shader = "PdxMeshShip"
}
}
pdxmesh = {
name = "NameOfYourRace_01_corvette_mid_s1_mesh"
file = "gfx/models/ships/NameOfYourRace_01/NameOfYourRace_01_corvette_mid_s1.mesh"
scale = 1
meshsettings = {
name = "NameOfYourRace_01_corvette_mid_s1"
index = 0
texture_diffuse = "YourTexture_diffuse.dds"
texture_normal = "YourTexture_normal.dds"
texture_specular = "YourTexture_specular.dds"
shader = "PdxMeshTerra"
}
}
}
Here you go! Lots of editing for you!
Don't forget to also set you texture near the end of the code.
Oh and if when trying your ship you realize it is too big or too small you can change the scale = 1 parameter to whatever you want without having to go back on maya to resize everything.
Also don't forget to save. It's not because i don't mension it that you shouldn't save...
And finaly
(technically)
Step 6: Open the .asset file and past this in it:
Code:
entity = {
name = "NameOfYourRace_01_corvette_entity"
pdxmesh = "NameOfYourRace_01_corvette_frame_mesh"
default_state = "idle"
state = { name = "idle" animation = "idle" animation_blend_time = 0.25
start_event = { trigger_once = yes sound = { soundeffect = "amb_corvette_hum" } }
}
state = { name = "moving" animation = "idle" animation_blend_time = 0.25
event = { trigger_once = yes sound = { soundeffect = moving_out_corvette } }
}
scale = 1
}
entity = {
name = "NameOfYourRace_01_corvette_S1_entity"
pdxmesh = "NameOfYourRace_01_corvette_mid_s1_mesh"
default_state = "idle"
state = { name = "idle" state_time = 5
event = { time = 0 node = "NameOfTheEngineTrailLocator1" particle = "avian_01_1_6_exhaust_idle_particle" trigger_once = yes keep_particle = yes }
}
state = { name = "moving" state_time = 5
event = { time = 0 node = "NameOfTheEngineTrailLocator" particle = "avian_01_1_7_ship_exhaust_moving_particle" trigger_once = yes keep_particle = yes }
}
}
Here you go more editing. Again change the name of your race for me it's like gallente_01 everywhere. One thing special tho is the "NameOfTheEngineTrailLocator". Remember that thing? We created it earlier when placing locators on the model. I named mine "engine1".
So it is now finaly time to boot up the game. When the launcher of the game is up you should have a tab called "mod" if things whent right you should find your mod there. Clicking on it should highlight it meaning it's activated.
The game will probably told you the mod is not up to date or whatever. It doesn't matter. when the mod is activated just launch the game. Now create a new race. This tuto is not about creating a race but more about porting a ship into the game so since we didn't specified the race a certain list of names and stuff like that it might be unstable or just not return any name when pressing the generate random name button... keep that in mind.
Ok in appearance you should technically have your race in the list on the left. If not then you probably failed somewhere in the graphical_culture or species_class file. Just set everything and finaly ship appearance. Here you should have your new race as well. Since the preview of each ship design is bassed on the science ship and we made a corvette the icon for your race's ship design should be a mammalian science ship. It's because of the "fallback = mammalian_01" line we added in the graphical culture file. It mean that when the game can't find a model for a ship/turret/whatever it will just replace it with a mammalian model. Once everything is done Save that race and launch a new game. Once in game go into the ship designer -> new design -> corvette and then select a section:
TADAH!