Modders Guide to FfH2

The problem then becomes the number of polygons, 30 guys will slow your graphics down considerably compared to 3.

If you did this you would probably need to do low poly versions of each unit.

By the time I'm finished with the mod, graphics cards will be good enough to handle it.
 
yeah, this was inspired by a friend saying he wanted a different style of graphics - sort of epic-er. Feeling less like a bunch of guys and more like an army. Heroes are a problem in this, if we did this in a game which has heroes (or even Mages) we would need a workaround. Like for mage types, a number of units springing up to do the fighting - swarms or fireballs etc - but I suspect this would require big SDK changes. (Thought on this, some unit art for battle spells could keep the unit hidden deep underground, only the combat anims pop them up... but still, needs work)

If we did this, maybe the Hero unit is the Hero and his or her retinue, so the actual unit could be multiple figs.

You probably want to check out the regiments mod which did something very similar to this. I think the unit wave size controls how many fight at once, so this is all configurable. But as Grey Fox alluded it is going to be a significant draw not only on the graphics card, but processor and memory as well. Resources that you may want to spend on bigger maps, more players, or shorter between turn times rather than larger unit stacks. But thats just my 2 cents.
 
You probably want to check out the regiments mod which did something very similar to this. I think the unit wave size controls how many fight at once, so this is all configurable. But as Grey Fox alluded it is going to be a significant draw not only on the graphics card, but processor and memory as well. Resources that you may want to spend on bigger maps, more players, or shorter between turn times rather than larger unit stacks. But thats just my 2 cents.

Thanks, I was wondering if anyone had already tried this.

Well, I'll discuss with my friend, this isn't really for my FfH modmod but just a thing we were discussing, which may not lead anywhere. It would be good to have the theory of it anyway.
 
Is there anyway to have a pre-made map place some civs in specific locations (preferred terrain) if those civs are used but not have the map require that those civs be used?
 
Is there anyway to have a pre-made map place some civs in specific locations (preferred terrain) if those civs are used but not have the map require that those civs be used?

No a way with a map alone. You would need some python to do this. I do it by including all the players in the map script and then killing the player on gamestart if your condititions arent met.
 
Question:

Can the Turn counter for Hell terrain be set to -1 so that it always turns to hell after the map is generated?
 
Question:

Can the Turn counter for Hell terrain be set to -1 so that it always turns to hell after the map is generated?

so, this wasn't working. i decided to just have the basic terrain have Hell art... but, this doesn't work. (game crashes while initializing, just before the intro movie)

any idea why?
 
I don't think that the plot counter can handle negative numbers. Note that the non-hell terrains have <iPlotCounterDown>0.

I would say that you could just remove the non- hell terrains and have the hell terrains have <iPlotCounterDown>0, but that would probably cause problems with mapscripts.

Having any gaps between the <iPlotCounterDown>s and <iPlotCounterUp>s would cause crashes too.

I don't know why changing the art defines on regular terrains would be a problem, unless you just had some typos.
 
Nope, i checked for typos...

though i might have left a gap... i'll check before coming back.

I had set Plotcounterup to 0, and done all the other changes that needed to be done to the appropriate plotcounterdown, but the map still generated with the usuall terrain.
 
does findCity work? I want a quick way to find the nearest city, I thought this was it but maybe I'm using it wrong. It looks like I ought to just be able to do
nearestCity = CyMap().findCity(iX, iY)
but I can't get it to go. (keep getting "this constructor takes no arguments."
 
Try this:
CyMap().findCity(iX, iY, PlayerTypes.NO_PLAYER, TeamTypes.NO_TEAM, true, false, TeamTypes.NO_TEAM, DirectionTypes.NO_DIRECTION, None)
 
Try this:
CyMap().findCity(iX, iY, PlayerTypes.NO_PLAYER, TeamTypes.NO_TEAM, true, false, TeamTypes.NO_TEAM, DirectionTypes.NO_DIRECTION, None)

Thanks, that at least changes the error to an unidentified C++ exception.

Here's what I am trying as a test, and getting the error on the pNearestCity = line.

Code:
pPlot = caster.plot()
iX = pPlot.getX()
iY = pPlot.getY()
pNearestCity = CyMap().findCity(iX, iY, PlayerTypes.NO_PLAYER, TeamTypes.NO_TEAM, true, false, TeamTypes.NO_TEAM, DirectionTypes.NO_DIRECTION, None)
pPlot = pNearestCity.plot()
caster.setXY(pPlot.getX(), pPlot.getY(), false, true, true)

can anyone guide me on this?
 
hm, looks to me like you might need the None in there to be an actual city which it's going to ignore...
 
.def("findCity", &CyMap::findCity, python::return_value_policy<python::manage_new_object>(), "CyCity* (int iX, int iY, int (PlayerTypes) eOwner = NO_PLAYER, int (TeamTypes) eTeam = NO_TEAM, bool bSameArea = true, bool bCoastalOnly = false, int (TeamTypes) eTeamAtWarWith = NO_TEAM, int (DirectionTypes) eDirection = NO_DIRECTION, CvCity* pSkipCity = NULL) - finds city")

Above is the code you are calling, I mostly pasted it to type this up, but why bother deleting it after?


Anyway, each time it states = something it means you don't need to enter that field, if you leave it blank then it will just use what is listed.

This means that you have to provide only the X and Y co-ordinate you want to find the nearest city from, but it will insist in that case on staying in the same area (continent basically). To avoid that issue, you will need to specify X and Y, potential owner of the city (or none if you don't care) by player and team, then you can state false to cancel the requirement for same continent. Same goes for trying to adjust any of the other values.

Skip city is mostly used if you want to ignore a city which you KNOW is the closest (ie - unit is standing in it already, or unit was attacking it and is now looking for a new target)

Make sure that you don't call this function without a valid X and Y (positive, but smaller than the map width/height). Maybe that is the source of your issues.
 
Anyway, each time it states = something it means you don't need to enter that field, if you leave it blank then it will just use what is listed.
Except it doesn't work. There are (only) a few Cy* functions which claim to work in python even when you omit certain information. They don't. You need to include it all.

In this case it even tries to call the CvCity version of pSkipCity, which obviously won't work so well if you don't include one. I suspect that's causing the c++ exception.
 
Ah, then NULL would be what you need to enter for it, not None. Unless None is python's version of Null I supppose. If neither of those work, use pPlot().getCity() or something along those lines, then it just cannot happen for a city while the unit is stationed in it, unless you include an If (pPlot().getCity() != NULL) to cover that case before you run the function (as obviously if you are standing on a city that will be the closest possible)

Depending on what exactly you are using the function for, you could use the unit owner's capital should a city be absolutely required for the function to work. That would require that it isn't intended to be beneficial to the unit itself, and cannot happen for a Barbarian (nor before a player settles their first city. But I'd say you should safely ignore the case of Require Complete Kills gameoption and final city being eliminated)
 
Maybe it won't do what I want then, I need a unit standing in a field to be able to determine the nearest city regardless of any other conditions. I could do it in Python but as I want to run it multiple times per turn, it might slow down a bit.
 
Ignore my second paragraph, I edited the first one to work better after I had hit post and just never removed the second bit. I think that if you try what I wrote it ought to work for a unit in any location (that would be to try NULL instead of None, and if it still tosses an error, try checking if the plot the unit is on is a city (thus meaning you don't NEED to look for the nearest, and if it isn't, use the findCity command with the Ignore City block filled in as pPlot().getCity())
 
None is pythons version of NULL.


You can't use the owners capital? Like this:
(like xien said won't work for the barbs or if you have no city.)
Code:
pCapital = gc.getPlayer(caster.getOwner()).getCapitalCity()
if not pCapital.isNone():
	pPlot = caster.plot()
	iX = pPlot.getX()
	iY = pPlot.getY()
	pNearestCity = CyMap().findCity(iX, iY, PlayerTypes.NO_PLAYER, TeamTypes.NO_TEAM, true, false, TeamTypes.NO_TEAM, DirectionTypes.NO_DIRECTION, pCapitalCity)
	if (pNearestCity.isNone() or plotDistance(iX, iY, pNearestCity.getX(), pNearestCity.getY()) > plotDistance(iX, iY, pCapitalCity.getX(), pCapitalCity.getY())):
		pPlot = pCapitalCity.plot()
	else:
		pPlot = pNearestCity.plot()
	caster.setXY(pPlot.getX(), pPlot.getY(), false, true, true)
 
Back
Top Bottom