New Barbarian-like Civ

S3rgeus

Emperor
Joined
Apr 10, 2011
Messages
1,270
Location
London, United Kingdom
I've been trying to implement a new barbarian-like civ, one which has no cities and is at permanent war with all other players. I'd use the barbarians themselves but I'm using them already for something else. I've gotten adding the new civ to work properly, at the first turn of a new game, and it automatically declares war on all players in the game (I've already got lua code that appropriately gives it units to wage war), but the game engine insists on treating it too much like a normal player to work properly. (He tried to negotiate peace with me after a few turns.) And city states keep requesting for assistance in their war against it. Is there any way to duplicate the barbarians' functionality in another civ or are only the barbarians hard-coded into the game that way?
 
Technically, you can make more than one Barbarian civ. I'm not sure the XML syntax involved, but I know that the Lua code relies on the Players:IsBarbarian() function, and there's no reason why you can't have two civs return True on that. You'd handle it similar to how city-states work, where they're multiple instances of the CIVILIZATION_MINOR entry.
One catch is that two barbarian civs would wage war on each other as well. You might not want that, so the question is, what exactly are you using these civs for?

For instance, in my own mod, I use the barbarian civ for the future-era Psi units, and spawn them through a unique Lua mechanism. I could create another civ for this, but why bother? So the psi units won't fight with barbarian units (if any), and fill the same niche. It works well.
 
Having the new barbarian civ fight the existing one is exactly what I want. These are a part of my Wheel of Time mod that I'm working on, the default barbarian civ is acting as Dragonsworn (roving bandits that harrass the countries in the books) and the new one I'm trying to add is Shadowspawn ('evil' creatures that are trying to destroy all life in the world). So it makes sense that they fight one another if they run into each other. (I'll be making sure to balance it so they don't wipe each other out.)

That sounds like a perfect idea, using a new instance of the barbarian civ, but I can't find it in the lua or xml anywhere where it specifies that the city states are instances of CIVILIZATION_MINOR. (So presumably I'd be able to copy that syntax if I do find it.) Or can I overload the Player:IsBarbarian() function to return true for my Shadowspawn civ as well?
 
Back
Top Bottom