Quick Modding Questions Thread

Oh well, sincere condolences to the people on Linux and a heartfelt "HAHA" to the drones of the fruit company.
I'm not sure that HAHA is justified as it is a bogus release rather than some OS limitation. It's no different from when the post-gamespy update killed using mods in multiplayer as well as direct connect. It's a stupid software design rather than OS related issues. In fact quite a lot of the modding I have done would have been easier in OSX (perl present by default, proper makefiles etc). OSX is far superior to windows for people advanced enough to write scripts and stuff like that. Don't listen to the mac fanbois in OS wars. From what I have seen, they don't understand OSX other than "it looks pretty".

I feel sorry that Firaxis screwed up the porting of the DLL concept. It's awesome and would have been even more awesome if it worked on all platforms. They might have guessed correctly that the average mac user wouldn't know how to compile, but the same is true for most windows users and all users can tell if what they download works or not. I wonder if it is possible to get civ4 to work in wine on OSX. People claim to do it in linux and wine actually exist for OSX as well.

All this is off topic for this thread though :p
 
Hardcoding the DLL was a decision made and implemented by Aspyr, who ported Civ4 to Mac, not Firaxis. They've done the exact same thing with Civ5. So it's mix of blame, Firaxis for using a Windows-specific DLL format in the place, and Aspyr for taking the lazy, modding-incompatible option.

I've had the Windows version of BTS running in Wine, but haven't been able to get it working under 10.11 unfortunately.

The lack of Notepad++ isn't really an issue, there are several excellent text editors with similar features on OS X. I use TextWrangler myself, highly recommended and free.
 
I'm not sure that HAHA is justified as it is a bogus release rather than some OS limitation. It's no different from when the post-gamespy update killed using mods in multiplayer as well as direct connect. It's a stupid software design rather than OS related issues. In fact quite a lot of the modding I have done would have been easier in OSX (perl present by default, proper makefiles etc). OSX is far superior to windows for people advanced enough to write scripts and stuff like that. Don't listen to the mac fanbois in OS wars. From what I have seen, they don't understand OSX other than "it looks pretty".

I feel sorry that Firaxis screwed up the porting of the DLL concept. It's awesome and would have been even more awesome if it worked on all platforms. They might have guessed correctly that the average mac user wouldn't know how to compile, but the same is true for most windows users and all users can tell if what they download works or not. I wonder if it is possible to get civ4 to work in wine on OSX. People claim to do it in linux and wine actually exist for OSX as well.

All this is off topic for this thread though :p
I agree. I wouldn't have touched OSX if my employer didn't have it as its standard on dev laptops, but it's not even nearly as bad as its reputation and definitely better than Windows. With some initial setup work you can basically turn it into what feels like a Linux machine. I don't like how the OS UI itself behaves and struggle with most applications that come with it, but that doesn't really matter if you live in the command line anyway.
 
how to show leaderhead icon in SDK?
I tried:
szString.append(CvWString::format(L"<img=%S size=24></img>", GET_PLAYER((PlayerTypes)iJ).getButton()));
instead of the written name:
// Vincentz szString.append(CvWString::format(SETCOLR L"%s" ENDCOLR, GET_PLAYER((PlayerTypes)iJ).getPlayerTextColorR(), GET_PLAYER((PlayerTypes)iJ).getPlayerTextColorG(), GET_PLAYER((PlayerTypes)iJ).getPlayerTextColorB(), GET_PLAYER((PlayerTypes)iJ).getPlayerTextColorA(), GET_PLAYER((PlayerTypes)iJ).getName()));

in CvGameTextMgr.cpp

but when compiling I got a:
>CvGameTextMgr.cpp(1618) : error C2039: 'getButton' : is not a member of 'CvPlayerAI'


Edit:
Nvm, got it.
szString.append(CvWString::format(L"<img=%S size=24></img>", GC.getLeaderHeadInfo((LeaderHeadTypes)iJ).getButton()));
 
How to identify indexes of players which are in war, if I have just cycle for iPlayer in range(gc.getMAX_PLAYERS()):?
 
Teams, not players are at war. bool CvTeam::isAtWar(TeamTypes eIndex) is the one you need. There are some other war functions in CvTeam, like count of how many wars you have right now.

I'm not sure if you can do anything but loop all teams, possibly until you found all you are at war with. Vanilla loops when asked for the count.
PHP:
int CvTeam::getAtWarCount(bool bIgnoreMinors) const
{
	int iCount;
	int iI;

	iCount = 0;

	for (iI = 0; iI < MAX_CIV_TEAMS; iI++)
	{
		if (GET_TEAM((TeamTypes)iI).isAlive())
		{
			if (!bIgnoreMinors || !(GET_TEAM((TeamTypes)iI).isMinorCiv()))
			{
				if (isAtWar((TeamTypes)iI))
				{
					FAssert(iI != getID());
					FAssert(!(AI_isSneakAttackPreparing((TeamTypes)iI)));
					iCount++;
				}
			}
		}
	}

	return iCount;
}
 
Hmmm I did answer this before you asked! :D

Spoiler :


Basically, if you don't alter it in a scenario file, it is the START_YEAR in the GlobalDefines file + the settings in the CIV4GameSpeedInfo file (iMonthIncrement combined with iTurnsPerIncrement) that determines the end of a game for a time victory.
 
Hmmm I did answer this before you asked! :D

Spoiler :


Basically, if you don't alter it in a scenario file, it is the START_YEAR in the GlobalDefines file + the settings in the CIV4GameSpeedInfo file (iMonthIncrement combined with iTurnsPerIncrement) that determines the end of a game for a time victory.

OK, I did increase the number of turns for my Marathon speed in CIV4GameSpeedInfo, but now I need to increase number of turns for Time Victory then, but where is this Scenario file?
 
I meant a .CivBeyondSwordWBSave file. You don't necessarily have one but if you play a scenario with the tag MaxTurns=xxx, then it will prevail on your XML settings.
 
I meant a .CivBeyondSwordWBSave file. You don't necessarily have one but if you play a scenario with the tag MaxTurns=xxx, then it will prevail on your XML settings.

ah ok, I get that, but is there a way to set how many turns the game uses to get to 2050 for Time Victory? Its obviously set somewhere, since different amount of turns is needed for different speeds.
 
Do the math: in BtS, all speeds amount to a total of 6050 years (4000BC to AD2050).

If you really need a tool, Platyping has one in his UltraPack.
 
Gamespeedinfo.xml

Multiply the months with turns for each step and divide with 12
That way you can see which is the last turn and when it happens.

Example from my own mod. After 2160AD and Time victory is off it will just continue the last turnsteps.
xwExZxu.png
 
Ok guys, we seem to be talking in circles. Or at least I seem to be missing soemthing.

So lets start again.
There are different game speeds. Each speed lasts different number of turns, even though it isrepresenting same amount of years. Therefore, the game measures time in TURNS for the purpose of Time Victory condition 2050AD.
What I did is increased number of turns Marathon lasts, and as result, my Time Victory shifted to an earlier period and now my game effectively ENDS at 1000AD instead of 2050AD.
To place at Time Victory 2050 again, I need to find WHERE and in WHICH file there is a setting which determines how many turns must pass before Time Victory is announced.
From data posted below I can clearly see that for base BTS Marathon the number of turns for Time Victory is 1500 - where is determined? How does the game knows that Time Victory has to be announced at turn 1500? Can I set it to a different number of turns? If yes, where?

Thanks again! ;)
 
Ok guys, we seem to be talking in circles. Or at least I seem to be missing soemthing.

So lets start again.
There are different game speeds. Each speed lasts different number of turns, even though it isrepresenting same amount of years. Therefore, the game measures time in TURNS for the purpose of Time Victory condition 2050AD.
What I did is increased number of turns Marathon lasts, and as result, my Time Victory shifted to an earlier period and now my game effectively ENDS at 1000AD instead of 2050AD.
To place at Time Victory 2050 again, I need to find WHERE and in WHICH file there is a setting which determines how many turns must pass before Time Victory is announced.
From data posted below I can clearly see that for base BTS Marathon the number of turns for Time Victory is 1500 - where is determined? How does the game knows that Time Victory has to be announced at turn 1500? Can I set it to a different number of turns? If yes, where?

Thanks again! ;)

There is no separate setting to define this, other than MaxTurns in a save file. Time victory takes as long as the total number of turns you've set in CIV4GameSpeedInfo.xml (add up each iTurnsPerIncrement tag). If you have the correct number of turns in your game, but it finishes on the wrong year, then you've got your iMonthIncrement calculations wrong.
 
There is no separate setting to define this, other than MaxTurns in a save file. Time victory takes as long as the total number of turns you've set in CIV4GameSpeedInfo.xml (add up each iTurnsPerIncrement tag). If you have the correct number of turns in your game, but it finishes on the wrong year, then you've got your iMonthIncrement calculations wrong.

Alright!I guess I will have to recheck everything and try to find my bug ;)
Thank you!
 
Unless you are modifying an ongoing game and expect it to take effect.
 
Unless you are modifying an ongoing game and expect it to take effect.
Generally speaking, way too much is saved in the savegames in both vanilla and most mods. Looking at vanilla, it even saves the content of caches :crazyeye: Not only will it create bigger savegames, it also prevents xml changes from taking effect. I would say expect xml changes to require starting a new game unless known to affect current games. Also the length of the arrays are required to load savegames, but aren't saved. This mean changing the length (like adding a unit) will render savegames unusable.

I solved both problems in M:C and C2C solved the xml array length issue as well (using a totally different code design). It shows that it can be done, but at the same time the coding difficulty is far beyond anything mentioned in the SDK subforum. Do not expect mods to have features like this unless they claim to do so.
 
Back
Top Bottom