• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

Giving units ranged and melee attacks?

Saboten

Chieftain
Joined
Sep 20, 2013
Messages
1
Sup everyone, looooongtime lurker here. I've been working on a general balancing mod for a while, but I've run into a couple of stumbling blocks that I haven't been able to find the answers to..... so I figured it was finally time to "exist" and ask around:

Specifically, I want to make archer and some naval units capable of both range and melee attacking. This is simple enough to do... but there's two problems that are interface and not necessarily gameplay issues. The first is that range/melee capable units will always auto-range attack on right click. I "solved" this by giving them the Must Set Up promotion, which makes them melee until set-up, but even then it's not perfect. The other, more annoying problem is that the UI will only show the potential results of a range attack--even when prompting a melee battle. Does anyone know of a UI mod or simple code that would fix this issue? It would be greatly appreciated!

My other question: with regards to naval units, I've been finding little incentive to ever melee attack--except for city capture--even when ranged attacks do significantly less. (Example: I gave range/melee capable Galleasses 20 strength and 10 ranged strength.) So I'm thinking one way to solve this is to make ranged naval unit capable of ranged attacks against land domain units only. I know there's an option that subs use called [rangedattackdomainonly]... anyone know a possible way to modify this to something like [rangedattacklandonly]?


Thanks a bunch! :)
 
It's called RangeAttackOnlyInDomain and is a boolean, so it can't be used for what you want. What you can do is give the units a promotion which uses the UnitPromotions_Domains table to give them a bonus against DOMAIN_LAND units. You could also give them a negative 100% modifier vs DOMAIN_SEA, but as modifiers are additive this would not always reduce the strength to zero.

I don't know the answer to your other question.
 
Back
Top Bottom