• Civilization 7 has been announced. For more info please check the forum here .

Quick Modding Questions Thread

I have a question about air combat....

I've added a "stealth fighter" unit (YF-23 graphics), and I'm trying to get it to behave the way I want it to.

Unlike the stealth bomber, I don't want to give it an evasion chance- otherwise its not very good for engaging the fighter cover of a city.
I'd rather have it be like a submarine, with a 50% withdraw chance - so that it still gets intercepted and engages in combat, but it won't get shot down so much.

I tried putting 100% evasion chance (just to test and see if it worked) - it didn't.
It seems air combat doesn't make use of withdrawal probabilities.

Then I read that aircombat is limited to 5 rounds, and there is a max of 50 damage each round.
If I give my "stealth fighter" 3 first strikes, and immunity to first strikes, will it make use of them?
Will any first strikes it uses count towards the 5 rounds of combat?

I'm thinking I could use first strikes to make it "not so bad" when it gets intercepted, ie raise its survival chances much higher.
If I can't, I'll just have to settle for making it alot stronger than the previous fighter.... :rolleyes:
 
GameOptionsInfos doesn't control victory conditions, the CIV4VictoryInfo is the closent thing that i can see. This is what the Mastery VC is defined as in there.
Code:
              <VictoryInfo>
			<Type>VICTORY_TOTAL</Type>
			<Description>TXT_KEY_VICTORY_TOTAL</Description>
			<Civilopedia>TXT_KEY_VICTORY_TOTAL_PEDIA</Civilopedia>
			<bTargetScore>0</bTargetScore>
			<bEndScore>1</bEndScore>
			<bConquest>1</bConquest>
			<bDiploVote>0</bDiploVote>
			<bPermanent>0</bPermanent>
			<bTotalVictory>1</bTotalVictory>
			<iPopulationPercentLead>0</iPopulationPercentLead>
			<iLandPercent>0</iLandPercent>
			<iMinLandPercent>0</iMinLandPercent>
			<iReligionPercent>0</iReligionPercent>
			<CityCulture>NONE</CityCulture>
			<iNumCultureCities>0</iNumCultureCities>
			<iTotalCultureRatio>0</iTotalCultureRatio>
			<iVictoryDelayTurns>0</iVictoryDelayTurns>
			<VictoryMovie/>
		</VictoryInfo>
 
@Admiral Armada: Um...no idea then :dunno:.

It seems air combat doesn't make use of withdrawal probabilities.

Air combat is somehow different from the normal combat, so that you're probably just right: It doesn't work there.

How do you make a domain_air unit carry domain_land units and be able to move like a domain_air or domain_water unit?

I guess the second domain_air has to be domain_land, right?
But doesn't matter,that will not work.
DOMAIN_AIR is so defined, how it is: Units work in a radius around a city. That's DOMAIN_AIR.
But even then, there's no AI for such operations. The carrying AI is only for water units, land units can't use it.

What was your idea behind this?
 
But even then, there's no AI for such operations. The carrying AI is only for water units, land units can't use it.

You can make land units carry other units, I'm not sure if the computer opponents will make use of it though.

I figured marines/seals remain buildable long after they are rather weak in comparison to other units.
Also, after BTS added mobile sams and mobile artillery, marines/seals were left as the only non-obsolete unit with 1 movement point.

I'd rather give a mech infantry the amphib promotiom, than use marines.
Also, on a pangea map, they aren't really useful.
So I decided to make some extra incentives to use them- made a new special unit class, and made a 6 movement point helicopter unit (with only 20 strength) that could carry marines/seals, and I also allowed mechanized infantry to carry marines/seals.
The result was that marines/seals could keep up with a stack composed of 2+ movement units, and with the helicopter transports, could deviate far from the stack to pillage/cut rail lines, etc, and still rejoin the stack.

As to useless airships..... -20% damage is better than nothing, especially if you have some highly experienced units leading the attack- it really helps survival chances.
They can also see subs, which is nice - but a pain in the arsch if you actually want to keep a lookout for subs by doing recons every turn...
 
Air ships are useless. Remove if you don't like.
You can't use DOMAIN_AIR to transport units. Unlike water this domain type is very limited and doesn't use the same rules as others.
You can however create/use an all-terrain transport unit, which is probably what you want; the Dune mod even has working AI code for it afaik.
 
Air ships are useless. Remove if you don't like.
You can't use DOMAIN_AIR to transport units. Unlike water this domain type is very limited and doesn't use the same rules as others.
You can however create/use an all-terrain transport unit, which is probably what you want; the Dune mod even has working AI code for it afaik.

But how do I make the airship stay in the air, instead of behind half on land/water, half hidden under the terrain?
 
You can make land units carry other units, I'm not sure if the computer opponents will make use of it though.

I meant the second one: The AI will not use these units to transport other units. Never ever.

But how do I make the airship stay in the air, instead of behind half on land/water, half hidden under the terrain?

That can probably be done in nifscope, there you can change the X, Y and Z values of the units.
Just open the airship in nifscope, rightclick on the model, then there should be somewhere an option "transform" (or similar), where you can get access to the coordinates. Just raise the Z axis, save it, done.
 
That can probably be done in nifscope, there you can change the X, Y and Z values of the units.
Just open the airship in nifscope, rightclick on the model, then there should be somewhere an option "transform" (or similar), where you can get access to the coordinates. Just raise the Z axis, save it, done.

Uhh... in that case could anyone do it for me? Nifskope for mac (in the mac section) isn't doesn't work with snow leopard, and if I search nifskope and mac in the same google search the topic in the mac section is one of the top links. All the other downloads for it have no way of launching or an .exe file, which are useless for me.
 
Is there any way to "Force" a diplomatic victory? IM trying to test things and i want to force a vote and force it to come out correctly, is this possible?
 
I thought it went this way

Level 1 = 0-1 experience
Level 2 = 2-3
Level 3 = 4-7
Level 4 = 8-15
Level 5 = 16-31
Level 6 = 32-63

But I have a unit with Level 9 and only 52 Experience

e.g. Level 9, Experience=52

Does someone know the formula ?

BTW: This thread should be made a sticky so "newbie modders" can use it for quick questions
 
The formula BTS uses is level * level +1
Spoiler :
Code:
	def getExperienceNeeded(self, argsList):
		# use this function to set how much experience a unit needs
		iLevel, iOwner = argsList
		
		iExperienceNeeded = 0

		# regular epic game experience		
		iExperienceNeeded = iLevel * iLevel + 1

		iModifier = gc.getPlayer(iOwner).getLevelExperienceModifier()
		if (0 != iModifier):
			iExperienceNeeded += (iExperienceNeeded * iModifier + 99) / 100   # ROUND UP
			
		return iExperienceNeeded
This is in Assets/Python CvGameUtils.py.
I have no idea why your 9 level unit would have "only" 52 exp (shouldn't it be like 82?).
 
I discovered why my Unit has 52. In my Mod I have set every unit with a settings of Level 2 Experience 2. My 5-Star Tank General gives a Promotion of 50 points which is added to the base of 2 giving it 52 and as the level count started at 2 it meant that it was already 2 level above 0.

Now that I have this formula. I will reset all the units starting levels according to the number of Promotions they have.

1 2
2 5
3 10
4 17
5 26
6 37
7 50
8 65
9 82
10 101
11 122
12 145
13 170
14 197
15 226
16 257
17 290
18 325
19 362
20 401

I'll need to deduct the "free" Promotions from the level count.
 
is there a tutorial for how to make buttons?
 
Just use any image editor (gimp, paint.net, mspaint) and make sure that they are not any bigger than 64x64 pixels in size.
 
For a modcomp I was also working on, I am using this code to make a list of a player's cities:

Code:
playercities = []
NumCities = player.getNumCities()
                                while (len(playercities) <= NumCities):
                                        city = player.nextCity()
                                        playercities.append(city.getName())

How can I modify this code to make it work? Right now this function is getting a callback.
Code:
city = player.nextCity()

I am also having trouble with this code.

Code:
def onBeginPlayerTurn(self, argsList):
		'Called at the beginning of a players turn'
		iGameTurn, iPlayer = argsList


                player = PyPlayer(iPlayer)
		if (player.isGoldenAge() == True):
 
Top Bottom