• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

LiamRiordan

The Rambling KR Player
70 Badges
Aug 4, 2008
2.184
137
  • 500k Club
  • Stellaris: Nemesis
  • Stellaris: Apocalypse
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Holy Fury
  • The Showdown Effect
  • Warlock: Master of the Arcane
  • War of the Roses
  • Hearts of Iron IV: Colonel
  • Stellaris: Humanoids Species Pack
  • Stellaris: Lithoids
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Steel Division: Normandy 44 Deluxe Edition
  • Battle for Bosporus
  • Stellaris: Ancient Relics
  • Steel Division: Normandy 44
  • Crusader Kings II: Rajas of India
  • Cities: Skylines - Parklife
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Necroids
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV
  • Stellaris: Distant Stars
  • Stellaris: Federations
  • Hearts of Iron IV: Field Marshal
  • Semper Fi
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Res Publica
  • Magicka
  • Leviathan: Warships
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Dungeonland
  • Darkest Hour
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
So after learning that there were somewhat successful anti-ship missiles in WWII, I thought that it could be a good replacement or possible new branch in 1.3 if I heard right, we can create a lot more brigades and units.

Here is a ASM wiki:
http://en.wikipedia.org/wiki/Ship_to_ship_missile

So anyway, I've never made new technology or units before so I'm running in the dark and making assumptions about it.

Here is some very early code:

ASM - Brigade stats
Code:
# 0 - Early Short Range ASM
model = {
    cost                        = 1.0
    buildtime                    = 200
    manpower                    = 0.0
    surfacedetectioncapability    = 0
    airdetectioncapability        = 0
    subdetectioncapability        = 0
    airdefence                    = 0
    seaattack                    = 2
    convoyattack                = 6
    subattack                    = 0
    airattack                    = 0
    shorebombardment            = 0
    distance                    = 2
    supplyconsumption            = 0.8
    fuelconsumption                = 0
    upgrade_time_factor            = 1.0
    upgrade_cost_factor         = 1.0
}

# 1 - Improved Short Range ASM
model = {
    cost                        = 1.2
    buildtime                    = 200
    manpower                    = 0.0
    surfacedetectioncapability    = 0
    airdetectioncapability        = 0
    subdetectioncapability        = 0
    airdefence                    = 0
    seaattack                    = 4
    convoyattack                = 8
    subattack                    = 0
    airattack                    = 0
    shorebombardment            = 0
    distance                    = 4
    supplyconsumption            = 0.8
    fuelconsumption                = 0
    upgrade_time_factor            = 1.0
    upgrade_cost_factor         = 1.0
}

# 2 - Medium Range ASM
model = {
    cost                        = 1.4
    buildtime                    = 200
    manpower                    = 0.0
    surfacedetectioncapability    = 0
    airdetectioncapability        = 0
    subdetectioncapability        = 0
    airdefence                    = 0
    seaattack                    = 6
    convoyattack                = 10
    subattack                    = 2
    airattack                    = 0
    shorebombardment            = 0
    distance                    = 6
    supplyconsumption            = 1.0
    fuelconsumption                = 0
    upgrade_time_factor            = 1.0
    upgrade_cost_factor         = 1.0
}
# 2 - Long Range ASM
model = {
    cost                        = 2.0
    buildtime                    = 240
    manpower                    = 0.0
    surfacedetectioncapability    = 0
    airdetectioncapability        = 0
    subdetectioncapability        = 0
    airdefence                    = 0
    seaattack                    = 8
    convoyattack                = 14
    subattack                    = 4
    airattack                    = 0
    shorebombardment            = 0
    distance                    = 10
    supplyconsumption            = 1.5
    fuelconsumption                = 0
    upgrade_time_factor            = 1.0
    upgrade_cost_factor         = 1.0
}

Early technology stuff:
Code:
########
Draft ASM Technology
########

# Anti-Ship Missile Concept
  application =
  { id        = 8500
    name      = TECH_APP_SW_12_NAME

    position  = { x = 552 y = 203 }
    picture   = "7120"
    year      = 1944
    # Early Naval Missile Battery System
    component = { id = 7121 name = TECH_CMP_SW_12_1_NAME type = rocketry difficulty = 10 }
    # Early Airframe Missile Racks
    component = { id = 7122 name = TECH_CMP_SW_12_2_NAME type = aeronautics difficulty = 8 }
    # Multi-stage Test Flights
    component = { id = 7123 name = TECH_CMP_SW_12_3_NAME type = aeronautics difficulty = 8 }
    # Early Radio Guidance System
    component = { id = 7124 name = TECH_CMP_SW_12_4_NAME type = electronics difficulty = 9 }
    # Early Short Range ASM Testing
    component = { id = 7125 name = TECH_CMP_SW_12_5_NAME type = technical_efficiency double_time = yes difficulty = 10 }
    required  = { 7110 }
    effects =
    { command = { type = new_model which = ASM value = 1 }
    }
  }
  
  # Anti-Ship Missile Improvements
  application =
  { id        = 8510
    name      = TECH_APP_SW_12_NAME

    position  = { x = 552 y = 203 }
    picture   = "7120"
    year      = 1945
    # Naval Missile Battery System
    component = { id = 7121 name = TECH_CMP_SW_12_1_NAME type = rocketry difficulty = 10 }
    # Airframe Missile Racks
    component = { id = 7122 name = TECH_CMP_SW_12_2_NAME type = aeronautics difficulty = 8 }
    # Improved Fuel Supply
    component = { id = 7123 name = TECH_CMP_SW_12_3_NAME type = aeronautics difficulty = 8 }
    # Improved Radio Guidance System
    component = { id = 7124 name = TECH_CMP_SW_12_4_NAME type = electronics difficulty = 9 }
    # Improved Short Range ASM Testing
    component = { id = 7125 name = TECH_CMP_SW_12_5_NAME type = technical_efficiency double_time = yes difficulty = 10 }
    required  = { 7110 }
    effects =
    { command = { type = new_model which = ASM value = 2 }
    }
  }

I do know that I need to learn a lot more, like how to position the technology correctly, and with the component id's, will they need to be completely unique? Where are the technology names kept? Is there a document I can look at?

Also, would this type of technology be warranted in vanilla or any mod?
 
Looks good so far.
In 1.03, there are 2 files where you can define brigades and divisions types. It'll just take you a few minutes.. If you want to get your mod ready for 1.03 (which is still months away, so not sure it's worthy), feel free to send us an email (no PM please) and we can send you the relevant file.
 
I do know that I need to learn a lot more, like how to position the technology correctly, and with the component id's, will they need to be completely unique? Where are the technology names kept? Is there a document I can look at?
You can enter "showxy" in the console to get a rough idea on the coordinates you want, the rest is just finetuning.
Component ids need to be unique, but you can reuse namestrings if you want, it's a bit lazy if you do, i think each tech deserves it's uniquely named component. :)
Technology names are kept in the tech_names.csv.
A list of all valid components is in Darkest Hour\Modding documentation\Technology components.csv
Alist of all used Technolog ids is in Darkest Hour\Modding documentation\Darkest Hour Technology ID's.txt



Also, would this type of technology be warranted in vanilla or any mod?

imo, yes.
 
Waaa, it's almost overwhelming how many things I need to change and add just to let me try and test one brigade... I need to make a step-by-step list of what I should do first before doing something else... I keep going back and forth between things.

I've had a look at the documents you've advised and they have helped, I'm in the process of trying to install one brigade now. Hopefully it'll work.

EDIT: Wait, if I'm going to be using the torpedoes text file, will I need to actually remove the entire torpedo tree? Or add into its file? Still limited by brigades...
 
Waaa, it's almost overwhelming how many things I need to change and add just to let me try and test one brigade... I need to make a step-by-step list of what I should do first before doing something else... I keep going back and forth between things.

I've had a look at the documents you've advised and they have helped, I'm in the process of trying to install one brigade now. Hopefully it'll work.

EDIT: Wait, if I'm going to be using the torpedoes text file, will I need to actually remove the entire torpedo tree? Or add into its file? Still limited by brigades...

Just an idea, but why not make your changes and place this ASM tech under the "Special/Secret Weapons" tech tab? It would definately NOT be a typical tech for that time period, yes?
 
Just an idea, but why not make your changes and place this ASM tech under the "Special/Secret Weapons" tech tab? It would definately NOT be a typical tech for that time period, yes?
That is currently the plan, but I'd be implanting the ASM into the torpedo branch. Or, maybe I should just get it to up the range of Cruisers? Hmm, actually that is a better idea within the current constraints of the game. Better start from scratch with a checklist.
 
Ok, I've coded some things and tried booting the game up, I've created some technology events and added the AShM into the secret weapons file, sadly, the game doesn't like what I've coded.

Here is the failing code:
Code:
    application = {
        id         = 18000
        name    = SHORT_TECH_APP_ASHM_180_NAME
        
        position     = { x = 340 y = 518 }
        picture     = "ashm1"
        year         = 1942
        #
        component = { id = 18011 name = TECH_CMP_ASHM_180_1_NAME type = rocketry difficulty = 12 }
        #
        component = { id = 18012 name = TECH_CMP_ASHM_180_2_NAME type = aeronautics difficulty = 10 }
        #
        component = { id = 18013 name = TECH_CMP_ASHM_180_3_NAME type = naval_engineering difficulty = 10 }
        #
        component = { id = 18014 name = TECH_CMP_ASHM_180_4_NAME type = electronics difficulty = 8 }
        #
        component = { id = 18015 name = TECH_CMP_ASHM_180_1_NAME type = naval_training = 8 double_time = yes }
        required = { 2970 7580 }
        effects = {
            command = { type = naval_attack which = light_cruiser value = 2 }
            command = { type = naval_attack which = heavy_cruiser value = 2 }
            command = { type = naval_attack which = battlecruiser value = 2 }
            command = { type = naval_attack which = battleship value = 2 }
            command = { type = convoy_attack which = light_cruiser value = 6 }
            command = { type = convoy_attack which = heavy_cruiser value = 6 }
            command = { type = convoy_attack which = battlecruiser value = 6 }
            command = { type = convoy_attack which = battleship value = 6 }
            command = { type = distance which = light_cruiser value = 2 }
            command = { type = distance which = heavy_cruiser value = 2 }
            command = { type = distance which = battlecruiser value = 2 }
            command = { type = distance which = battleship value = 2 }
            }
    }

Here is the technology names:
ashmreference.png


Oh, and here is the event that should boot the technology up:
Code:
event = { # Anti-Ship Missile System
    id = 3000050
    random = no
    persistent = yes
    
    trigger = {
        technology = 2970 # Early Rocket Artillery
        technology = 7580 # Flying Bomb Development
            NOT = {
                is_tech_active = 18000 # AShM starter
                }
            }
    
    name = "Anti-Ship Missile Concept"
    desc = "With the development of rockets and partial guidance technology, our naval experts and aeronautical engineers have come up with the concept of launching missiles from a ship in order to engage other surface vessels!  It is envisioned that cruisers can take on vessels from across the horizon!  Some say we could even mount these missiles onto planes!"
    style = 2
    picture = "news_paper"
    
    action_a = {
        name = "Ok"
        command = { }
    }
}
 
Just an idea, but why not make your changes and place this ASM tech under the "Special/Secret Weapons" tech tab? It would definately NOT be a typical tech for that time period, yes?

Or even better, make tech entries in the secret technology screen for robotics and guided weapon systems that refers to all kinds of air to surface and surface to surface missiles, and henceforth must be researched to get access to any/all of them.
 
Or even better, make tech entries in the secret technology screen for robotics and guided weapon systems that refers to all kinds of air to surface and surface to surface missiles, and henceforth must be researched to get access to any/all of them.
Later versions I plan will need electronics computers, radar tech and rocket assembly line. Hmm, could incorporate the 'robot tanks' technology too.

This is open for debate on the nitty gritty, though I plan for the tech to do the following:

  • Boost sea attack
  • Boost convoy attack
  • Boost range
  • Eventually boost sub attack
  • Latest can increase sea defence
 
Sounds good
 
Judging by that screenshot of yours i would recommend to switch to programmer's notepad or notepad ++ to modify your .csv files, it will become way more easier and clearer.

And BTW the Fritz X, the considered to be the first ASM, was not fired from a ship but from an airplane, that's why i think that the first experimental ASM tech should not activate any brigade.
 
where do you asign a model and a image to a new unit?
I think you place the images here:
E:\Games\Darkest Hour\Mods\Darkest Hour Full\gfx\interface\models

If you want custom models per country, you place the TAG in front of the model name, e.g. ENG_model_3_2, appears to be 1948 Mechanized Infantry for England tag.

While "model_3_2" is generic 1948 Mechanized infantry.