[MOD][MM] Towers shoot trough walls

Discussion in 'Modding' started by StriKe jk, Oct 1, 2016.

  1. StriKe jk

    StriKe jk Member

    Hello Cossacks3 Fans!

    My name is StriKe and I got asked to help out with a mod to make towers shoot through walls. While digging through some files I found out that there is only a general friendly-in-line-of-fire query which prevents them from firing through walls.

    Long story short I added towers to the exception list which stops them from checking for friends in their line-of-fire and thus enables them to shoot through friendly walls. Keep in mind that they can still hit friendly walls because of the trajectory of the cannon shot. This usually happens if the enemy is very close to the wall. I hope you enjoy it! :cool:


    This mod supports the Mod Manager, visible by the tag [MM]. You can get it here.
    Credits for the Mod Manager to Lieutenant-Général.

    Warranty:
    Feel free to use this mod as you like, however if you include this in another project I would appreciate some credit. ;)
    Use it at your own risk! I haven't tried it in multiplayer and I do not know if it is allowed. If you get banned, or your computer explodes - you have been warned.

    -StriKe

    How to Install:
    Download the latest file from this link.
    Code:
    towers through walls.json
    Copy the file to:
    Code:
    Cossacks 3/mod
    Install the file via Mod Manager
     
    Last edited: Oct 4, 2016
  2. A. Soldier

    A. Soldier Active Member

    Huh, so they're like wooden walls now?

    Do wooden walls also get damaged by the Tower's cannon fire if enemies are too close to it?
     
  3. StriKe jk

    StriKe jk Member

    I didn't change anything about the walls.
    I'm not sure what you are talking about to be honest here.
     
  4. A. Soldier

    A. Soldier Active Member

    I thought that cannons could shoot through/above wooden walls, that's why I asked if they (the stonewalls) have become like the wooden walls.

    And again, I thought that the towers were able to shoot above/through wooden walls, but you said that with this edit there was a risk of having the Towers damage and destroy stonewalls if their shots landed close to them, so I thought that wooden walls could also get damaged and destroyed by towers.

    Perhaps just my assumptions confused you.
     
  5. StriKe jk

    StriKe jk Member

    It confused me that you were talking about it from a walls perspective even tho walls have not really anything to do with this change. (I know that may sound weird)
    But I get now what you meant.
    First of let me explain this change a little bit: A few number of weapons do not check for friendly objects in their line of fire when they shoot. Mostly weapons who appear to fly in a very high arc like howitzer. I added towers to that list. This means it can always shoot at the enemy even if there are friendly objects in the way. But nothing more! (for example: if it can hit, or can damage), it also doesn't mean that the tower will always hit the friendly object on the way to it's target. This is because it fires in an arc so the shot usually flies above the friendly object. (It can still hit if the enemy is to close for example)
    However this has nothing to do with another list which contains if a unit does friendly fire or another list which checks if a unit is actually allowed to attack and damage certain objects. (For example: Melee isn't allowed to attack & damage stone walls for example).

    I hope this explain a little what this change does. For reference: howitzer and mortar were already in that list. Also I have no clue what falls in this friendly object category. I will blindly assume it means every building which may include other towers. I haven't checked it but you may be able to put multiple towers (or other buildings) infront of a tower and it will still shoot. (But again I haven't tested it so I honestly don't know.)

    Now to your questions: I actually don't know. I haven't shot actively with a tower close to a stone or wooden wall before, but technically this was also possible before my mod, if a unit stands next to it.
    So it didn't really change anything about that. But if you still want a definitive answer on that, I guess you have to find out.
     
    Last edited: Oct 1, 2016
  6. A. Soldier

    A. Soldier Active Member

    I think that muskets go through both stone and wooden walls, so it would make also make sense for the Tower's cannons to go through/over it.

    We even tested if the Blockhouse can shoot through walls and it turns out it can.
     
  7. StriKe jk

    StriKe jk Member

    Oh wow, you don't need to test all that, it's in the files what can shoot trough it. I can give you a list if you want :D
     
  8. A. Soldier

    A. Soldier Active Member

    Nah it was no biggie, I think Kiergath was already in the Editor anyway so I just asked him if he could put a blockhouse behind a stone wall and see if it would shoot at enemy units.

    That's also how the idea about walls firing muskets in the same sense as blockhouses idea was sparked, since he couldn't add blockhouses to the peasants' build menus due to limited space.
     
  9. Ebel

    Ebel Moderator Staff Member

    What?
    You can add whatever you want.
     
  10. A. Soldier

    A. Soldier Active Member

    No I mean, there is no space on the UI.
     
  11. Ebel

    Ebel Moderator Staff Member

    I understood what you meant. You can add whatever you want, wherever you want:
    I moved some buildings around to show that the UI resizes itself based on the entries given:

    [​IMG]

    The only real limitation would be people's screen resolution. If you add too many (20-30 columns, then it might get close to the minimap, overlapping even).
    In general i think it's safe to say that if you don't add more than the Academy upgrades has, it should be fine.

    .
     
  12. RenegadeKraken

    RenegadeKraken New Member

    Why not simply add a button like a small arrow that will take you to a second "page" of the buildings?
     
  13. Ebel

    Ebel Moderator Staff Member

    That certainly would be an elegant solution to the screen resolution issue, if it ever occured (how many buildings could one want to add?), although that would mean an extra click, and a bit of extra work to code it. Imperia mod for C1 used to have it for the extra academy upgrades.

    Getting of topic a bit now though. This thread was about towers shooting through walls :p
     
  14. A. Soldier

    A. Soldier Active Member

    Huh, good to know. I guess I was stuck thinking of Company of Heroes's static UI.

    That was another idea me and Kiergath had but we thought it was too complicated trying to code it in.

    American Conquest also had a button for a 2nd and 3rd page even, 3rd page was showing how many and what types of units were in a building even if I remember correctly.

    But the town hall definitely had a 2nd page with about 3 more upgrades.
     
  15. StriKe jk

    StriKe jk Member

    Guys, I don't want to be rude here but you should open an extra thread for that.
     
    Anatotitan likes this.
  16. A. Soldier

    A. Soldier Active Member

    Yes, sorry about that. I think we're done on the subject anyhow, I'll get to work implementing the Blockhouses and another custom Cannon Blockhouse like in American Conquest provided by one of our model makers as an experiment.

    Just one last thing Strike, you mind adding me on Steam, or perhaps telling me your name there at least?
     
  17. StriKe jk

    StriKe jk Member

    StriKe_jk not hard to find ^^
     
  18. A. Soldier

    A. Soldier Active Member

    Thanks, keep up the good work, I'll add you to the group once you accept me

    Cheers.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice