Astrox Imperium

Astrox Imperium

41 ratings
Modding with Kjell
By Kjell and 3 collaborators
Modding Astrox Imperium

I will be teaching you how to mod this game, using the in-game editors and modding outside the game. This guide will be aimed at beginners, but will include some advanced material. I will continue to update this in the upcoming months and make changes if the game changes how a section of modding is completed.

By the end of this guide, you should be able to make simple mods or advanced DLC size mods. There will be aspects I will not be touching upon, such as DLL injection to add new functions/mechanics to the game. Perhaps when Early Access is finish, I will consider going into advanced topics like that.

I hope this will help others wishing to create mods. If you have any questions then feel free to ask and I will do my best to assist you. Additionally, if I have missed a section please let me know so I can add it to the guide.
2
2
   
Award
Favorite
Favorited
Unfavorite
1-0 Learning the Basics
There are a few basic things you will need to know. First off, the entire game can be modded using just notepad as the files are all text files. A few tips you should know when looking at each file are the following:

  • // This is used to add comments in your code. The game will totally ignore anything written after it sees this. Remember to comment often, not only to help others understand, but to help yourself remember what you were doing if you ever take an extended break from coding.
  • ; This is used to break up information. If you are having issues running your mod in the game, this is likely the first mistake you have (trust me it happens much more than you would think).
  • Tabs will be ignored when the game loads your mod. So feel free to use tabs as a way to make your code easier to read.
  • The game is case sensitive, so be very mindful of this when creating your mods.
  • Avoid using spaces in your file names. If you need to have a space then use an underscore. Example: "Kjell Mod Item" should be named like this "Kjell_Mod_Item"
  • Which folder you place specific files does matter. So ensure you are saving your files in the right folder. I will include a blank mod template for anyone to use that will contain all the correct folders (all empty folders) for you to use when creating your new mod.
  • Perhaps the most important thing, make backups of everything you create. Make your backup in a different folder than the actual game folder. This is essential when you are editing vanilla files, for if the game updates that file (say the game has a normal update and something in that file changed) then you will lose all your hard work. Trust me, this has happened to others and will happen to many more in the future.

    Click Here [s000.tinyupload.com] to download the blank folders with correct names if you are creating your own mod. Add files to the correct folders as your mod expands.
1-1 Importing/Exporting from Excel
I am including this section because I personally use Excel on a Windows OS. I will save you the hardship I faced when trying to export the file from Excel (Windows and Excel could of handled this much better than how they currently do it).

The issue I am speaking about deals with CSV files and the character they use to separate cells in Excel. I will explain more shortly.

The first thing you want to do after opening Excel is to click "Data" toolbar tab. There you will see "From Text/CSV" towards the left of the toolbar. After clicking this, choose the file you will want to import. In our example, we will be opening the "items_database.txt" found in the items folder. For Windows users, this will be "C:\Program Files (x86)\Steam\steamapps\common\Astrox Imperium\Astrox Imperium_Data\MOD\items" or where you have Steam install your games. Finally, click the import button.



This next box will have drop down menu called "Delimiter". Select this and change it to "Semicolon", followed by clicking the "Load" button on the bottom of the screen. You will notice that excel has imported the file and turned it into a table. Anywhere the file had a semicolon will have a new cell to store that information. This will likely make the file much easier to read and will gave you the ability to sort the different columns in a way that makes sense for whatever you are working on.



This is great and all, but how do I get this back into a file that the game can actually use? Well there are a few steps we need to make that happen. First of all, you will want to convert your table into a range. Select all the cells in the table, followed by right clicking on those cells and going to the table option and clicking "convert to range". Now, select the entire first row and right click so you can click delete. We do not need the title row that the table created.



At this point, check to make sure you do not have a row that begins with and empty cell. If you created a new row and wanted that blank row to separate a section of your code, be sure to add // to the first cell in that row. This will make more sense shortly.

At this point your spreadsheet is ready to be converted back into a file the game can actually use. This is where that issue about Windows and Excel comes into the mix. Normally a CSV file uses commas to separate information, but Astrox uses semicolons. You can't simply tell Excel to use a semicolon (like you could when you imported). Excel uses the global variable that is determined by the Operating System. To change this in windows we will need to take a few extra steps. Thankfully you only need to do these next few steps one time.

Go to "Control Panel" (type "control panel" in the search bar on the start menu) and click on "Change date, time, or number formats". Then click "Additional settings..." and you will be looking for the box labeled "List Separator:". You will need to change the comma to a semicolon and hit "OK" and "OK". Please not that you might need to restart your computer after doing this for it to work in Excel.


Now we can jump back into Excel so we can finish exporting our spreadsheet. Click "File" then "Save As". Choose where you want to save your file and give it a name. Next, click the drop down to choose the file type. Select "CSV (Comma delimited) (*.csv)" and hit that "Save" button. You can simply hit "OK" for any boxes that pop up. Now close Excel and go to the folder you just saved your file. Rename your file, but only change the ".csv" to ".txt" and you have finished.



Just repeat this process for any file you wish to edit in excel. Later in this guide I will show a few advanced things you can accomplish within Excel for creating mods.
1-2 Importing/Exporting From Google Sheets
1-3 Using Notepad++ and useful Plugins
1-4 Editing Saved Games
This section will be going over the saves folder that is located in the MOD folder. All your saved games are located here and if you want to test different changes, this is the best place to go. When you make changes to the files in the MOD folder, all new games will be impacted by the changes, whereas when you make changes in the saves folder, only that specific save will be impacted. There are two files that have an exemption to this though. The files newplayer_data.txt and the newplayer_options.txt are used when creating a new saved game.

When creating your first mod, this will likely be the easiest thing to change and have yourself an official mod, granted a very simple one. I will break down each file and explain what each part does. This should begin to give you many ideas for mods to create.

The first file we will take a look at is the newplayer_data.txt and learn what this file actually does. To do this, I will break the file into different chunks and we will explore what each line is doing. Many of the lines will be very easy to understand, while others might need a bit of explaining. So we open the file and here is the first bit that you will see:

// PLAYER;Variable;Value <PLAYER> PLAYER;name;<PILOTNAME> PLAYER;level;1 PLAYER;xp;0.00 PLAYER;next_level_xp;100.00 PLAYER;last_level_xp;0.00 PLAYER;avatar;none.jpg PLAYER;credits;40000.00 PLAYER;skill_points;50 PLAYER;playtime;0 PLAYER;fleet_formation;Broad PLAYER;fleet_formation_distance;1.0 PLAYER;max_missions;1 PLAYER;face_1;<FACE1> PLAYER;face_2;<FACE2>

In this section we can see what the default beginning player information is. Some of these stats the player will decide when they start a new game, such as the player name, avatar and face. These we can ignore all together. The main two in this section you may want to mess with are credits and skill_points. This is how much money the player starts with and how many skill points they have at the start of the game. For example, if you create a balancing mod that changes the costs of everything in the game to cost 10x more, it would be wise to give the player additional funds in the beginning of the game. Or if you wish for the player to have a chance to learn many skills at the start of the game, you can increase how many skill points they start with.

The next bit I will go over is this:

PLAYER;sector;sector_0.txt PLAYER;sector_id;0 PLAYER;station;sector_0_station_0.txt PLAYER;isdocked;True // SHIP;filename;isActive;isDocked;station;sector;position_x;position_y;position_z; <SHIPS> SHIP;/MOD/saves/<PILOTNAME>/ships/<STARTSHIP>.txt;True;True;sector_0_station_0.txt;sector_0.txt;-128.4;121.9;-5148.9 // MERC;filename;isactive;station;sector;position_x;position_y;position_z; <MERC> // SKILL; skill id, skill lvl, train time remaining, total time <SKILLS> SKILL;11;1;0;0 SKILL;41;1;0;0 SKILL;215;1;0;0

There are many things going on in these few lines. Where it says sector, this is which sector the player will start in. You can use the sectors, folder as a reference for which sectors are available. Where it says station this is which station the player will start in. You can use the stations folder as a reference for which stations are available. As for isdocked, this is determining if the player starts the game docked in the station you specified above.

Next we have the SHIPS section. Every ship that the player currently owns will be in this section. In the code above, we see that the player starts with the STARTSHIP and that his ship is located in sector_0_station_0 which is in sector_0.txt. We can also see that the ship is docked and is the active ship (the ship the player is currently in). The last part is the specific coordinates of the ship in the sector.

This is something we can change as a mod for the game. You can decide to have the player start with additional ships or change the ship the player starts with. This will likely change, but to do this I have created a new folder to hold my mod ships (as to not change vanilla ships). My folder is called kj_ships and is located in the MOD folder. I then copied all the files from the ships folder into my new folder. I then add this line under <SHIPS> in our code above:

SHIP;/MOD/ships_kj/ship_data_(battle_carrier_1).txt;False;True;sector_0_station_0.txt;sector_0.txt;0.00;0.00;0.00

This currently works, but there are a few issues with this method. First, the ship file is n ot contained within the new save folder that is created when you start a new game. Second, and new saves will be changing the same ship file anytime a change is made (adding new modules or taking damage). I will contact Momoguru (the game dev) to see if this can be changed. For now, this is one method of adding multiple ships to s new game when you create a mod. I will call this "Dirty Modding".

To make things interesting, you can make the new ships be located in different stations and different sectors. For instance, the player starting the game has inherited the ships his father owned who recently passed away. I am sure you can create other ideas.

Next we have the <MERC> section, which is very similar to the <SHIP> section above. Using the same method we can have the player start with a few mercenaries. An example would be adding this to the code right under <MERC>:

MERC;/MOD/npc_ships_kj/ship_data_(battle_carrier_1).txt;True;sector_0_station_0.txt;sector_0.txt;0.00;0.00;0.00

As with my player ship example, I created a new folder called npc_ships_kj and copied all the NPC ships into that folder (copied the contents of the npc_ships folder found in the MOD folder). The same logic applies. Let you imagination go crazy with the stories you can create by doing this.

The last section in the bit of code we have been look at is the <SKILLS> portion. These are the skills that the player will start with. As you can see, the player starts with a few skills at the beginning of the game. To know what these skills are we will need to look at the skills_database.txt that is located in the skills folder. The skill ID is what we will use to figure out what skills the player is starting with. This is the second bit of information on each line. The first skill is ID 11, so let's find out what skill that is. Upon opening the skills_database.txt you will see something like this:

SKILL;1;Projectile Basic Operation;Weapons;Projectile;null;Law;skill_1.png;1000;5;1;Operation;1;120.0;0,0;10;0;0;0;0;0;0;Basic Projectile Operation will provide you will all the basic knowledge about the operation, maintenance and upkeep of active module projectile weapons. The level of the Projectile module is directly linked to the level of operation required to use it. SKILL;2;Projectile Advanced Systems;Weapons;Projectile;null;Law;skill_2.png;1200;7;1;General Bonus;0.025;60.0;1,3;10;0;0;0;0;0;0;Advanced Projectile systems not only provides pilots with additional training about the use of projectile weapons, but also unlocks the use of special projectile weapons. Each level of training provides a small bonus to all attributes dealing with projectile weapons. SKILL;3;Projectile Focal Range;Weapons;Projectile;null;Law;skill_3.png;1600;9;1;Improved Range;0.1;90.0;1,2;10;0;0;0;0;0;0;This specialized skill will boost the effective range of all Projectile Weapons installed. Each additional level of this skill will further improve the range, with a maximum training level of 10.
1-5 Editing Saved Games (continued)
Just like in the newplayer_data.txt, we see that this file follows the same format. The second part of each line (each part is separated by a semicolon) holds the skill ID, so we will be searching for ID 11. That happens to be Laser Basic Operation. The third part of that line in the newplayer_data.txt tells us the player starts with that skill at level 1. Repeat the process to know the other skills. If you want the player to start with additional skills, simply add more following the same format.

The next bit of code in our file is as follows:

// MEDAL , id , bool, img, desc <MEDALS> // MISSION , id , timer, img, data, desc <MISSIONS>

Here we can give the player a few medals to start with or a mission that is started from the beginning of the game. I will come back to this bit in the future.

The next bit of code are nothing but statistics, so we will ignore these for now and move on to the last bit of code in the file. Here you will see this section of code:

// KEY; Sector ; gate_id <KEY> // BOOKMARK; sector_id ; title ; notes ; x ; y ; z <BOOKMARKS> // PLOT; PLOT name ; PLOT value <PLOT>

I will come back to this section at a later date since this will get into some concepts that haven't been discussed. Essentially <KEY> are the keys needed for warp gates that are locked in the game, <BOOKMARKS> are locations a player can leave a note about in-game. This could be useful when creating a mod that starts the player with breadcrumbs of information scattered throughout the sectors. As for the last section <PLOT>, even I do not know what that is for currently, so I will return to this section after discovering what it is used for. I suspect either for story stuff or player controlled sectors and stations. We will see...

Next we will look at the newplayer_options.txt file and everything you can do with it. When you first open it, you will see this bit of code:

//GRAPHICS OPTIONS OPTION_ui_scale;1.0 OPTIONS_mouse_scroll_sensitivity;2 OPTION_cam_drag;3.194782 OPTION_vsync;0 OPTION_depth;True OPTION_fog;True OPTION_blur;True OPTION_bloom;True OPTION_exposure;False OPTION_skybox;True OPTION_particles;True OPTION_space_traffic;True OPTION_station_traffic;True OPTIONS_ui_color_1;0.8,1.0,0.8,1.0 OPTIONS_ui_color_2;0.8,1.0,1.0,1.0 OPTIONS_ui_color_3;0.8,1.0,0.8,1.0 OPTIONS_ui_color_4;1.0,1.0,1.0,1.0 OPTIONS_open_panels;False OPTIONS_open_panels_state;0,0,0,0,0,0,0,0,0,0 OPTIONS_galaxy_box;0,0,0 OPTIONS_tactical_box;0,0,0 //AUDIO OPTIONS OPTION_music_vol;0.25 OPTION_soundfx_vol;0.5 OPTION_ui_vol;0.5

Since you can change this in the game, we will ignore all of this. As a side note, you can use this to setup your new game defaults. This also applies to the last bit of code in the file which is:

// HOTKEYS KEY_OPTIONS_forward;W KEY_OPTIONS_left;A KEY_OPTIONS_right;D KEY_OPTIONS_reverse;S KEY_OPTIONS_lshift;LeftShift KEY_OPTIONS_action;C KEY_OPTIONS_clear_all_targets;H KEY_OPTIONS_autopilot_toggle;E KEY_OPTIONS_autotarget_toggle;Y KEY_OPTIONS_autodock_toggle;U KEY_OPTIONS_autowarp_toggle;I KEY_OPTIONS_autoscan_toggle;O KEY_OPTIONS_options_toggle;Escape KEY_OPTIONS_pilot_toggle;L KEY_OPTIONS_map_toggle;M KEY_OPTIONS_gps_toggle;G KEY_OPTIONS_auto_afterburner;CapsLock KEY_OPTIONS_system_toggle;V KEY_OPTIONS_cargo_toggle;Tab KEY_OPTIONS_targeting_toggle;T KEY_OPTIONS_stats_toggle;Z KEY_OPTIONS_autopilot_panel_toggle;R KEY_OPTIONS_camera_slowzoom_in;Equals KEY_OPTIONS_camera_slowzoom_out;Minus KEY_OPTIONS_scan;Q KEY_OPTIONS_alt_camera_view;LeftAlt KEY_OPTIONS_tactical_overlay_toggle;Space KEY_OPTIONS_fleet_toggle;F KEY_OPTIONS_ship_toggle;J KEY_OPTIONS_ls_toggle;K KEY_OPTIONS_camera_fov;Keypad7 KEY_OPTIONS_camera_lock;Keypad8 KEY_OPTIONS_camera_release;Keypad5 KEY_OPTIONS_camera_ui;Keypad9 KEY_OPTIONS_allmodules_on;Z KEY_OPTIONS_allmodules_off;X KEY_OPTIONS_friendly_fire;F KEY_OPTIONS_allmodules_target;C KEY_OPTIONS_drones_launch;B KEY_OPTIONS_drones_dock;V

This is all code that we can ignore since you can set this up inside that game. The only exception is for when you want your new game to have specific defaults instead of changing them yourself each time you start a new game. So this leaves of with the code in the middle of the file.
1-6 Editing Saved Games (continued)
The final part of code we will look at, which is extensive, is as follows:

// WORLD OPTIONS WORLD_OPTIONS_star_recharge_rate;2.0 WORLD_OPTIONS_lifesupport_drain_rate;0.5 WORLD_OPTIONS_harvest_rate;4.5 WORLD_OPTIONS_chance_crate_item_drop;80 WORLD_OPTIONS_chance_module_takes_damage;25 WORLD_OPTIONS_repair_armor_modfier;1.0 WORLD_OPTIONS_repair_module_modfier;1.0 WORLD_OPTIONS_tax_rate;0.03 WORLD_OPTIONS_storage_lease_space;75.0 WORLD_OPTIONS_storage_lease_cost;1.0 WORLD_OPTIONS_fraction_drop_per_shot;0.001 WORLD_OPTIONS_fraction_drop_per_kill;0.050 WORLD_OPTIONS_raider_spawn_timer;300.0 WORLD_OPTIONS_stats_notify_timer;45.0 WORLD_OPTIONS_mission_bonus_value;0.009 WORLD_OPTIONS_mission_bonus_size;0.04 WORLD_OPTIONS_mission_pay_modifier;1.82 WORLD_OPTIONS_merc_death_faction_penalty;1.0 WORLD_OPTIONS_ship_slow_distance;250 WORLD_OPTIONS_death_penalty;1 WORLD_OPTIONS_game_speed;1.2 WORLD_OPTIONS_buyorder_profit_margin;0.10 WORLD_OPTIONS_sellorder_profit_margin;0.6 WORLD_OPTIONS_resource_respawn;1.0 WORLD_OPTIONS_autocam_rotate_timer;60.0 WORLD_OPTIONS_raider_speed;1.0 WORLD_OPTIONS_raider_attack;1.0 WORLD_OPTIONS_raider_defense;1.0 WORLD_OPTIONS_dock_fee_modifier;1.0 WORLD_OPTIONS_gate_fee_modifier;1.0 WORLD_OPTIONS_economic_gen_rate;1.0 WORLD_OPTIONS_mission_gen_rate;1.0 WORLD_OPTIONS_fraction_drop_per_abort;0.025 WORLD_OPTIONS_station_refinery_speed;1.0 WORLD_OPTIONS_station_fabricator_speed;1.0 WORLD_OPTIONS_station_university_speed;2.0 WORLD_OPTIONS_merc_payroll_rate;1.0 WORLD_OPTIONS_merc_faction_hire_modifier;1.0

2-0 Understanding the Item Database
2-1 Items: Active Modules
2-2 Items: Passive Modules
2-3 Items: Resources
2-4 Items: Materials and Components
2-5 Items: Support
2-6 Items: Trade
2-7 Items: Ammo
2-8 Items: Documents
3-0 Adding/Editing Player Ships
3-0-1 Ship Main Variables
A breakdown of the Ship Main Variables

SHIP_skill_level;(1-10)

This is the required level of the relevant piloting skill necessary for the player to pilot the ship.

SHIP_filename;(string)

This is the filename that is used to reference the ship.

SHIP_id;(int)

This is the ID number of the ship.

(NOTE: It is VERY important that each object in a category has a unique ID. Failure to give an object a unique ID causes an assortment of issues. This ID number can (to my knowledge) be any positive 32bit integer, but there is a hard coded limit of 5000 'ITEMS' in the game, of which ships are a part of that category.)

SHIP_name;(string)

The name of the ship, as it will be displayed in game.

SHIP_class;(string)

The class of the ship. This essentially determines what skill is required to fly the ship.

(Modders note: Untested, but it would seem, from the code, that you can put whatever you want here, to create new classes of ships. Just remember to create the appropriate Piloting Skill to match it, else you won't be able to fly it.)

SHIP_base_shield;(int32(64?))

The base Capacity of the ship's Shields, before any skill or module modifiers take effect.

SHIP_base_armor;(int32)

The base Capacity of the ship's Armor, before any skill or module modifiers take effect.

SHIP_base_energy;(int32)

The base Capacity of the ship's Energy, before any skill or module modifiers take effect.

SHIP_base_cargo;(int32)

The base Capacity of the ship's Cargo, before any skill or module modifiers take effect.

SHIP_base_speed;(int32, but leave it at 0)

Deceptively named, this is actually the variable that tracks the ships *current* speed.

(Note: This could be the 'adjusted' base speed that is calculated from mass and thrust, which would be used for things like afterburner calculations)

SHIP_base_turn;(int32)

The base Turn Rate of the ship, as measured in centifeetometers per parsec.

SHIP_base_thrust;(int32)

The base Thrust of the ship. (Presumably, Top Speed, without afterburners, is a quotient of Thrust divided my Mass. Untested.)

SHIP_base_mass;(int32)

The base Mass of the ship, before skill and module modifiers take effect.

SHIP_collider_x;(float)

The X-axis size of the ship's collision box.

SHIP_collider_y;(float)

The Y-axis size of a ship's collision box.

SHIP_collider_z;(float)

The Z-axis size of a ship's collision box.

SHIP_active_slots;(int32)

The number of Active Module slots the ship has.

SHIP_passive_slots;(int32)

The number of Passive Module slots the ship has.

SHIP_base_lifesupport;(int32)

The base Capacity of the ship's Life Support systems, before any skill or module modifers take effect.

SHIP_base_engine_burn;(float)

The base rate at which Energy is consumed by the ship's Engine, before skill and module modifiers take effect.

(Note: Presumably, this number is multiplied by your speed to calculate the energy per second usage of the engines.)

SHIP_base_recharge;(float)

The base rate at which the ship's Energy recharges, in units per second.

SHIP_base_scan_speed;(float)

The base Scan Speed of the ship, before skill and module modifiers take effect.

SHIP_base_scan_max_targets;(int32)

The base number of targets that the ship can have locked in the target list.

SHIP_base_scan_pulserange;(int32)

The base Max Range of the ship's Pulse Scanner.

SHIP_base_scan_pulsespeed;(int32)

The base Scan Speed of the ship's Pulse Scanner

SHIP_type;(string)

The archetype of the ship.

SHIP_base_price;(int32)

The base Price of the ship, before station and faction modifiers.

SHIP_impact_resistance;(float)

The ship's Damage Resistence to Ballistic Type weapons.

SHIP_energy_resistance;(float)

The ship's Damage Resistence to Energy Type weapons.

SHIP_explosive_resistance;(float)

The ship's Damage Resistence to Explosive Type weapons.

SHIP_engine_color;(0-255);(0-255);(0-255);(0-255)

The ship's Engine glow and trail color.

SHIP_description;(string)

The description of the ship.

SHIP_manufacturer;(string)

The manufacturer of the ship.

SHIP_manufacturer_icon;(string).png

The icon of the ship's manufacturer.

SHIP_shield;(float)

The ship's current Shield. (Leave at 0, as this is adjusted dynamically in-game.)

SHIP_armor;(float)

The ship's current Armor. (Leave at 0, as this is adjusted dynamically in-game.)

SHIP_energy;(float)

The ship's current Energy. (Leave at 0, as this is adjusted dynamically in-game.)

SHIP_ls_food;(float

The ship's current Food Life Support level. (Leave at 0, as this is adjusted dynamically in-game.)

SHIP_ls_water;float

The ship's current Water Life Support level. (Leave at 0, as this is adjusted dynamically in-game.)

SHIP_ls_thermal;float

The ship's current Thermal Life Support level. (Leave at 0, as this is adjusted dynamically in-game.)

SHIP_ls_waste;(float)

The ship's current Waste Life Support level. (Leave at 0, as this is adjusted dynamically in-game.)

SHIP_base_drones;(int32)

The base number of Drones the ship can control.

// Merc Stats: The following stats are only relevant on Merc ships, and, tmk, will not have any bearing on Player ships.

SHIP_owner;(string)

(Untested) The owner (Pilot) of the ship.

SHIP_xp;(int32)

The current XP of the Merc ship.

SHIP_next_level_xp;(int32)

The XP required for the Merc ship to level up.

(Note:I'll have to test/look at the code to see how XPTNL progression is set up)

SHIP_level;(int32)

The level of the Merc ship.

SHIP_talent;([Talent_Type])

(NOTE: compile a list of ship talent types)

The talent of the Merc Ship. This determines equipment loadout, and what events affect morale.

SHIP_loyalty;(float, 0-1)

The current Loyalty of the Merc ship, in %.

SHIP_payroll;50

The amount of credits per day that the Merc ship gets paid.

(NOTE: Look up how long one game day is)

SHIP_pilot_face_1;(string).png

The image file for the Merc's face.

SHIP_pilot_face_2;(string).png

The image file for the Merc's face accesory

SHIP_morale;(float, 0-1)

The current Morale of the Merc Ship, in %.
3-0-2 Ship Parts
This section of the guide will cover the rest of the Ship Data, including Ship Parts, Active and Passive Modules, the Pilot Cam, Cargo, and Drones.


Ship Parts

We'll start by taking a look at Ship Parts, the blocks that make up the physical appearance of the ship:

//; --------------------------------- SHIP PARTS ----------------------------------- //; --------------- ITEM,type,catID,pfID,xp,yp,zp,xr,yr,zr----------------------------- <ITEM> ITEM;Hull_medium_3; 4 ; 7 ;0.00;-1.25;4.46;0.00;0.00;180.00

Breaking it down to individual pieces:

ITEM;(ITEM)

This is the object header.

type;(string)

The name of the Ship Part.

catID;(int32)

The category ID of the Part.

(Modders note: Compile a table of the category ID data.)

pfID;(int32)

The part file ID of the Part. This determines the actual block that lods up.

xp,yp,zp;(float),(float),(float)

The X, Y, and Z positional coordinates of the part (at the center of the part).

xr,yr,zr;(float),(float),(float)

The X, Y, and Z rotations of the part.

(Modders note: It would seem that any object can be placed in as an item, including pilot cams, modules, etc...and it won't throw errors. However, non item ITEMS added this was will be non functional/purely decorative.)


Ship Camera Slots

Next, we'll look at the Pilot Camera.

Example:
//; ----------------------------- SHIP CAMERA SLOTS -------------------------------- //; -------------- PILOTCAM,name,SLOTid,model_id,xp,yp,zp,xr,yr,zr-------------------- <PILOTCAM> PILOTCAM;pilot_cam; 5 ; 98 ;0.00;-0.30;10.59;0.00;0.00;0.00

PILOTCAM;(PILOTCAM)

This is the object header.

name;(pilot_cam)

The name of the Pilot Cam.

(Note: presumably, this has to be 'pilot_cam')

SLOTID;(5)

The Slot ID of the Pilot Cam.

(Note: Presumably, this has to be '5')

model_id;(98)

The Model ID of the Pilot Cam block.

xp,yp,zp;(float),(float),(float)

The X, Y, and Z positional coordinates of the Pilot Cam.

xr,yr,zr;(float),(float),(float)

The X, Y, and Z rotations of the Pilot Cam.


Ship Module Slots

This is where we set the properties of the Active Module slots on the ship.

Example:
//; ----------------------------- SHIP MODULE SLOTS -------------------------------- //; ----------------------- SLOT,slotID,(slotNumber,ammoID)*,xp,yp,zp,xr,yr,zr------------------------------- <MODSLOT> MODSLOT;module slot 1;1; 99 ;0.00;1.67;5.31;0.00;0.00;0.00 *: These are not listed on vanilla files at the time of writing this, but are represented in the data.

MODSLOT;(MODSLOT)

This is the object header.

slotID;("module slot (int32)")

The slotID name for the MODSLOT. Some very important notes here:

1) You cannot have more MODSLOTS than you have set in SHIP Main Vars [SHIP_active_slots]. Attempting to do so will convert all MODSLOTs over the count to ITEMS, rendering them unusable.

2) Each MODSLOT needs it's own unique numeric identifier (i.e. module slot 1;module slot 10), and should probably just be kept sequential from 1-x.

slotNumber;(int32)

The Slot Number of the MODSLOT. (Note: Look into this to see if this is just an internal reference number, or keybinds.) Keep this number the same as the slotID number.

ammoID;(int32)

The Ammo ID number of the MODSLOT. Determines what ammo type is consumed by the slot.

(Modders note: Compile a reference table of ammo types.)

xp,yp,zp;(float),(float),(float)

The X, Y, and Z positional coordinates of the MODSLOT.

xr,yr,zr;(float),(float),(float)

The X, Y, and Z rotations of the MODSLOT.


Ship Modules

Not to be confused with MODSLOTS, this is where we set the Active and Passive Modules of the ship.

Example:
//; ----------------------------- SHIP MODULES -------------------------------------- //; ----- MODULE,slot,module_id,(ammoType)* <MODULE> MODULE; 1 ; 1202;0 PMODULE; 1 ; 1532 *: This is not listed in vanilla files at the time of writing this, but is represented represented in the data for Active (Weapon?) Modules.

It is important to note the difference between MODULE (Active Modules) and PMODULE (Passive Modules), as putting the wrong type in the wrong slot could lead to issues.

MODULE/PMODULE;(MODULE/PMODULE)

This is the object header.

slot;(int32)

The Slot Number of the MODULE/PMODULE.

module_id;(int32)

The Module ID number of the MODULE/PMODULE.

ammoType;(int32)

the Ammo Type ID of the MODULE.


Ship Cargo

Example:
//; ----------------------------- SHIP CARGO ----------------------------------------- //; ----- CARGO, qty, cargo_id <CARGO> CARGO; 2 ; 703

CARGO;(CARGO)

This is the object header.

qty;(int32)

This is the Quantity of the Cargo Item.

cargo_id;(int32)

This is the Cargo ID number of the Cargo Item.


Ship Drones

Example:
//; ----------------------------- SHIP DRONES ----------------------------------------- //; ----- DRONE, id, hp, energy <DRONE> {Fill this in with a drone's info}

DRONE;(DRONE)

This is the object header.

id;(int32)

This is the Type ID of the Drone.

hp;(int32)

This is the Current HP of the Drone.

energy;(int32)

This is the Current Energy of the Drone.
3-1 Adding/Editing NPC Ships
Same as Player Ships, with one main difference.

In the SHIP Main Vars, for NPC ships, there is a parameter labeled faction_id, which, as you may have guessed, sets the faction of the NPC ship.

faction_id;(int32)

The faction ID of the NPC ship. Presumably, must be a value that exists in the factions DB.
4-0 Adding/Editing Stations
4-0-1 Station Main Variables
Station Main Vars

Example;

STATION;id;0 STATION;name;Biomate University STATION;type;Academic University STATION;owner;Telyoupea Akpi STATION;faction;Alpha STATION;material;station_material_Alpha.png STATION;color;1 , .46, .19, 1 STATION;level;2 STATION;icon;biomate.png STATION;filename;sector_0_station_0.txt STATION;max_hp;25000 STATION;dockfee;0 STATION;lease;30 STATION;seed;4-8-1-5-5-2-9-1-2-6-3-1-1-5-4-1-2-1-4-4-0-4-0 STATION;interior_seed;3-0-15-8

id;(int32)

The internal ID of the station, zero-indexed by Sector. (i.e. the first Station in each Sector is ID=0, next is ID=1, and so on)

name;(string)

The name of the Station.

type;(string)

The type of the station.

(Note: Need to check to see if this is purely descriptive or not.)

owner;(string)

The name of the NPC who owns the Station.

faction;(string)

The name of the Faction the Station is affiliated with.

material;(string)

The material that covers the outside of the Station.

color;(float, 0-1) ,(float, 0-1), (float, 0-1), (float, 0-1)

The RGBA* (Red/Green/Blue/Alpha) of the Material of the Station.

(*: Could be CMKY...I'll have to inquire)

level;(int32)

The level of the station.

(Note: At the time of writing this, I have no idea what it actually affects)

icon;(string)

The icon file of the Station's billboard.

filename;(string)

The filename of the Station. Its good practice to follow the current naming convention, though I don't know that you have to.

max_hp;(int32)

The Max HP of the Station.

dockfee;(int32)

The docking fee for a station, before an adjustments from Faction Rating.

lease;(int32)

seed;(#-#-#...)

Some sort of magic on Momoguru's behalf that assembles specified parts and makes them not look like garbage.

interior_seed;(#-#-#)

As above, but for the inside of the Station.

4-0-2 Station Stuff (In Progress)
Station Services

Example:
Station Services
SERVICES;lounge;True SERVICES;market;True SERVICES;refinery;True SERVICES;garage;True SERVICES;university;True SERVICES;hangar;True SERVICES;storage;True SERVICES;fabricator;True SERVICES;contracts;True SERVICES;admin;True

Based on context throughout the files, it would seem that you have to list all of the Services on every Station, and set them to True/False.

SERVICES;(SERVICES)

This is the Object Header

{service type};(string)

The Type of Service.

bool;(True/False)

Whether or not the Station has this Service.



Station Entertainment

Example:
// ENTERTAINMENT;title;bonus morale, bonus loyalty;price;type;image;description ENTERTAINMENT;Bottle of Whiskey;0.025,0.0;850;Whiskey;entertain_bar.png;Purchase a bottle of whiskey for each of your fleet members. 2.5% Morale bonus.

ENTERTAINMENT;(ENTERTAINMENT)

This is the Object Header

title;(string)

The Title/Name of the Entertainment.

bonus morale;(float, 0-1)

The amount of Morale that this Entertainment adds to your Mercs.

(Note: '1' is 100%.)

bonus loyalty;(float, 0-1)

The amount of Loyalty that this Entertainment adds to your Mercs.

(Note: '1' is 100%.)

price;(int32)

The price of the Entertainment, before any modifiers.

type;(string)

The Type of the Entertainment. Presumably, different types of Entertainment affect different Merc Archetypes.

image;(string)

The image file of the Entertainment.

description;(string)

The description of the Entertainment.

(Note: Find out the upper limit of characters allowed.)

Station Mercs

Example:
// MERC;level;Price_modifier;Ship_filename <MERC> MERC;1;1.63;npc_ship_data_(recon_carrier_1).txt

MERC;(MERC)

This is the Object Header.

level;(int32)

The initial Level of the Merc.

Price_modifier;(float)

The Price Modifier for the Merc.

(Note: Look up cost formula for Mercs.)

Ship_filename;(string)

The filename of the NPC ship the Merc will use.



Station Market

Broken down into three parts: ITEM, BUYORDER, and SELLORDER.

ITEM Example:
// MARKET;Item_id;Qty;Price_modifier <MARKET> ITEM;1750;15;1.10

ITEM;(ITEM)

This is the Object Header.

Item_id;(int32)

The Item ID of the Market Item.

Qty;(int32)

The Quantity of the Market Item.

Price_modifier;

The base Price Modifier of the Market Item.


BUYORDER Example:
// MARKET;orderDescription;items((ItemID)x(ItemQty),...);totalValue;adjustedPrice <MARKET> BUYORDER;Market Demands: (95) Cleaning Chemicals;300x95,2015x73,2074x15,703x40,730x117,;1289811.00;116632.80

BUYORDER;(BUYORDER)

This is the Object Header.

orderDescription;(string)

The description of the Buy Order.

items;((ItemID(int32))x(ItemQty(int32))

The Item(s) and Quantity of each required to fulfill the Buy Order.

totalValue;(float)

The combined value of the Items in the Buy Order.

adjustedPrice;(float)

The Adjusted Price of the Buy Order.


SELLORDER Example;
// MARKET;Item_id;Qty;Price_modifier <MARKET> SELLORDER;For Sale: (9) Small Repair Drone Specs;2610x9,2614x8,2132x7;2949991.00;145995.00

SELLORDER;(SELLORDER)

This is the Object Header.

orderDescription;(string)

The description of the Sell Order.

items;((ItemID(int32))x(ItemQty(int32))

The Item(s) and Quantity of the player will receive upon purchasing the Sell Order.

totalValue;(float)

The combined value of the Items in the Sell Order.

adjustedPrice;(float)

The Adjusted Price of the Sell Order.



Station Skills

Example:
// SKILLS;Skill_id;Price_modifier <SKILLS> SKILL;210;2.23

SKILL;(SKILL)

This is the Object Header.

Skill_id;(int32)

The ID of the Skill.

Price_modifier;(float)

The Price Modifier of the Skill.


(Incomplete)
Station Missions

Example:
// MISSION , dbid , timer, id, data, title, factionid <MISSIONS> MISSION;82;120;336082;RECOVER#1000#2501#sector_14.txt#sector_0_station_5.txt#null#null#null#null;Retrieve a light cache of Electrical and Optical Harness Specs(s)'s from a crate in Gate of Alpharis sector, drop at Proctors Center in Void Starcross;9;After a skirmish in Gate of Alpharis, the Temple's Buean Yerfaega cannot account for a light shipment of Electrical and Optical Harness Specs(s) he was transporting before the attack. Head out to the (SECTOR_1) sector and look for the crate. When found, take the contents of the crate back to the Proctors Center station in the Void Starcross sector.;2938

MISSION;(MISSION)

This is the Object Header.


(Incomplete, still needs player owned ship)
Station Hangar

Ships for sale Example:
// SHIP HANGAR;count;Price_modifier;Ship_filename <HANGAR> SHIP;1;1;ship_data_(battle_escort_3).txt

SHIP;(SHIP)

This is the Object Header.

count;(int32)

The amount of the ship available for sale.

Price_modifier;(float)

The Price Modifier of the Ship.

Ship_filename;(string)

The filename of the ship.



Station Office

Example:
// OFFICES;office_name;npc_name;faction_id;faction_req;level;img;scripting_file;scripting_id; <OFFICE> OFFICE;(Tutorial Office) Camera Basics;Ratamaq Guru;1;0.0;26;station.png;male_2.png;accessory_18.png;tutorial_camera_basics.txt;2

OFFICE;(OFFICE)

This is the Object Header.

office_name;(string)

The Name of the Office. Presumably used to 'call' them.

npc_name;(string)

The Name of the NPC at the Office.

faction_id;(int32)

The ID of the Faction affiliated with the office.

faction_req;(float)

The ID of the Faction affiliated with the office.

level;(int32)

The level of the Office mission.

img;(string)

The image file for the face of the NPC in the Office.

scripting_file;(string)

The Scripting File to use for the Office.

scritping_id;(int32)

The ID of the Script File to be used for the Office.



Station Storage

Example:
// STORAGE;item_id;Qty;0 <STORAGE> STORAGE;500;1;0;FABRICATOR STORAGE;1;4644;0;

STORAGE;(STORAGE)

This is the Object Header.

item_id;(int32)

The ID of the Item.

Qty;(int32)

The Quantity of the Item.

0;(?)

A placeholder for something? I have no idea :P

FABRICATOR;(FABRICATOR){optional}

This determines if the Item is in the fabricator. Leave blank for normal storage.
5-0 Adding/Editing Sectors
6-0 Adding/Editing Structures
7-0 Adding/Editing Skills
8-0 Adding/Editing Medals
9-0 Adding/Editing Factions
10-0 Adding/Editing Events
11-0 Adding/Editing Scripts
27 Comments
Mal Nov 6, 2023 @ 11:30pm 
given the age of this guide, is it still relevant today?
setonix26 Mar 3, 2020 @ 8:21am 
It looks very cumbersome using excel. With some simple vbscripting you can easily update and read the database textfiles. I created a report to get the highest and lowest product space stations per product for instance
Kjell  [author] Dec 12, 2019 @ 9:08am 
Before importing any txt into Excel, press the tab key in the txt file and then highlight the tab (the blank space that the tab key creates) and go to edit>find/replace. It will show the tab (blank space) as what to find/replace, so click and highlight the "replace with" and simply press the backspace key then hit "replace all" button.

This will replace all the tabs in the document with nothing (essentially deleting all the tabs in the entire document). Save the txt then import into Excel. This will prevent the issues outlined below, with odd quotes and alignment issues.

Excel apparently doesn't ignore tab use inside of documents. Hopefully this helps. I'll eventually update the guide to include this information and step.
reanor Dec 11, 2019 @ 10:18am 
the problem I am having that after exporting all that into a txt file, I have a lot of quotations in file like ";" and the game won't start passed the point where the tutorial needs to load.
reanor Dec 11, 2019 @ 7:52am 
no matter what I try though, I still can't get it exported like on your pictures... my columns are not labeled properly, etc...
reanor Dec 11, 2019 @ 7:49am 
Delimeter has to be Semicolon and shouldn't be using any DataTypes, at least in my case with Excel 2019... If he separates entries with semicolon, why would a Delimeter be TAB?
Kjell  [author] Nov 20, 2019 @ 8:55am 
I'll write something up that explains the process a bit better. Basically I created a system that uses "points" for every ship stat. Each class has a "Max points available" and "ship class multiplier". Each stat, ei one shield point or one active module slot, costs a specific amount of points. The ship cost is calculated by adding all the "points" and multiplied by the "ship class multiplier".

I'll write up a detailed document on how this works and how to determine those variables.
Kjell  [author] Nov 20, 2019 @ 8:47am 
I used the existing ships, getting the averages for stats for each class. IE add all the frigate prices then divide by total frigates. Do that for each stat, then I add all those stats together and divide by average price. That gives me the price per stat.

I can use that to calculate any new ship price based on it's stats.

As for getting the stats, I take the average stat, ie average frigate shield, then multiply by -0.15/0.15 to get a range to use for new ships of that class. 15% plus/minus of the average of that class of ship.

That was merely my method, which mostly works, and then make small changes after that, basically fine tune after the auto generation is done. It will help get a solid starting point.
Kjell  [author] Nov 20, 2019 @ 8:47am 
I created my own version for calculating stats, but at this time it is over a year old and very outdated. Plus, it was done in Excel format. Jace, Momoguru, recently hinted at his own ship calculator coming out very shortly.

With that, I would see what it looks like first. Otherwise, I can share my process on how I created my own version, that way you can adapt it into whatever format/code that works best for you.

I can give you my formulas, instead of an Excel document. I basically created a formula for each ship class. So you just pick the class and the formula does the rest.
marxcie Nov 20, 2019 @ 4:47am 
Hey, I know you're making ship mods as well, do you have by any chance a ship properties/calculation form?

I tried to write my own, but it's just not really fitting to all the scenarios, still working on it, trying to incorporate more factors in to the price calculation, but if you'd have anything that fits to the system it would be great.

Here's my calculation sheet: https://jsbin.com/zabijik/edit?js,output
(I'm not familiar with excel, so it's a very simple js)