How can I make a tower use more than one attack?

Discussion in 'Modding' started by Wralth, Mar 20, 2017.

  1. Wralth

    Wralth New Member

    Putting a second attack on the tower the same way grenadiers and 18thc musketeers fight (i tried to make them have the attack of blockhouses on top of the cannon) results in their cannon simply extending its range based off the second attack, but the other one never gets used.

    When i mess around with the weapon indexes it gets to the point where the tower instead uses gun for EVERY unit, which is basically the same problem as in the beginning, so im kinda out of luck here i guess since i dont know where the weapon deciding scripts are for units.
     
  2. Ftoomsh

    Ftoomsh Active Member

    That's a fine idea. I have modded towers to have maximum sight range (the index of 8). This is since, obviously, towers should help you see further. OCMOD3 tower cannon have much the same range and a slightly slower reload.

    Adding the blockhouse capability sounds fine too (so muskets will shoot from the tower). General WVPM has done extensive modding work with weapon indexes. He has got units with two weapons working correctly in his framework, like cannon with shot and then canister (some call it grapeshot). You should be able to do the same thing with towers. Add the blockhouse weapon on another index and then work it so the weapons fire separately and alternately with the same reload times. Alternatively and perhaps better when units are too close to the tower (closer than minimum cannon range) have the tower switch to the blockhouse weapons (muskets). This mimics the cannoneers dropping their cannon work and using pre-loaded muskets at the window slits. I would watch the blockhouse musket weapon(s) though.It is probably too powerful and its needs to be nerfed back for this use I think. The cannoneers are not great musket shooters and there are not all that many of them. I am sure General WVPM could mod this. I might ask him to do it for OCMOD3! If it's okay to steal a modding idea! :)

    Another alternative would be to make certain structures garrison-able (like towers) and when you put say 8 musketeers maximum in the tower, then the tower can fire muskets as well as cannons. I have it set up in OCMOD3 so that that you need an artillery depot (building dependency) before you make towers. It stands to reason. The cannon must come from somewhere.
     
    Last edited: Mar 21, 2017 at 10:13 PM
  3. General WVPM

    General WVPM Member

    Actually, this is something I don't have (yet).
    The framework simply allows you to reload different weapons at different rates (like not having to reload a musket before using bayonet).
    C3 so far allows units to fire 1 weapon at a time, since normal humans would have a hard time stabbing, shooting and/or throwing a grenade at the same time.
    As for towers (and ships firing real volleys) this simply isn't enabled yet. You would need to mod it in yourself or work with different ranges, so that the cannon is used for long range and the blockhouse attack for shorter ranges.
    Alternatively, you can use my framework. This would still prevent the blockhouse attack from being used while you fire the cannon and even then, you'd need to edit the reload system for buildings (so all the weapons are reloaded at the same time instead of one after the other).

    I hope this helped you a bit.
    If you have further questions about how and where to edit this, I'd be happy to help.

    And @Ftoomsh, I think this would work well in OCMOD and have no problem making it (for OC and/or other mods).
     
  4. Wralth

    Wralth New Member

    I wouldnt necessarily ask for cannons and guns to be fired simultaneously. But right now i cant even get the tower to shoot one of the two weapons depending on the situation. Instead one of the two gets picked all the time and the range stats on the other one only extend the currently used weapon without ever being fired.
     
  5. General WVPM

    General WVPM Member

    I got it working in my test version of the framework. I'll release it later today.