Mod-Modders Guide to Fall Further

Exacly, but I need to know what file it shold be in.
And I need to know where the warewolf code is so I can copy it and just add a single if() function.
Also, could you tell me how to check for a specific unit type?

If(__tell me what to write here__) {My code}

So, to make it simple here is the list of questions:
1. What file handles postcombatwon scripts?

2. How do I check for the oponents unit type?
If(__tell me what to write here__) {My code}

3. What is the name of the warevolf spawn function?
 
Well, I don't currently have my comp. Posting from my phone. :lol:

1. PostCombatWon is in CvSpellInterface.py. In assets/python/entrypoints

2. Here, I'd look at existing functions to get the actual code... I cannot remember the exact wording without looking at it. :p

Should be something like
Code:
if opponent.getunittype() == gc.getInfoTypeForString('UNIT_SLAVE'):
    iUnit = gc.getInfoTypeForString('UNIT_SLAVE_LIBERATED')
    newUnit = pPlayer.initUnit(iUnit, unit.getX(), unit.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)

Not sure if it's unit.getX or caster.getX, that depends on how other postcombat calls work, you'd have to look at one... I'd suggest copying one as a starting point.

3. Not sure. You'd have to go through the unitinfos for a werewolf to see.
 
Thanks Valkirion, you are my hero.
Well, at least untill I finish making this guy I am working on. xP
 
I don't believe that unit had been defined, so it would probably be pCaster. pCaster and pOpponent are what most of the post combat calls use.

Technically, I believe you can call the parameters of the function anything you want. It i only the order that really matters. (Of course, what you call the parameters in the xml that calls the function matters, as only a few variables are defined there.)


You may also want to add newUnit.convert(pOpponent) at the end, if you want your liberated slave to keep the promotions (including the race) of the slave being freed.
 
I agree with Valkirion, furthermore I need to create a new unit type, esentialy diferent from a slave.
The slave is a cut price half power worker. A Liberated Slave is a strenth 4 combat unit with metal weapons.
 
That will need to be examined, althou I am not perticulary interested into careing over any promotions.
 
My guess is that FlavourMod creates Brigit and then kills it directly (not doing it led to duplicate brigits) and it upsets UnitStatistics because the brigit killed hadn't been "initialized". Of course, it may be another thing... and if I'm right, I don't get why the error log come so often in game.

No idea how to fix it, though...
You silly people burrying my issues! Let's not forget that! :p
 
0 => 1
1 => 9 (+8)
2 => 21 (+12)
3 => 37 (+16)

[4 => ? (+18 ? :) )]

To conclude this: A = 2r² + 6r + 1 where A is the number of plots in the city radius and r the city radius.

There is a fairly extensive method for handling city radii in FlavourMod for differently shaped areas. Take a look at the area classes in CvFlavourInterface.py, if you are interested.
 
Looking through the buildinginfos.xml, I notice that there are a great many zero fields. just integer or boolean fields with a value of 0.

What is the point in all of those? Would everything work if only non-zero fields were left in? Is t just for ease of editing? The buildinginfos is over 3 MB, it adds a lot of waste.
 
Yes, that is just an XML file we haven't gotten around to trimming yet. ALL XML files were like that in base FfH when we started, Kael tried trimming them to see if there was any speed gain for loading times, found there wasn't, and I think left only a few trimmed, or reverted back. From time to time I trim down the XML if I am wanting to work on code but incapable of thinking straight.
 
Wouldn't it be simpler to write some sort of script to do it all simultaneously? just search for full sets of opening/closing tags of i or b type, with 0 as the only value, and delete them. Isn't that what regex are for?
 
To conclude this: A = 2r² + 6r + 1 where A is the number of plots in the city radius and r the city radius.

There is a fairly extensive method for handling city radii in FlavourMod for differently shaped areas. Take a look at the area classes in CvFlavourInterface.py, if you are interested.

I may be mistaken, but from simulation, I found a non polynomial behavior due to rounding. I went up to r=12 and considered the number of tiles whose distance to the center of the city was between r-0.5 and r+0.5

How does the formula consider rounding ?
 
I may be mistaken, but from simulation, I found a non polynomial behavior due to rounding. I went up to r=12 and considered the number of tiles whose distance to the center of the city was between r-0.5 and r+0.5

How does the formula consider rounding ?

Rounding? There is no rounding going on here. The radius r has to be! a natural number. Half a plot doesn't make any sense in the context of civ4. The only thing the fomula tells you is the number of plots A, and if r is a natural number, then A is a natural number as well.

For r = 2 (standard city fat cross) A = 21 plots, for r = 3 (Kuriotates) A = 37 and for r = 12 (what a city!) A = 361 plots.

I suppose, Im' not getting, what you are trying to accomplish.
 
Rounding? There is no rounding going on here.

I suppose, Im' not getting, what you are trying to accomplish.

I do the following.

P being a tile of natural coordinate (x,y).
C being the city tile (center) of natural coordinate (x0,y0)

D being the distance between P and C
Of course D = sqrt((x-x0)^2 + (y-y0)^2)

Then if your r = 12, we will consider all tiles on the square around the city of 2*r + 1 length.
Here i = x-x0 and j = y-y0.

Code:
for i = -12 to 12
   for j = -12 to 12
      D = sqrt((i)^2 + (j)^2)
      if round(D) <= r then
         A = A + 1

Then A is the expected value.
I was saying that your formula does not seem to model the result of the graphical behavior.

Am I clearer?
 
Wouldn't it be simpler to write some sort of script to do it all simultaneously? just search for full sets of opening/closing tags of i or b type, with 0 as the only value, and delete them. Isn't that what regex are for?

WoC has an automated program for that, I haven't bothered to write one for us. Plus I like to use non-standard defaults where they make sense (like in UnitInfos almost EVERY unit is DOMAIN_LAND, so I set that as a default. And XP is almost always 4/8 for each unit, and typically Defense = Offense, and Asset/Power follow a formula based on Tier and Offense strength too...). Hard to find what should be made the default for simplicity if you let it be automated.
 
So...I need a simple python req check for Alignment.


Spell should only be available if current alignment = x. I've tried a couple swipes at it...and it's not ever returning True.


Help?
 
While fighting to improve AI for Orbis, I have got another problem. I am not sure how much it does apply to FF, but I think it could still be a problem.

During AIautoplay I have seen again and again thet having a lair in starting city workable area hurts AI a lot. It can't remove it as it requires a lot of warriors in a city for the AI to be allowed to do the explore, exploring is risky, and AI does not like exploring anyway. Plus removing a lair defender usually costs one or more warriors (so the AI has less than required to explore...)

With lair just outside the city, AI do not want to risk letting workers and settlers out (even though they are protected), so they just sit in the city doing nothing.

I have tried to force removing of lairs in normalize routine in CvGame.cpp (the part that removes bad features around starting cities). But it does not work, even though it still removes i.e. jungle for the right civs (even if Flavour Mod is on).
I assume that lairs are added to the map after I force them to be removed (so it removes nothing), so that is the reason it does not work. Am I right? If so, where should I put the code (SDK or python?) to make it work?

The current code below:
Code:
	if (pLoopPlot->getImprovementType() != NO_IMPROVEMENT)
	{
        	if (GC.getImprovementInfo(pLoopPlot->getImprovementType()).getSpawnUnitType() != NO_UNIT)
			{
				pLoopPlot->setImprovementType(NO_IMPROVEMENT);
			}
	}
 
Back
Top Bottom