Results 1 to 14 of 14

Thread: What makes an unit able to hit buildings?

  1. #1
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default What makes an unit able to hit buildings?

    What line in export_descr_unit allows an unit to be able to hit walls and gates like catapults do?

    I tried making an infantry unit to have the same lines of a catapult unit.

    From this:

    Code:
    type             Gondor Catapult
    dictionary       Gondor_Catapult      ; Catapult
    category         siege
    class            missile
    voice_type       Heavy
    banner faction   main_missile
    banner holy      crusade
    soldier          NE_Catapult_Crew, 24, 2, 1
    officer             gondor_captain_early_flag
    engine           gondor_catapult
    attributes       sea_faring, hardy, can_withdraw, artillery
    formation        1.5, 1.5, 3, 3, 3, square
    stat_health      1, 2
    stat_pri         7, 3, no, 0, 0, melee, artillery_mechanical, piercing, sword, 25, 1
    stat_pri_attr    no
    stat_sec         60, 3, catapult, 250, 25, siege_missile, artillery_mechanical, blunt, none, 25, 1
    stat_sec_attr    ap, bp, area, launching
    stat_pri_armour  4, 2, 0, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        1
    stat_ground      0, -1, -2, -2
    stat_mental      10, normal, trained
    stat_charge_dist 15
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 650, 200, 60, 140, 650, 1, 120
    armour_ug_levels 3
    armour_ug_models Gondor_Catapult_Crew
    ownership        sicily
    era 0            sicily
    era 1            sicily
    era 2            sicily
    recruit_priority_offset    5
    To this:

    Code:
    type             Marines
    dictionary       Marines      ; Marines
    category         siege
    class            missile
    voice_type       Heavy
    banner faction   main_missile
    banner holy      crusade
    soldier          marines, 60, 0, 1
    officer             gondor_captain_early_flag
    officer             gondor_captain_early_flag
    engine           gondor_catapult ; WITHOUT THIS THE GAME CTD AT START
    mount_effect     elephant -10
    attributes       sea_faring, hide_forest, hardy, can_withdraw, cannot_skirmish, free_upkeep_unit, artillery
    formation        1.2, 1.2, 2.4, 2.4, 4, square
    stat_health      1, 3
    stat_pri         60, 3, catapult, 250, 25, siege_missile, artillery_mechanical, blunt, none, 25, 1
    stat_pri_attr    ap, bp, area, launching
    stat_sec         7, 3, no, 0, 0, melee, melee_blade, piercing, sword, 0, 1
    stat_sec_attr    no
    stat_pri_armour  5, 3, 4, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        4
    stat_ground      0, -1, 0, -2
    stat_mental      13, normal, trained
    stat_charge_dist 15
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 540, 220, 75, 75, 540, 3, 150
    armour_ug_levels 2, 3
    armour_ug_models marines, marines_ug1
    ownership        sicily
    era 0            sicily
    era 1            sicily
    era 2            sicily
    recruit_priority_offset    7
    Yes, I'm trying to make infantry trhow rocks and hit buildings.

    I can make them throw rocks and with the code above they will even load in battle without ctd, in a siege battle as attackers, with NO NEED FOR SIEGE ENGINES, the game loads. However, as soon as the battle starts a defeat is announced and the battle ends.
    Last edited by leo.civil.uefs; April 25, 2018 at 06:31 AM.

  2. #2

    Default Re: What makes an unit able to hit buildings?

    I'm not sure it's just an EDU thing, you may need to edit the descr_projectiles.txt.

  3. #3
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: What makes an unit able to hit buildings?

    Quote Originally Posted by QuintusSertorius View Post
    I'm not sure it's just an EDU thing, you may need to edit the descr_projectiles.txt.
    descr_projectiles.txt is where the projectiles are set. In this case, "catapult", which is the same used for the catapult unit, and this unit can hit buildings. I can't see anything of use in descr_projectiles.txt.

  4. #4
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: What makes an unit able to hit buildings?

    There is !

    Here is a siege engine missile descr_projectile code :

    Code:
    projectile trebuchet
    
    effect             boulder_medium_set
    end_effect                ground_impact_treb_set
    end_man_effect            man_impact_catapult_set
    end_package_effect        wall_impact_medium_set
    end_shatter_effect        ground_impact_treb_set
    end_shatter_man_effect        man_impact_catapult_set
    end_shatter_package_effect    wall_impact_medium_set
    
    
    damage            90
    damage_to_troops 10
    radius            0.3
    mass            2.4        ;appears to be units of 100kg (given a man is 0.8)
    area            2.0
    accuracy_vs_units        0.075
    accuracy_vs_buildings    0.05
    accuracy_vs_towers      0.0305 
    min_angle        -15
    max_angle        70
    velocity        75 ;61
    ;bounce            0.01 0.01 0.93 0.5
    body_piercing
    display            aimed 
    effect_only
    And this is the arrow code

    Code:
    effect            arrows_new_set
    end_effect                arrow_impact_ground_set
    end_man_effect            man_impact_tiny_set
    end_package_effect        arrow_impact_wall_set
    end_shatter_effect        arrow_impact_ground_set
    end_shatter_man_effect        man_impact_tiny_set
    end_shatter_package_effect    arrow_broken_impact_wall_set
    
    effect_offset    -1.5
    damage        0
    radius        0.1
    mass        0.05
    accuracy_vs_units        0.05
    affected_by_rain
    min_angle    -75
    max_angle    65
    velocity    20 48
    display        aimed
    effect_only
    Have a look at the differences !

    You also have to set it to siege_missile as in Red to make it really a siege engine ...

    Code:
    type             Trebuchet
    dictionary       Trebuchet
    category         siege
    class            missile
    voice_type       Heavy
    banner faction   main_missile
    banner holy      crusade
    soldier          NE_Trebuchet_Crew, 16, 2, 1
    engine           trebuchet
    attributes       sea_faring, hardy, can_withdraw, artillery
    formation        1.5, 1.5, 3, 3, 3, square
    stat_health      1, 0
    stat_pri         9, 0, no, 0, 0, melee, melee_simple, piercing, sword, 25, 2 ;short sword +3 9
    ;stat_pri_ex      0, 0, 0
    stat_pri_attr    no
    stat_sec         50, 0, trebuchet, 300, 30, siege_missile, artillery_mechanical, blunt, none, 25, 1
    ;stat_sec_ex      0, 0, 0
    stat_sec_attr    bp, area, launching
    stat_ter         12, 0, cow_carcass, 250, 5, siege_missile, artillery_mechanical, blunt, none, 25, 1
    ;stat_ter_ex      0, 0, 0
    stat_ter_attr    bp, area, launching,
    stat_pri_armour  10, 9, 0, leather ;base 5 leather+3 5 ;base 5 dex 4
    ;stat_armour_ex   4, 0, 0, 0, 4, 0, 0, leather
    stat_sec_armour  0, 0, flesh
    stat_heat        1
    stat_ground      0, 0, 0, 0
    stat_mental      9, disciplined, highly_trained
    stat_charge_dist 0
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        15, 430, 250, 90, 70, 430, 4, 100
    armour_ug_levels 1
    armour_ug_models NE_Trebuchet_Crew
    ownership        portugal, normans, turks, timurids, denmark, aztecs, hre, mongols, scotland, venice, france, egypt, milan, england, spain, papal_states, poland, hungary, russia, byzantium, moors, sicily, slave,
    ;unit_info        6, 0, 8
    But as they are supposed to attack buildings, they are very OP against units.

    You can also tweak the descr_area_effect.xml to change the area of effects

    the line area_effect has to be added above damage_to_troops (check the mortar_shot in vanilla files to understand the code and mechanics)

    Also, use the javelin thrower animation to simulate spells throws (EDU line soldier -> Javelinmen) ! As I bet you are trying to create wizards ?
    Last edited by Titus le Chmakus; April 25, 2018 at 09:28 AM.

  5. #5
    Medusa0's Avatar Artifex
    Join Date
    Apr 2009
    Location
    Nowhere
    Posts
    379

    Default Re: What makes an unit able to hit buildings?

    Quote Originally Posted by leo.civil.uefs View Post
    What line in export_descr_unit allows an unit to be able to hit walls and gates like catapults do?
    I can make them throw rocks and with the code above they will even load in battle without ctd, in a siege battle as attackers, with NO NEED FOR SIEGE ENGINES, the game loads. However, as soon as the battle starts a defeat is announced and the battle ends.
    Unfortunately, it seems that only artillery type units are allowed to damage buildings in M2TW, and they are hard-coded to have their projectile attack as their secondary attack since RTW (with the above, the marines now have a whopping 60 melee attack too). This is bizarre as projectiles with non-zero "damage" perimeters can target and damage siege engines just fine.

    You can however game the system a bit by creating a "mounted_engine" type of unit akin to the elephant artillery, which does mean that the unit will be an elephant type unit with all of their quirks and limitations (cannot scale walls, no defensive/ready animations, etc. though I suspect you already know the majority of them from your works in Third Age). I could go into more details if you are interested.

    Edit: Now here's a thought, if artillery are required to have their building damaging projectiles as secondary, what effects would it have if you add a tertiary weapon perimeter to the marines above?
    Last edited by Medusa0; April 25, 2018 at 11:07 AM.

  6. #6
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: What makes an unit able to hit buildings?

    Quote Originally Posted by Titus le Chmakus View Post
    There is !...

    As I bet you are trying to create wizards ?
    No wizards. Rock throwing Trolls!

    I tried everything with descr_projectiles and expor_descr_units. It does not work and the reason seems to be explained by Medusa0 in his reply.

    Quote Originally Posted by Medusa0 View Post
    (with the above, the marines now have a whopping 60 melee attack too).
    You mean my codes above? That way their primary attack is throwing rocks. It works well. It just can't target buildings.

    If I set the rock throwing as secondary, there is no way how to use it ingame, see it below:

    Code:
    type             Marines
    dictionary       Marines      ; Marines
    category         siege
    class            missile
    voice_type       Heavy
    banner faction   main_missile
    banner holy      crusade
    soldier          marines, 60, 0, 1
    officer             gondor_captain_early_flag
    officer             gondor_captain_early_flag
    engine           northern_catapult
    mount_effect     elephant -10
    attributes       sea_faring, hide_forest, hardy, can_withdraw, cannot_skirmish, free_upkeep_unit, artillery
    formation        1.2, 1.2, 2.4, 2.4, 4, square
    stat_health      1, 3
    stat_pri         4, 2, no, 0, 0, melee, artillery_mechanical, blunt, mace, 25, 1
    stat_pri_attr    ap
    stat_sec         60, 3, catapult, 250, 25, siege_missile, artillery_mechanical, blunt, none, 25, 1
    stat_sec_attr    ap, bp, area, launching
    stat_pri_armour  5, 3, 4, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        4
    stat_ground      0, -1, 0, -2
    stat_mental      13, normal, trained
    stat_charge_dist 15
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 540, 220, 75, 75, 540, 3, 150
    armour_ug_levels 2, 3
    armour_ug_models marines, marines_ug1
    ownership        sicily
    era 0            sicily
    era 1            sicily
    era 2            sicily
    recruit_priority_offset    7
    Last edited by leo.civil.uefs; April 25, 2018 at 03:31 PM.

  7. #7
    Medusa0's Avatar Artifex
    Join Date
    Apr 2009
    Location
    Nowhere
    Posts
    379

    Default Re: What makes an unit able to hit buildings?

    Quote Originally Posted by leo.civil.uefs View Post
    Code:
    type             Marines
    dictionary       Marines      ; Marines
    category         siege
    class            missile
    voice_type       Heavy
    banner faction   main_missile
    banner holy      crusade
    soldier          marines, 60, 0, 1
    officer             gondor_captain_early_flag
    officer             gondor_captain_early_flag
    engine           northern_catapult
    mount_effect     elephant -10
    attributes       sea_faring, hide_forest, hardy, can_withdraw, cannot_skirmish, free_upkeep_unit, artillery
    formation        1.2, 1.2, 2.4, 2.4, 4, square
    stat_health      1, 3
    stat_pri         4, 2, no, 0, 0, melee, artillery_mechanical, blunt, mace, 25, 1
    stat_pri_attr    ap
    stat_sec         60, 3, catapult, 250, 25, siege_missile, artillery_mechanical, blunt, none, 25, 1
    stat_sec_attr    ap, bp, area, launching
    stat_pri_armour  5, 3, 4, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        4
    stat_ground      0, -1, 0, -2
    stat_mental      13, normal, trained
    stat_charge_dist 15
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 540, 220, 75, 75, 540, 3, 150
    armour_ug_levels 2, 3
    armour_ug_models marines, marines_ug1
    ownership        sicily
    era 0            sicily
    era 1            sicily
    era 2            sicily
    recruit_priority_offset    7
    Huh, interesting, maybe the fact that you used a missile unit as a base (versus just swapping the primary and secondary weapon of a catapult crew) make it possible for the unit to launch projectiles without their siege engines?

  8. #8
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: What makes an unit able to hit buildings?

    The second code of your first post should work ! Or at least the stat_pri !

    Did you try with category infantry rather than siege ? And remove the engine line.

    Are you sure the soldier line you are using defenetly works ? I mean your marines are properly coded in other files ?

    Huh, interesting, maybe the fact that you used a missile unit as a base (versus just swapping the primary and secondary weapon of a catapult crew) make it possible for the unit to launch projectiles without their siege engines?
    That is not a problem, I've been using it ! It works.

    Leo, what does the defeat pannel says ?

  9. #9
    ♔atthias♔'s Avatar dutch speaking
    Citizen

    Join Date
    Mar 2013
    Location
    France
    Posts
    4,059

    Default Re: What makes an unit able to hit buildings?

    Quote Originally Posted by Titus le Chmakus View Post
    The second code of your first post should work ! Or at least the stat_pri !

    Did you try with category infantry rather than siege ? And remove the engine line.

    Are you sure the soldier line you are using defenetly works ? I mean your marines are properly coded in other files ?

    That is not a problem, I've been using it ! It works.

    Leo, what does the defeat pannel says ?
    I think just clear defeat like always when you can attack a city but have no actual engines to break wall or gated with
    Rise of Mordor 3D Modelers Wanted
    Total War - Rise of Mordor
    Are you a 3D Environment and Character artist, or a Character Animator?

    If yes, then the Rise of Mordor team linked above is looking for you!
    Massive Overhaul Submod Units!
    D you want some units back in MOS 1.7? Install this mod http://www.twcenter.net/forums/showt...n-1-1-RELEASED
    It adds back units who were deleted from the campaign in MOS 1.7, namely the Winged Swordsmen, the Citadel Guard Archers and the Gondor Dismounted Bodyguard.

    Under the proud patronage of
    Frunk of the house of Siblesz

  10. #10
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: What makes an unit able to hit buildings?

    Quote Originally Posted by Titus le Chmakus View Post
    The second code of your first post should work ! Or at least the stat_pri !

    Did you try with category infantry rather than siege ? And remove the engine line.

    Are you sure the soldier line you are using defenetly works ? I mean your marines are properly coded in other files ?
    Yes and yes.

    Quote Originally Posted by Titus le Chmakus View Post
    Leo, what does the defeat pannel says ?
    Hummm... can't remember now and can't test since I'm trying otehr ways wiht the files. Does the pannel shows anything more than "defeat" and the number results? Why do you ask?
    Last edited by leo.civil.uefs; April 27, 2018 at 09:11 AM.

  11. #11
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: What makes an unit able to hit buildings?

    Hummm... can't remember now and can't test since I'm trying otehr ways wiht the files. Does the pannel shows anything more than "defeat" and the number results? Why do you ask?
    Just to know if the game considers that you have no soldier left ... from the begining of the battle ... That could mean you coded something wrongly ... If you have siege engines intact with all soldiers killed, I think you loose the battle.

    I think just clear defeat like always when you can attack a city but have no actual engines to break wall or gated with
    I thought the game would not let you attack if you have no siege engine (the assault option is grey in the siege pannel)

  12. #12

    Default Re: What makes an unit able to hit buildings?

    Quote Originally Posted by Titus le Chmakus View Post
    I thought the game would not let you attack if you have no siege engine (the assault option is grey in the siege pannel)
    He's making them a siege engine unit, with an engine listed, but with 0 engines attached, so the game treats it as if the engines were destroyed, even if the crew is still fine. Pretty clever getting it to load like that, but unfortunately a crew with no engines is effectively just infantry.

    The best way I can see this working is to set it up like Akthross' Troll Stone Throwers, where the attached engines are ammo carts filled with rocks, with the crew animations set so there's only a crew rear, which has an animation of throwing a rock matching the engine actually firing it. Like that, they'll throw rocks, knock down walls, and then when detached from their ammo carts, act as infantry.

  13. #13
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: What makes an unit able to hit buildings?

    Quote Originally Posted by WhiffOfGrapeshot View Post
    He's making them a siege engine unit, with an engine listed, but with 0 engines attached, so the game treats it as if the engines were destroyed, even if the crew is still fine. Pretty clever getting it to load like that, but unfortunately a crew with no engines is effectively just infantry.

    The best way I can see this working is to set it up like Akthross' Troll Stone Throwers, where the attached engines are ammo carts filled with rocks, with the crew animations set so there's only a crew rear, which has an animation of throwing a rock matching the engine actually firing it. Like that, they'll throw rocks, knock down walls, and then when detached from their ammo carts, act as infantry.

    Thanks for this information.

    Though I don't think it would fit well for TATW.

    That way Trolls would be just engine crews and the AI would not use them properly as infantry.

  14. #14

    Default Re: What makes an unit able to hit buildings?

    Quote Originally Posted by leo.civil.uefs View Post
    That way Trolls would be just engine crews and the AI would not use them properly as infantry.
    I'm pretty sure once they run out of ammunition, or they get attacked, the AI would commit them as infantry, and they can still have full Troll melee stats.

    Otherwise, if you make them elephant_cannons, so they can attack walls, the AI has a much harder time with it, as there's a very common bug where the whole army will simply run away from the walls and camp, when attacking with elephant_cannon units, even if they bring rams and ladders.

    Another problem with making them elephant_cannons is that they won't have a throwing animation, as elephant_cannon units simple fire from their idle.

    As regular infantry with a projectile, I haven't seen a way to get them to attack walls, regardless of the projectile, even editing the cursor actions so it doesn't grey out over walls.

    Basically the only things that can attack walls and gates are engines, which includes mounted_engines/elephant_cannons, but those come with their own sets of problems.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •