Adding weapon positions to .unit files

Hey there,

I started building a mod with a new faction and ships. While creating the .unit file for my first ship I was wondering:

Do you have to define everything manually or is it enough to put the mesh_point in and the rest will get filled out automatically, when "building" the mod with peon from the sins2modtools or loading the mod in game for the first time?

 

I use the sins2modtools from GitHub - StardockCorp/sins2modtools: Official Modding tools for Sins of a Solar Empire II. Provided by Ironclad Games and Stardock Entertainment.

and the Blender Add-On for the Ships/.mesh: https://github.com/largeBIGsnooze/sins2-blender-extension?tab=readme-ov-file

Edit: Same with barrel and muzzle positions, why do you create named mesh points, when you have to put in the position/coordinates by hand?

 

 

7,135 views 6 replies
Reply #1 Top

Use Blender with the extension to add the hardpoints where the weapons will go, rotated properly how you want them aligned to the mesh.  

Open the unit in SolarForge, it has functions to calculate the position info, "Sync Weapons to Mesh" under the Weapons tab.  

+1 Loading…
Reply #2 Top

Thank you for the tip. I didn't know you could open .unit files in SolarForge.

I tested with the advent battleship to learn how it works. However, when I used one of the already finished ships from my mod, it showed an error saying it couldn't find the .unit_skin, even though the ship works fine in game.

Edit: I misread. It says "unit_skin_definition not found", so it's not the unit_skin missing, but another file that I didn't know of until now.
What is the unit_skin_definition? Or where can I read about it?

 

So far, I have used the Blender extension to set the hardpoints, exported to GLTF, and used MeshBuilder to convert to .mesh_json (and .mesh for the model itself). Then I copied the values from the .mesh_json over to .unit.

Reply #3 Top

not sure exactly what this could be.  there are no unit_skin_definition files that I am aware of.  

I think its refering to a something being defined either in the unit file or unit_skin file. 

In UNIT file at the bottom is the "skin_groups" section defining the unit skin.  start there.  

Reply #4 Top

I found the error origin:

There are no missing files or connections in the .unit or .unit_skin. (I crosschecked the file structure with other base-game ships, and my modded ships work fine inside the game as well.)

However, SolarForge is unable to find the .unit_skin file (or any other file referenced in .unit) if it is not located in the base-game folder ("D:\Steam\steamapps\common\Sins2" in my case). I copied the .unit_skin from my mod folder over into the "...\entities" folder from the base-game and the error chenaged to "weapon_definition not found". 

So the .unit_skin can now be found, but the next reference, the weapons, not, which is fine because I know I only copied the unit_skin over, not the weapons.

 

Conclusion:

Editing via SolarForge is not possible because I am working in a separate folder from the base-game?

 

Reply #5 Top

Make sure you've set your Sins2 game data path in Solar Forge properly, which it sounds like you have, but go in Solar Forge File > Mods... and make sure you apply your mods there as well.  Otherwise Solar Forge doesn't know to load them.

+1 Loading…
Reply #6 Top

Quoting B3Bomber67, reply 5

Make sure you've set your Sins2 game data path in Solar Forge properly, which it sounds like you have, but go in Solar Forge File > Mods... and make sure you apply your mods there as well.  Otherwise Solar Forge doesn't know to load them.

That did it, thank you very much!

 

I thought it was just a display which mods are currently enabled in game for map building or creating something that uses another mod.

Now that I type it out, it sounds pretty much like the problem I had. ^^