Mod-Modders Guide to Fall Further

So...I want to have a unit run python after combat, and apply a promotion depending on the unitclass defeated.


My method thus far with python has been copying something that already works...but I'm not aware of any equivalent for this function. :(


Help?
 
Worldbuilder is controlled by python, lots of annoying junk to clean up in the python files for the extra barbarians unfortunately
Thanks, I will have to go through python eventually and it is good to hear that it is something I did not touch yet, and not a part that I did wrong :)

I did some more checks on my lair spawn problem. Seems that I imported code all right, but the problem seems to come from iSpawnPerGameLimit and iSpawnAtOnceLimit.
I tested it both in Orbis and FF and if they are not set manually to a greater number, their default is set by schema file to 0, so nothing spawns. -1 does not work either - is ignored it seems.
From my experience, that is the current behaviour in FF.

Also, is there any way to make lair spawning to take terrain into account? Currently it seems to be random, so I get lion dens on ice etc.
 
Those fields aren't active just yet. I haven't had the time to sit down with them and set things up so they work nicely, but I have so many plans for them. Negative numbers will allow unlimited spawning, 0 will turn off the spawning (I could see it being used so that there was a link to a specific unit and Civ to manipulate in python possibly)


I should probably make a Terrain/Feature Natives system for the Lairs. Could go a long way to making them work nicer.

As a heads up, the Lairs will be getting a "Leash" setting as well which can force the units which they spawn to remain within a certain distance. Should allow you to generate mini-empire systems of strong barbarians by having something with a high spawn rate and spawn limit and a decently small leash.


(For lots of fun, you do something like this:

Hill Giant Steading I
SpawnPerTurnChance 1000 (This field doesn't exist yet I think, and I'll set it up to be a chance out of 1,000)
SpawnChancesPerTurn 3 (Another field doesn't exist yet, but allows multiple spawns per turn)
SpawnLimit 9
LeashLength 0
Backlash false (doesn't exist yet, but if set it would cause the units spawned by the improvement to die at the start of any turn where the improvement no longer exists)
ImprovementUpgrade Hill Giant Steading II
Improvement Time 4


And Hill Giant Steading 2 being the exact same, but upgrades to Steading I


The end result would be a tile which spawns 3 Giants per turn, but they aren't allowed to move at all. But on the fourth turn, it upgrades, thus destroying the improvement and breaking the leash, sending the giants out rampaging and starting to spawn new ones :)
 
As a heads up, the Lairs will be getting a "Leash" setting as well which can force the units which they spawn to remain within a certain distance. Should allow you to generate mini-empire systems of strong barbarians by having something with a high spawn rate and spawn limit and a decently small leash.

Hooray.

Perhaps once you add this, could acheron be allowed to move? on a 5 tile leash from his home city. I wouldn't want him terrorizing the world, but it'd be nice if he could eat unwary armies that stray too close, and be something other than a big red paperweight waiting to die.
 
Sorry, should have been specific. I'm looking for ways to change the music you hear BEFORE you start a game... Want to change it to the new FfH music. :lol:

Edit: Also, is there any PrereqUnitType available in promotion infos? I've seen the ontile and notontile lines, but they aren't quite what I need..... Only things I can really do are specify the tier, in which case it also applies for HIGHER tiers which I don't want, or list every unit available to take it.... Which is easy as there are only 3, but makes it harder to expand the list.
 
You can go the other way around. Use AllowPromotions on the UnitInfo to authorize a single unit to gain a promotion, then you can flag the promotion as bRequirePermission as well to make sure nobody else is ever able to get it.

Or, you can just use <PrereqUnits> on PromotionInfos.
 
New FFH music? I haven't tried the latest release, hmm...

I hope you guys will be importing the new FFH art with the next update. I can help with the artdefine xml
 
Found the file I wanted to be able to change music... mainmenus.xml, in the artdefines. :lol: Never thought to look there....

I have a question, although it's not exactly urgent. :lol: How much DLL work would it be, to make the opposite of Fallow? As in, uses food for production? Would I be able to adapt the existing fallow code for that, or no?

Edit: Also, is there anything special you have to do to add completely new tracks to the game? From what I can tell, I've got them in the right directory, and I've included them in AudioDefines and Audio2Dscripts, but it's not working.
 
I am currently debugging a save game. Large Map turn 200. Managed to get turn time down from 50secs to 10secs by deleting one AI player (he took 40secs time while even bigger AI players need only 1-2secs).

I currently use CyInterface in a few Python Callbacks, for example:
CyInterface().addMessage(0,true,25,"This is Begingameturn: Time:%s" %(time.ctime()),'',0,'',ColorTypes(11), 0, 0, True,True) #pdebug
Now my Question: Is there an easy way to do the same in the dll? I don't want to create Python callbacks just to display text :-p
 
Would it be possible to cripple an unit in combat, decreasing its withdrawal chance but doing so that the decrease happens before the combat is finished and thus before the withdrawal is done?

For example, take a Warrior with the Crippler promotion which apply the Crippled promotion on attacking units. Then add a Horseman. The Horseman attacks the Warrior with, say, 75% withdrawal. The Crippled promotion reduces withdrawal by, say, 45%. How to make it so that the Horseman get the Crippled promotion before trying to withdraw from the combat, so that when trying it has 30% instead of 75%?
 
I second Opera's question.
Best if it would be possible by both unit itself and promotion, also a way to be able to decide to make it work on attack or defense.
That are just my ideas, any means to reduce withdrawal by specialized units would be great :)

Also, I have recently added starting screen enhancements from FF. Everything works fine unless I add display of buildings that do not replace anything - it causes crash both on Civ page in pedia and on civ selection in game start.
No idea what is causing it. I have yet one thing to check - maybe Civbuildings1, 2 and 3 cause it as they are neither bUnique nor have default building, but my hopes are slim.
Any ideas what is causing the problem? I have just one such building yet, but leaving this part of the code makes me feel bad...
 
I second Opera's question.
Best if it would be possible by both unit itself and promotion, also a way to be able to decide to make it work on attack or defense.
That are just my ideas, any means to reduce withdrawal by specialized units would be great :)

Also, I have recently added starting screen enhancements from FF. Everything works fine unless I add display of buildings that do not replace anything - it causes crash both on Civ page in pedia and on civ selection in game start.
No idea what is causing it. I have yet one thing to check - maybe Civbuildings1, 2 and 3 cause it as they are neither bUnique nor have default building, but my hopes are slim.
Any ideas what is causing the problem? I have just one such building yet, but leaving this part of the code makes me feel bad...
What are you trying to do exactly? Displaying a BUILDINGCLASS_CIV_BUILDING? I did something like that and posted it somewhere in the Orbis Bug Thread I think. But you could show your code, it would be useful to help :)
 
I know. But I want to make bUnique buildings to display - a bit different thing and it is already in FF. But when I add the code it crashes.
Rest assured, I am aware of your fix and will use it if it civbuildings stay as they are.

Edit: Finally had the time to check and civbuildings were the cause. So, move along, nothing to see here. Just anti-withdrawal mechanics questions are valid.
 
Valk: Not sure about adding new tracks. I would imagine you have to add them to a list in CIV4EraInfos.xml though, and/or CIV4CivilizationInfos.xml (if aiming for diplomacy/zoomed-in sounds)

Sephi: Which Civ was taking so long by the way? Might be something I can look into in a more general sense.

You can make text keys display through the DLL, or just output to a logging file, which is what I typically do. To place a text key in game, check out the messages when your units attack/defend, those are DLL generated outside of GameTextMgr.cpp, so show you what you need to know. To output to a log file, check out CvGame::getSorenRandNum, I have a logger set up in there which works quite nicely, you can restore the ability to timestamp to get very accurate indications of actual turn time.


Opera/Ahwaric: Two possible approaches you could use. First you could introduce the ability to apply a promotion to yourself/opponent BEFORE combat, or even through Defensive strike. Promotion hits before combat it means it has full effect. Or you could create a tag which grants Chase points, which act to counter Withdrawal capability.
 
Opera/Ahwaric: Two possible approaches you could use. First you could introduce the ability to apply a promotion to yourself/opponent BEFORE combat, or even through Defensive strike. Promotion hits before combat it means it has full effect. Or you could create a tag which grants Chase points, which act to counter Withdrawal capability.
Both options would require DLL work, right?
 
Sephi: Which Civ was taking so long by the way? Might be something I can look into in a more general sense.

You can make text keys display through the DLL, or just output to a logging file, which is what I typically do. To place a text key in game, check out the messages when your units attack/defend, those are DLL generated outside of GameTextMgr.cpp, so show you what you need to know. To output to a log file, check out CvGame::getSorenRandNum, I have a logger set up in there which works quite nicely, you can restore the ability to timestamp to get very accurate indications of actual turn time.
yeah, the logging system works great. thanks. The Problem was related to some weird UNITAI conversion. I added DOMAIN tags to all unitinfos and that seems to solve the problem, atleast I couldn't reproduce it again. Is there an easy way convert Int to String and back when dealing with UnitTypes (or other types like unitcombat, buildtype, etc.)?
 
I have a question regarding saving data.

I have managed through stealing from other mods and reading the one tutorial on saving data that i could find in this forum, to setup a global counter, which changes according to certain things units do.

The problem is, i would rather have a counter for each unit (of one civ) and i have no idea how to do that, because my knowledge of python is... not that great.

It would be helpful, if someone more python-savvy could give me some pointers.
 
Back
Top Bottom