• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

updating CombatClass

Ambug666

Chieftain
Joined
Jun 23, 2009
Messages
92
Is there a way to make a unit that has more than one CombatClass? I wanted to create a promotion that gives an additional bonus vs. barbarians, and I was considering creating a new CombatClass for barbarians and making them all part of it, but I don't want them to lose their original CombatClass.

Alternatively, is there another way to make a promotion (not policy) that could give a unit a bonus vs. barbarians?

Thanks!
 
If I'm not mistaken Barbarians all share a single Civilization (number 63, I believe?), does that solve the problem?

Unfortunately, that only changes the problem to "how can I make a promotion that gives a bonus to units from a specific civilization?" Thanks though....
 
Yeah, policies have their own way of doing it that I can't leverage. Traits just tend to give promotions to units...
 
Also, if you create a new UnitCombatInfo, then when units fight that new unit, no animation happens because it apparently uses the UnitCombatInfos type to determine which combat animation to show. :(

How could I use lua to do this? I don't know enough about lua, but if I'm pointed in the right direction, I can figure it out from there.
 
You could give an empty promotion (ie: it does nothing) and make a fake Policy (I'm sure this forum has done before, just try a quick search!) linked to the said promotion that gives a bonus against Barbarian like the Honor opener!

If you can't do it eventually, I'll try to do it for you as soon as I get off work.
 
I'd be interested to see how you could create a policy that only affected one type of unit and linked it to a promotion. Thanks!
 
I'd be interested to see how you could create a policy that only affected one type of unit and linked it to a promotion. Thanks!

The policy would affect every of your combat units against Barbarians, as it was what you were asking in the OP: "create a promotion that gives an additional bonus vs. barbarians".
It can be done to just affect one type too, I beleve, but I need you to be clearer if you want just one type. :P
 
I'm sorry. Yeah, I just want it to affect one type of unit, or a unitclass if that works better. It's for a civ leader trait, that scouts get a bunch of special promotions, only I have to create a new unit since if you give a unit a promotion via Trait_FreePromotionUnitCombats in the leader, it won't give you the promotions that have that as the prerequisite as a choice when you get enough xp. Instead, I need to create a new unit and use Unit_FreePromotions to give them the first promotion in the chain. Sigh.
 
Ok. Just paste the UA as you want, please.

I already googled a bit for the Policy idea, so if you could be more precise it would save both of us bunch of time.

Spoiler :
The .xml Policy:
Code:
		<Row>
			<Type>POLICY_BARBARIAN_HATE</Type>
			[U]<BarbarianCombatBonus>25</BarbarianCombatBonus>[/U]
			<CultureCost>-1</CultureCost>
		</Row>


Giving the dummy Policy in Lua without increasing the Policy count.
Code:
function BarbHate()
	local player = Players[iPlayer];
	if player:GetCivilizationType() == GameInfoTypes["CIVILIZATION_YOURCIV"] then
		player:SetNumFreePolicies(1)
		player:SetNumFreePolicies(0)
		player:SetHasPolicy(GameInfoTypes["POLICY_BARBARIAN_HATE"], true)
	end
end

BarbHate()
 
Sorry for the delay. The unit and promotions xml files are in the zip file.

The relevant unit is UNIT_NV_SCOUT and the promotion is PROMOTION_BLOOD_PACT_SCOUT
 

Attachments

I just realized I may be using SetCombatStrength() the wrong way.
I don't know how to make the CombatStrength come back to normal after the attack, but I have an idea...

Since your Promotion should give bonus against Barbarians only, we don't need to worry about that, I hope.
See if this works:


--NOT WORKING--


Also, these will not work with Strategic View enabled nor with Quick Combat.
It's a bit late and I'm very tired, so if I forgot something I'll check again tomorrow morning. Cheers! :)
 
Well, I tried it and I got the message:
[89317.280] \Users\Mike\Documents\My Games\Sid Meier's Civilization 5\MODS\Night Vale (v 1)\BloodPactScout: Scout VS Barbarian: Who is the Deadliest Warrior?
in the log, BUT I got none of the other trace messages when I attacked a barbarian.
I'm not using the dll or Gedemon's RED, so I changed the triggers.

If this is too much work, I'll just change it to a bonus for an existing combatclass and won't worry about it. Thanks for your help though!
 
Hey, sorry for the necrothread but I'm stumbling on the exact same issue.

I'd like to give a bonus vs barbs to my UU. Has someone figured it out in the meantime?
 
Back
Top Bottom