Modders Guide to FfH2

What is going to solve this issue is to see if the last element can be returned with the random generator.

xienwolf's random logs look convincing.

EDIT: in additions, some lists can return size 1 even if they are empty. In these lists, the last element is always empty, and not ment to be selected. Thus you actually need a len(lList)-2 to access the last valid element.

You not talking about python lists now, right? Just lists in programming in general.

Because a list in python will always have zero length if they are empty.

Anyway, I was going to remove some -1 and see if I got any IndexError or whatever during play. Unfortunately I realized my graphics card was fried, so I'll have to fix that first.
 
You not talking about python lists now, right? Just lists in programming in general.
Right.

Because a list in python will always have zero length if they are empty.

Anyway, I was going to remove some -1 and see if I got any IndexError or whatever during play. Unfortunately I realized my graphics card was fried, so I'll have to fix that first.

Well, It has been proved that, when a program's behaviour is weird, there is a human coding error hidden somewhere, and the compiler(especially the C++ compiler) has done something behind the scenes that makes it even more difficult to find out what it is.

I had spent a week a few months ago, trying to figure crashes on loading that sometimes occured and some not(on another program). I discovered, in the end, that C++ was saving the hidden pointer to the vtable with the object, and when loaded, the saved pointer overwritten the valid current one and the game crashed as soon as a virtual function was accessed. Since you cannot manipulate or even get this pointer in any way, it was a very difficult think to debug.
 
EDIT: Never mind I just missed that it also affected the isInvisible function as well... something stupid as predicted :)

I've been trying to make Nox Noctis leave units in city-like improvements visible in addition to cities, but I can't seem to see what I'm doing wrong. I'm sure it's something stupid, so I'm hoping an extra pair of eyes can spot it :blush:

I've already set forts up to act as cities again (along with some changes to keep AIs from using them for mana), but both forts and pirate coves are failing to leave my units unhidden in my current game.

Code:
//FfH: Modified by Kael 11/11/2008
//	return ((InvisibleTypes)(m_pUnitInfo->getInvisibleType()));
    if (m_iInvisibleType == NO_INVISIBLE)
    {
        if (plot()->isOwned())
        {
            if (GET_PLAYER(plot()->getOwnerINLINE()).isHideUnits())
            {
                if (plot()->getTeam() == getTeam())
                {
                    if (!plot()->isCity())
                    {
						//TSHEEP Add Forts as visible
						if(NO_IMPROVEMENT == plot()->getImprovementType())
							return ((InvisibleTypes)GC.getDefineINT("INVISIBLE_TYPE"));
						if (!GC.getImprovementInfo(plot()->getImprovementType()).isActsAsCity())//TSHEEP End
                        return ((InvisibleTypes)GC.getDefineINT("INVISIBLE_TYPE"));
                    }
                }
            }
        }
    }
    if (isInvisibleFromPromotion())
    {
        if (m_pUnitInfo->getEquipmentPromotion() != NO_PROMOTION)
        {
            return ((InvisibleTypes)2);
        }
        else
        {
            return ((InvisibleTypes)GC.getDefineINT("INVISIBLE_TYPE"));
        }
    }
	return ((InvisibleTypes)m_iInvisibleType);
//FfH: End Modify
 
16. Fixed a CtD caused by the AI upgrading to airships.

In Planetfall sea transports can be upgraded to the dropship, which can move over both land and sea. Comparable to the airship AFAIK. Now someone has reported a CtD after upgrading to the dropship. So I'm wondering, what was the cause of and solution for this CtD in FfH?
 
Repace the dds spalsh with your own, best to keep the same name, just repalce itwith your own dds.

I'm not finding any dds pictures that match the opening screen. Is that what you are talking about. I would like to change the picture on the main menu of the mod.

Thanks!

Cad
 
thank you xienwolf. some other questions :

1) can I use the ScenarioCounter function in the classic game ?
- if yes why does this function :
Code:
def ApplyEvent2(argsList):
	gc.getGame().changeScenarioCounter(2)
( used at the end of an event ) doesn't work?

- if no , is there another function i could use to do the same thing ?

2) Is there a function that can check what units are in a boat, ( a particularly what promotions they have)?

3) if an event is triggered with an OnUnitCReated function is there a way to prevent it from triggering twice ?
 
Sure looks like the Scenario counter ought to work fine in any game. And you seem to have the right format there. Are you sure that it did attempt to run before you checked the value for a change?

To check what units are in a boat, I think you will have to do a loop over all units on the tile and check each unit for pLoopUnit.isCargo() and then pLoopUnit.getTransportUnit() == pUnit. Then if those were both true you can check the promotions on that unit, knowing that it is loaded on your ship


You can either use a FEAT to track that it was already done, or if you just want it to happen the first time a unit is ever built, use the same format as previously posted, but this time UnitClassCreatedCount instead of BuildingClass.
 
hi, let me go straight to the point: I want to know if the equipment system in FfH2 is really attached to the spell system and, even if it is, do you (Kael, I guess) think it's possible (for me, of course) to turn into something more "stand alone".

I don't want equipments but something like crew in ships which do not act as units, but only as "attachables". I guess I could hack load and unload to add/remove promotions, but I would stay with the physical units which I don't really want to.

if there's a LOT of stuff to do I will think twice because it's not really something I need, it would just be cool to have it in my mod. however if I can spot easily what I need to copy into the SDK I'll do it. any other suggestion is also appreciated :P

thanks

As far as I can tell, no one responded to this post. I very much want to do the same thing. A stand-alone equipment system could help out many other mods.

There are so many nice new features in FFH2 that have never been released independently and are too complicated for poor saps like me to try and separate. :(

Help! :)
 
There is a LOT of interplay between features unfortunately. You could detach equipment from the spellsystem, but it would be fairly complicated to do it (if you mean to maintain the ability to transfer items between units and to have items drop when the unit dies). Certainly not something to tackle if you aren't already comfortable in the DLL, and converting it out for base BtS would be quite an endeavor for anyone to do, let alone support as well, if they weren't personally planning to use it :(
 
I'd very much like to use it for my mod. As well as things like Unique Features and other goodies from FFH2, but I don't have half the modding ability needed to do it. I think a lot of other mod makers would benefit from having these various features made accessible.
 
It may be easiest to just use FfH or the FF code as a base for your mod and dont use the features you dont want to use rather than trying to only add the features you want.
 
Hi, this is my first attempt at modmodding and it's going well so far, but I can't find the unit graphics I want to base my unit on: the priest of the Order.

The CIV4ArtDefines_Unit.xml file says that its address is at Art/Units/Religions/Order/Priest/Spearman.nif , but the Religions folder only has Empy in it...
Any idea where I can find it?

Thanks
 
Hi, this is my first attempt at modmodding and it's going well so far, but I can't find the unit graphics I want to base my unit on: the priest of the Order.

The CIV4ArtDefines_Unit.xml file says that its address is at Art/Units/Religions/Order/Priest/Spearman.nif , but the Religions folder only has Empy in it...
Any idea where I can find it?

Thanks

You need to unpack the Pak0.fpk file which is included in the mod.
 
with the program found there: http://www.civfanatics.net/downloads/civ4/utility/PakBuild.zip as you told me in the chat.

Thanks, Meth :)

I'm now having problems importing nif files into blender. I installed Python 2.5.4, PyFFI-py2.5, blender_nif_scripts-2.4.2, and blender now recognises python and displays an option to export work as nif files... but still doesn't recognise them when trying to open them.

I'm tired, so I'm going to leave this as is for now and sleep on it. Hopefully, a modder more experienced than me will be able to help :p

Cheers,
Jules

Edit: in the morning, dashed expectations :(
Bah, I'll work on it again, and see if I can find help in the chat today...

Edit2: I couldn't *open* stuff with blender, but I could *import* it :p
I was tired, that's all...
 
It may be easiest to just use FfH or the FF code as a base for your mod and dont use the features you dont want to use rather than trying to only add the features you want.

Any tips for removing FfH content (units, buildings, etc) without causing a million things to break?

I'm finding it difficult enough to make very basic changes to basic mods. I've had to do a lot of testing to make sure every little change doesn't break it. But the constant reloading & testing takes forever with FFH since it is such a big mod, I'd like to get rid of all the unnecessary art/content while keeping the bones. That'll make the modding easier, plus I think everyone will be surprized when the Cherokee build a Balor and attack Texas with it.
 
Any tips for removing FfH content (units, buildings, etc) without causing a million things to break?

I'm finding it difficult enough to make very basic changes to basic mods. I've had to do a lot of testing to make sure every little change doesn't break it. But the constant reloading & testing takes forever with FFH since it is such a big mod, I'd like to get rid of all the unnecessary art/content while keeping the bones. That'll make the modding easier, plus I think everyone will be surprized when the Cherokee build a Balor and attack Texas with it.

There is no easy way. I would cut the major files back to 1 entry (units, techs, promotions, buildings, unitclasses, buildingclasses, spells, etc), remove all associations to other objects in those single entries and then load and start working through the errors.

Its going to take a little time but at least the system tells you what reference you missed and its all xml work so its fairly simple.
 
What is the path to tracking down a CTD? What do you do as a modder to fix a CTD?

I'm getting one that happens around the same period of time every game, turn 350, and I'm not sure how to track it down.

Is there turning on extra logging that will tell you what happened?
 
Back
Top Bottom