Any way of making units show as neutral?

Toady

Chieftain
Joined
May 11, 2006
Messages
73
Is the any way to make specific units appear as neutral to others and be able to attack or be attacked without a war declaration, like barbarians?

Something like the privateer in Civ3.
 
NikG said:
Yes there is...

So, did you mean that in the abstract like "Yes there is a way since we have access to the code and we can change anything with enough time and effort" or did you means something a little more concrete like "Yes there is and I know how to do it"?

Roger Bacon
 
Ummm... yeah, what RogerBacon said. If anyone is able to mod this it would be a huge asset, as it would allow all sorts of alternative forms of competition, particularly covert ops but also economic, etc, which right now is worked-around by using button actions but is therefore less interesting to the player.

EDIT: SOme of those being RogerBacon's own mods. (When I say "less interesting" I mostly mean graphically, but there is a certain thrill to the combat model that I wish could be leveraged for spy-vs-spy activities, or intercepting caravans, or the like).
 
First of we need a unit that doesnt show any colors (for the human player).
Then we need to change a few things making a new unit attribute ala "bPirate", then changing the code when try to attack (-> se TGA's post), then maybe a little AI tweaking a voíla you got it...
 
NikG said:
Yes there is...

BTW I know it were a bit smart, however I was tired and were going to bed. Sorry for the incomplete answer...

So, did you mean that in the abstract like "Yes there is a way since we have access to the code and we can change anything with enough time and effort" or did you means something a little more concrete like "Yes there is and I know how to do it"?

Actually both of them! I know how to do it, however I am not 111½% sure of what needs to change, but I have a good idea.
 
Has anyone done any work on this? I'd love to help out, although I'm crap at modding. I was thinking a couple military units in each age, including a basic ground unit, mobile (horses or motors), and naval. Perhaps 12 or 13 in total?
 
After a wild goose chase (I'm new to civ 4 modding), I finally found getDeclareWarMove(), it's actually in CyUnit. Regardless, I'm looking to add increased espionage so I'll post what I come up with.

edit: >< The Great Apple was right, it is in CvUnit. (Removes foot from mouth). Still learning...nothing to see here folks.
 
Ok, sorry, been working on a mod that includes this feature. I'm at work atm but I'll post my code when it's fully functional tonight. After initial reseach I've found that giving a unit a specific promotion "PRIVATEER" (by Kael's advice in a thread somewhere) and checking for it during actions is the easiest. I havn't delved into the AI code yet.

Here's the steps:
1) Create the PRIVATEER promotion.
2) Add PRIVATEER as a free promotion to all privateer units.
3) Check for the promotion when the unit attempts to enter or move through territory you aren't at war or have an open borders pact with.
4) Check for promotion when the unit attempts to attack a non-enemy unit.
5) Check for promotion when the unit attempts to attack a non-enemy city.
6) Check for promotion when the unit attempts to destroy an non-enemy improvement.

Steps 1-2 should only require editing XML while 3-6 will require code additions in the SDK..mainly CvUnit.cpp.
 
A promotion is one way to do it; an XML value in the unit's def is another. Check the code for determining how a Caravel or a Spy can enter enemy territory without triggering war. Seems that value would take care of #3.

All sorts of other options open up with this, such as spy vs. spy combat...
 
Grakl said:
Ok, sorry, been working on a mod that includes this feature. I'm at work atm but I'll post my code when it's fully functional tonight. After initial reseach I've found that giving a unit a specific promotion "PRIVATEER" (by Kael's advice in a thread somewhere) and checking for it during actions is the easiest. I havn't delved into the AI code yet.

Here's the steps:
1) Create the PRIVATEER promotion.
2) Add PRIVATEER as a free promotion to all privateer units.
3) Check for the promotion when the unit attempts to enter or move through territory you aren't at war or have an open borders pact with.
4) Check for promotion when the unit attempts to attack a non-enemy unit.
5) Check for promotion when the unit attempts to attack a non-enemy city.
6) Check for promotion when the unit attempts to destroy an non-enemy improvement.

Steps 1-2 should only require editing XML while 3-6 will require code additions in the SDK..mainly CvUnit.cpp.

7) Make sure any unit can attack a PRIVATEER without starting a war.

You will also have to figure out what to do if a privateer captures a city or worker or settler. Of course, you could just make it unable to capture other units but that would be ahistorical as that was the main use of privateers at sea.

Roger Bacon
 
Well, steps 1, 2, and 3 were easy enough and steps 6 with the addition of air bombing a non-enemy seem to work. Unfortunately I banged my head against a wall last night trying to get steps 4 and 5 (and subsequently 7) to work. It's easy to check to move through territory (which also allowed the unit to enter non-enemy cities like a spy ><) but actually initiating combat without popping up the declare war dialog has me beat. Anyone else care to take a stab at it?
 
*Bump* My apologies, but has anyone had a chance or implemented this in a mod yet? I've based my mod around utilizing this as a primary feature and I havn't been able to crack it. Any help would be much appreciated. I'm starting to worry that Firaxis didn't include this for a reason or that other's havnt' because it can't be done :(
 
Monthly bump...is anyone aware of a mod that implements full privateer units (not just setting the sub or spy flag) as they were in Civ 3? I didn't see them in the Warlords expansion much to my disappointment. Any helps would be much appreciated, thanks.
 
Back
Top Bottom