Setting unit/city enemy status... possible?

Dom Pedro II

Modder For Life
Joined
Apr 3, 2002
Messages
6,811
Location
Exit 16, New Jersey
Is there any way that one can code events either in Python or the SDK so that one of a player's own units and/or cities can be forced to be under AI control and flagged as hostile (meaning it can be killed or captured by the player)? This to me seems like it would be a good way of simulating civil wars in the game for mods or scenarios where you can kill "enemy" units that still belong to your civilization and recapture "enemy" cities that never actually leave your borders.

I know people have suggested making barbarian units and flipping cities to barbarians to simulate this, but that really doesn't work particularly well since barbs will attack anything including other civilizations... it also leaves rebel cities open for capture from other civs without reprocussion and that just doesn't fly.

In particular, I was thinking of modding a change like this for the recently released WWI scenario where I ended up spending as much time killing other people's rebels that crossed into my borders as I did killing my own.

I have other reasons for wanting this, but I'm keeping them under my hat for now ;)
 
I think you could do it with the SDK. You'd have to tweak all the functions that define if a unit can fight another unit when they share squares, as well as tweak all the AI functions to not pick it up as a hostile unit.

The AI for the unit might be slightly trickier, as unit AIs are linked into the much larger player AI. You'd have to fiddle extensively with most of the AI bits to make it so it acted using the data for your civilization, only you control the civilizaion.

At least, that's how I'd plan on going about doing it. I may have made it sound easier/harder then it actually is.
 
The Great Apple said:
I think you could do it with the SDK. You'd have to tweak all the functions that define if a unit can fight another unit when they share squares, as well as tweak all the AI functions to not pick it up as a hostile unit.

Yeah... I was a bit confused when I was looking at it because I wasn't sure whether those functions were intended to determine whether or not a city/unit was hostile or whether it was intended to set a city/unit as being hostile or not. And if it were possible to make these functions do this, I'm not sure how to go about it...

The AI for the unit might be slightly trickier, as unit AIs are linked into the much larger player AI. You'd have to fiddle extensively with most of the AI bits to make it so it acted using the data for your civilization, only you control the civilizaion.

Well, it's a direction at least :) It might be a pain in the butt to get the AI to work properly, but I've got time :D I would imagine that since we can automate units and cities, it should be possible to get the AI to take over... of course, then you'd have to find a way to set it so that the human player could not assume control again by clicking on the unit.

It'll probably be a lot of work, but as long as it's possible, it will be worth it I think.
 
A possible workaround would be to have a dummy civ that takes over your units when you want a civil war to break out; that civ is then set to war status with you. (see the barb to civ mod for a starting point). If you just name the civ "Rebels" ala Medieval:Total War I think that could work nicely, and you can recycle that same civ to play the civil war boogeyman throughout all history. (You may need more if you want multiple rebellions to happen across the world, tho).
 
Padmewan said:
A possible workaround would be to have a dummy civ that takes over your units when you want a civil war to break out; that civ is then set to war status with you. (see the barb to civ mod for a starting point). If you just name the civ "Rebels" ala Medieval:Total War I think that could work nicely, and you can recycle that same civ to play the civil war boogeyman throughout all history. (You may need more if you want multiple rebellions to happen across the world, tho).

That's all well and good for scenarios, but it seems like it would cause quite a bit of problems for regular mods. Plus, I have other reasons for wanting this that make the "dummy civ" idea not work.
 
Right... actually my response was based on the imaginary world I already live in, in which you can force a civ to be present in a mod, which you can't -- not yet, anyway.
 
Back
Top Bottom