Mod-Modders Guide to Fall Further

If you want to find it instantly, turn on the MP gameoption for logging random numbers, and the look in your logs folder (shortcut to it is in the BtS folder) for the RandomLogger - Player # - Cycle #.log. A new cycle starts every 50 turns to keep the file sizes small.

I've always had that option checked and never had any logs show up in the folder besides init, xml, and resmgr.


Do the logs disappear once the game is closed, or something?
 
You want to go to:

bool CvUnit::canAddPromotion(int spell)

And change all checks like:

Code:
	if (!isHasPromotion(ePromotion2)) 
	{
		return true;
	}

To

Code:
            if (!isHasPromotion(ePromotion2) || GC.getPromotionInfo(ePromotion2).isStackEffect()) 
            {
				if (!isDenyPromotion(ePromotion2))
				{
	                return true;
				}


EDIT: @ Iceciro: You also need to have logging enabled in your .ini I think.
 
What is an "AI Unit Birthmark" check? I have three players in my game - we OOS'd with one player who did not make this check.

The other player made that check and thus our RandomLogger logs are 100% the same.
 
Birthmark is assigned when a unit is created. It is used in a few placed to provide some "flavor" to the AI actions of each unit (certain birthmark type workers love to build roads, while others enjoy chopping forests). So basically, someone gained a unit they shouldn't have. Check the OOSLog files to see what that unit was and who they think gained it (most likely themselves)
 
Actually, no. The player who OOS'd did not see an awakened I rolled up, and some of the positions of barb units are off. (I was host, if it matters.)

It appears to be an issue when the Awakened was created for me a few turns back. The player in question did not get an AI Unit Birthmark at that time, immediately afterwords, wheras I did. This threw the RNG off for a few turns forward, knocking his barb units out of synch and then finally causing the major OOS when we got different rolls on my next awakened roll, causing me to get an awakened, him to not see it, and OOS to happen.

However, the third player in the game did not have this issue - the AI unit was given a birthmark, and none of the rolls out of synched, which is what throws me off so drastically. What would cause one player to miss a birthmark roll and another player not?
 
Very strange. Should have OOS'd within 1 turn of you getting a unit that he didn't know about, and should be impossible for a unit to be created on anybody's computer without a birthmark. Increaingly vexing that the "odd man out" isn't the one who generated the unit.
 
Tell me about it.

And now for something completely different - how do I track how many of a certain type of unit a player has created throughout the game? I know how to track how many are in play, but I also need to track them if they've been spawned (through python) total, whether they're alive/dead/under another player's control, whatever.
 
Bah. I'll do it another way.
 
This code - will it count the number of hero units the player has, or will it cause some sort of horrid loop or something? The results from this code will be difficult to actually see in game directly, so I want to make sure I haven't killed anything before I start checking it.

Spoiler :

iHero = gc.getInfoTypeForString('PROMOTION_HERO')
iNumberN = 0
py = PyPlayer(iPlayer)

for pUnit in py.getUnitList():
if pUnit.isHasPromotion(iHero) :
iNumberN = iNumberN + 1


(Yeah, it started as copypaste for the Barnaxus-Empower code, but I didn't know of anywhere else that looked for a certain promotion over all a single player's units!)
 
Well you can account for gamespeed yourself if you want it to be factored in. Just check (I am probably remembering this wrong, so search for gamespeed to double check me, I know it is already used in python in a few places)

gc.getGameSpeedInfo(gc.getGame().getGameSpeed()).getGrowthPercent()

This number will be 67, 100, 150 or 300. So you multiply the current game turn by 100, then divide by this value, and the final answer is a gamespeed weighted current turn value. (ie - Turn 30 calculates to be turn 45 on quick, turn 30 on normal, turn 20 on Epic or just turn 10 on Marathon)
 
I figured I'd be able to do something along those lines, but after looking at it for a bit, I think that with the high probability to create Scrubs (1/3 in forest now, down from 1/2), you need at least the possibility of a strong defender to offset the gain. I've got it set at 5% for forests, and while it will normally be wolves or baby spiders, it can be anything up to griffons and satyrs.

Edit: 800th post.:goodjob:
 
im adding in new leaders, how do i make the defeat popup appear with the picture? i have the TXT_KEY_POPUP_DEFEATED thing and a picture and ive linked to the TXT_KEY_POPUP_DEFEATED in the leaderhead infos. what am i missing? it dosnt show up in game :(
 
Defeat popup should work automatically if you entered the quote and picture information in the LeaderHeadInfos. It used to be run through python only (base FfH method), but I am almost 100% certain that I removed all of that code.
 
I had the same problem when adding minor leaders recently.
Game does not seem to notice if player gets eliminated in a first few turns (I think it is 2 or 3). Later it seemed to work fine.
Sometimes it helped building a city, but I am not sure of it.
Maybe you have a different problem, but I tested it by simply starting game and eliminating civ on the first turn. It did not seem to work... ;)

All civ-specific python in FF got eliminated, recently worked on it.
And by the way Xienwolf, thanks for the tip on spells blocking. It did exactly what I needed - block if the promotion is excluded, but spell works if it does anything else, including python.

I have another problem that drives me crazy. I have added your turn display fix, and I finally will know when something was founded. But now I have turn listed twice in the upper right part of the screen. There is something simple and easy I need to find, of that I am sure, but I have no idea what did I forgot.
 
Be careful that you kill the players in the game, not in worldbuilder. As I recall I supressed almost every pop-up if you initiate it through worldbuilder.

To remove your second turn display you have to edit CvMainInterface.py.
 
Back
Top Bottom