Hey Mates
I wasn't active as a modder since lile 2019 or so - but now I decided to finish some old projects.
Sadly I don't have that much spare time because life happens, and my modding skills are already quite rusty.
What I want to do is an event that creates an custom event ship. I can do the event and all, but have no idea about the ship templates.
I want to have an corvette size ship with 2x S and 1x M weapon slots and like 2x M defense slots.
Is it possible to get such a thing? It shouldn't be desigable or buildable, just to be spawned with an event (like Dark Wanderer).
Any advice how to start, whichs files I need or at best, a working code to achieve that, would be sooo great
Best wishes!
I know how to make a event ship but often times the ai tries to build them. Here is what I know:
To make an event ship you need to do a couple things:
1) pick an existing ship you want to edit - in your case the corvette.
2) copy corvette.txt into your mod from common\section_templates\corvette.txt
3) edit the corvette.txt using a text editor and copy the first template in the file and paste it at the end.
4) In your new template:
a) change the key = "CORVETTE_MID_M1S1" to something new like "CORVETTE_MID_FRED"
b) note that this ship has only one entity - mid as in fits_on_slot = mid while other ships may have bow mid and stearn.
c) change the ai_weight section to 0 so hopefully the ai will not try to build it.
d) change the component slots to be what you want. Keep the locator names. Note multiple guns can use the same locator slot. You can look at the other templates for ideas.
e) if you add too many guns you might not have enough power. Same if you add too many utility slots etc. You have to just do trial and error or pull it up in ship designer in game to see it all looks good.
5) once you have your template done you then copy into your mod event_ship_designs_general.txt from common\global_ship_designs
a) search for # Generic Corvette and copy that section to the bottom
b) edit your new copied section and change the name = "NAME_Dagger" to something else like "NAME_Fred" IMPORTANT: the game will save this new design in the save game someplace and if you make changes to the design the stupid game will ignore your changes. If you try the design out in a game and then you want to make changes you either have to start a new game OR change the name to "NAME_Fred2"
c) change the template = to match your name from 4a
d) edit the component slots to match your template from 4 above using the same number and slot names but enter the actual weapons you want.
6) In a event you can do something like:
capital_scope = {
create_fleet = {
name = "Enterprise TG1"
effect = {
set_owner = root
create_ship = {
name = random
design = "NAME_Earth_Titan_DM2"
graphical_culture = "humanoid_01"
}
create_ship = {
name = random
design = "NAME_Earth_Missilecruiser_DM"
graphical_culture = "humanoid_01"
}
create_ship = {
name = "Enterprise"
design = "NAME_Earth_Carrier_DM2"
graphical_culture = "humanoid_01"
}
while = {
count = 20
create_ship = {
name = random
design = "NAME_Earth_Battleship_DM"
graphical_culture = "humanoid_01"
}
}
owner = {
create_leader = {
class = admiral
species = owner
name = random
skill = 5
traits = { trait = random_trait trait = random_trait }
}
}
assign_leader = last_created_leader
}
}
}
except you use your name from 5b above and if you change the name at some point due to making changes you have to also change it in the event.
7) If you want to create a new type of ship then you have to change some other files in common and in graphics and you will need to ask for more help.
At this point you should be able to try to make something work.
