Mod-Modders Guide to Fall Further

It's been too long since we released... I know I tweaked an error with ALL safemove functions a while ago, but I can't remember if it was before the last release or not.

If I recall correctly, the issue was that I had messed up the AI_isPlotThreatened function, but looking in my current copy I have no changes in that function at all (which means it doesn't account for ranged attacks, curious why they didn't use AI_getPlotDanger instead... that is where I have it modified now)

I assume you are replacing the:

Code:
		if (GET_PLAYER(getOwnerINLINE()).AI_isPlotThreatened(plot(), 2))
		{
			if (AI_retreatToCity()) // XXX maybe not do this??? could be working productively somewhere else...
			{
				return;

But why did you reduce the danger range check to 1? If anything I would think it worth increasing that value due to the ease of enhanced movement which isn't reflected between turns.
 
you are probably right that the range should be increased rather than lowered. Nice to know you already found the error.

Does GET_PLAYER(getOwnerINLINE()).isBarbarian() return true also for Demons and Animals?
 
Is there a simple way to have a spell, everytime it is cast, to add to the Armageddon counter? Maybe I could have the spell provide an effect promotion that adds to it such as when an orc shaman sacrifices a unit it gives it a hidden ragnarok type promotion?
 
I only THINK I had already found it. I might be remembering something from before last patch, in which case if you noticed an error, I failed to fix it :)


Yes, isBarbarian checks for all 3 types.


I may go ahead and post my internal version for people who are code monkey enough to be willing to help solve a bug with loading savegames. For those of you who are just plain nosy, there is VERY little of the new material for 051 included in this since it is my working copy and I haven't updated the python/XML to reflect any other team member's work in quite a while. Any new XML/Python (ie - you'll notice it in game) is my own work for the most part, thus very little outside of what was needed for the new modular loading setup. I'll also be asking the WoC guys to help me look it over, but unless they are hoping to steal some of my fields for WoC they aren't too likely to want to spend the time on it, so basically I have some people with the will, but not the prior knowledge, and some with the prior knowledge, but not the will. Such fun :p

@deadliver: You'd have to use python. Doing it with an Effect Promotion on a unit you are about to sacrifice would increase the AC, then immediately decrease it again when the unit is killed.
 
Ok, took forever to upload, I can't imagine how horrible it will be to try and download. But if anyone thinks they have some nice debugging tools and would like to help make 051 a paradise for Modular Modders, please download my personal FF folder and see if you can crack the problem with loading savegames.


In the CvGameCoreDLL folder (parallel to Assets) you will find everything set up for both Codeblocks AND VS(Express)2008 (as long as you already have the libraries required to compile any civ DLL that is). We will be distributing the files like this from now on, especially since (if this bug gets fixed) we have a few new files added to the DLL now (more than just splitting CyMapInterface or whichever one it was before).


There are quite a few notes in the source about how the new functions work. Everything should be completely playable, as long as you don't try to load. To reproduce the crash, launch a game, hit SHIFT+F5, then SHIFT+F8 and it'll crash without even a second of delay.


Honestly not expecting too many people to download this and take a crack at fixing it, but last major crash issue was solved by one of the players and wasn't something I ever would have found myself, so I can always hope ;) (that and I am going to be heading back to my home town for 2 weeks, so modding time and connection to the net will be quite limited, so even if I found a solution I might not be able to do much about it at that point)
 
The Awakened counter for Scions no longer appears next to the mana bar, the button to toggle it is there but no counter.
 
I patched ffplus with A and it still did not appear. I am going to try a reinstall in the off chance I did something stupid. Let you know in a few minutes.
 
Oh crud, sorry guys wrong thread I got all confusticated :drool:
 
onunitcreated is run for all units created in the game (for example if you add them via worldbuilder), onunitbuilt only to those built by a city
 
Two questions this time, both regarding barbarian factions. :)

Where are the buttons for display in military advisor defined?
I have tried everything and finally just used the same names as in FF in buttons/civilizations directory. It works, but I am just curious what have I missed ;)

What exectly decides what kind of unit can spawn for every civ? I think animal tag for animals, but orcs and demons? I have manually blocked wraiths for orcs (Bunique in Unitclass and defined as unique for demons only) and plenty of other to stop spawning i.e. treants as a demon unit or elementals as aninmal/orc units. But I still get an animal earth elemental, even if it is set as not buildabler for any civ? :crazyeye:
 
Those buttons are defined in python IIRC. I had tried to generalize it, but attempts to do so failed. It was a file not modified by base FfH as I recall.


Spawning for each civ is decided by what units they are allowed via CivilizationInfos. I added the <bLimitedSelection> tag so that they have NONE replacements for absolutely every unitclass and buildingclass. So unless you specifically list a unit for them (you may have seen that the Orcs have UNITCLASS_WARRIOR replaced with UNIT_WARRIOR and wondered what was up), they have no access to it.

Orcs and Demons need to have the tech for the unit (I can't remember if they also need any required bonuses). Animals just need the unit to have Terrain/Feature Natives declared so it can actually spawn anywhere. I am considering adding a Min/Max turn spawn tag to unitinfos so you can delay the spawn of strong units and turn off the spawn of weak ones, and possibly allowing the Orcs/Demons to utilize Terrain/Feature natives as well so that Frostlings appear in the cold areas and hill giants appear in the deserts.


I would suspect Dungeon Exploration is the cause of your strange results popping up for cross-faction spawns. Check your GoodyInfos to ensure that the proper Civ is listed for each spawn Goody, and if you imported our Henchmen spawning system, make sure each creature is in the proper list.


As for <bAnimal>, I am not sure that this tag actually does ANYTHING anymore.
 
Thanks for a quick response

I did not add the bLimitedSelection tag. For some strange reason I was sure that it has something to do with limiting civ choice when starting the game, did not check and scheduled it for later ;)
Now I know why I have so many problems with weird spawns... :hammer2:

Now that you said it, I have changed all elementals from exploration to animal civ, so that would explain animal earth elemental

I am considering adding a Min/Max turn spawn tag to unitinfos so you can delay the spawn of strong units and turn off the spawn of weak ones, and possibly allowing the Orcs/Demons to utilize Terrain/Feature natives as well so that Frostlings appear in the cold areas and hill giants appear in the deserts.
These would be great. Also, lair spawning considering the terrain would help, too.
As for <bAnimal>, I am not sure that this tag actually does ANYTHING anymore.
I know of one instance it is used - in python, it sets bAnimal units to guard animal lairs and other to guard barrows, goblin forts and such.
 
Most lair spawns do consider the terrain, since they are handled in python. Those few which don't yet can be tweaked easily. Unless you mean the actual spawning OF the lairs, not FROM the lairs. That one I also had planned on.
 
You probably already know it but setting up spawns in the update loop rather than the turn loop can cause some performance problems. Atleast if you don't automatically give the spawned unit a Mission so that the update loop doesn't have to be run again. I just figured that out the hard way
 
yeah, its a easy decision for spawns from lairs etc. But what about spawns from spells aka Summons? Most Human players would use them in their "update" loop rather than at the right beginning before giving move orders. Probably a bit more tricky for the AI to do it right and fast.

I took a look at the source you posted earlier and changed a few things here but no luck for me :(
 
Back
Top Bottom