How to get a new xml file to load?

I am not sure Afforess' suggestion will show the exact cause. But, did you get the crash when you had VC++ attached to the process? Then VC++ will give you the calling stack at the time of the crash. Usually, hopefully, one of your new routines was just called with an unexpected value, or just returned an unexpected value.
 
I am not sure Afforess' suggestion will show the exact cause. But, did you get the crash when you had VC++ attached to the process? Then VC++ will give you the calling stack at the time of the crash. Usually, hopefully, one of your new routines was just called with an unexpected value, or just returned an unexpected value.

No, I got the same error message as before. Seems like no matter what I do, I just get the same error. Not even a crash or something. :dunno:
 
:mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad: :mad:

I must be the most stupidest person ever!
I got the loading work. The reason it didn't work was this
Code:
	LoadGlobalClassInfo(GC.getIdeologyInfo(), "CIV4IdeologyInfo[COLOR="Red"][B]s[/B][/COLOR]", "GameInfo", "Civ4IdeologyInfos/IdeologyInfos/IdeologyInfo", false);
"S"! Argh! So small mistake. :wallbash:
I hope I'll get rid of these stupid mistakes someday. :cry:

Thank you for your patience.
 
Good luck with that...

With time & experience they may happen less, but they still happen.
They don't get any less annoying or embarrassing.

Sad, but true. I still make typos and stupid goofs all the time... :mischief:
 
And it only gets worse as you get older. Take my word on it. ;)

If Afforess's avatar is a self portrait like my avatar is, he already knows all about it. :lol:

Edit: I really know who is in Afforess's avatar (I didn't just leave the shire yesterday!), but I couldn't resist the joke.
 
I think my next issue is part of this, that's why I didn't create a new thread.
I created a civilopedia page for ideologies with DLL. It required lots of work and doesn't seem to work. In the screen shot you can see the problem. The hover text isn't correct, and when clicking the ideology, I get a python error. (second screenie)
It seems to screw before the CvGameTextMgr, that should show the real info. It also might load something wrong, because it can't get the button that is already shown. (Notice the Judaism button right before "Test")
Where is the hover text in civilopedia drawn/written/shown? What I might have done wrong? Any ideas where to look for the error?
 
Nonetype means it is trying to look up information on NO_IDEOLOGY, or -1... You probably just need to add an if-check to make sure it isn't -1.
 
Nonetype means it is trying to look up information on NO_IDEOLOGY, or -1... You probably just need to add an if-check to make sure it isn't -1.
Ofcourse! :blush:
Sometimes i wish when I encouter error/crash that it's small problem so it would be easy to fix. But I also hope that it's more complicated to fix so it doesn't feel so bad. :(
Mayby someday...

BTW, that still didn't fix the weird hover text. Where it's written?
 
IDK, it might have to do with widgets... I'm sure someone like EF would know.
 
Hmm, there seems to be quite a lot of them. :hmm: I'll propably do a quick search in the forums if someone has already asked about them.

EDIT: I think I found how to do it. I'll just do a rebuild and should see.

EDIT2: Not working, got a crash. Building debug dll...
 
Now the game crashes when I click my test ideology, and clicking a corporation produces a python error, and somehow only two corps. are shown. All I added was these:
CvEnums.h
Code:
	WIDGET_HELP_IDEOLOGY,
CvDLLWidgetData.cpp
Code:
	case WIDGET_HELP_IDEOLOGY:
		parseIdeologyHelp(widgetDataStruct, szBuffer);
		break;
and CyEnumsInterFace.cpp
Code:
		.value("WIDGET_HELP_IDEOLOGY", WIDGET_HELP_IDEOLOGY)
How could these crash the game? And I did rebuild the DLL.
Also when hovering over ideologies gives odd numbers and info. (In the screenshot, the industrialism tech part is ok, but the grenadier should be rifleman and you should get only one, not 468 455 864). The second shows how the corporation page looks like. Debug DLL didn't catch anything.
 
Did you append the widget to the end of the widget list? I know that inserting stuff in hardcoded enums causes issues, since you can't expose the changes to the exe. Always append to the end of the list.

Also, want to show us what parseIdeologyHelp(...) does?
 
Okay, don't ever place your new widget types in the middle in CvEnums.h. I hope I'll remember that next time.
But the ideology still "gives" you lots of grenadiers, but now only 1239424. :eek: Everything else is working correctly.

EDIT: :agree: You posted right before me. :lol:
Code:
void CvDLLWidgetData::parseIdeologyHelp(CvWidgetDataStruct &widgetDataStruct, CvWStringBuffer &szBuffer)
{
	if (widgetDataStruct.m_iData2 != 0)
	{
		GAMETEXT.setIdeologyHelp(szBuffer, (IdeologyTypes)widgetDataStruct.m_iData1);
	}
}
 
What about CvGameTextMgr::setIdeologyHelp(...), what does that do?
 
What about CvGameTextMgr::setIdeologyHelp(...), what does that do?
It should display the civlopedia info, which is used in pedia hover info too. Here's the function
Code:
void CvGameTextMgr::setIdeologyHelp(CvWStringBuffer &szBuffer, IdeologyTypes eIdeology, bool bCivilopedia)
{
	UnitTypes eFreeUnit;
	CvWString szTempBuffer;

	if (NO_IDEOLOGY == eIdeology)
	{
		return;
	}
	CvIdeologyInfo& kIdeology = GC.getIdeologyInfo(eIdeology);

	if (!bCivilopedia)
	{
		szBuffer.append(CvWString::format(SETCOLR L"%s" ENDCOLR , TEXT_COLOR("COLOR_HIGHLIGHT_TEXT"), kIdeology.getDescription()));
	}

	szTempBuffer.clear();

	if (!bCivilopedia)
	{
		if (kIdeology.getTechPrereq() != NO_TECH)
		{
			szBuffer.append(NEWLINE);
			szBuffer.append(gDLL->getText("TXT_KEY_IDEOLOGY_FOUNDED_FIRST", GC.getTechInfo((TechTypes)kIdeology.getTechPrereq()).getTextKeyWide()));
		}
	}

	szBuffer.append(NEWLINE);

	if (kIdeology.getFreeUnitClass() != NO_UNITCLASS)
	{
		if (GC.getGameINLINE().getActivePlayer() != NO_PLAYER)
		{
			eFreeUnit = ((UnitTypes)(GC.getCivilizationInfo(GET_PLAYER(GC.getGameINLINE().getActivePlayer()).getCivilizationType()).getCivilizationUnits(kIdeology.getFreeUnitClass())));
		}
		else
		{
			eFreeUnit = (UnitTypes)GC.getUnitClassInfo((UnitClassTypes)kIdeology.getFreeUnitClass()).getDefaultUnitIndex();
		}

		if (eFreeUnit != NO_UNIT)
		{
			szBuffer.append(NEWLINE);
			szBuffer.append(gDLL->getText("TXT_KEY_IDEOLOGY_FOUNDER_RECEIVES_NUM", GC.getUnitInfo(eFreeUnit).getTextKeyWide()));
		}
	}
}
 
I would attach the debug dll in VS, put a breakpoint at each szBuffer.append(...) and see what is going on.
 
But the ideology still "gives" you lots of grenadiers, but now only 1239424.

This almost always means an uninitialized variable. Either, the print statement is not being passed the correct variable; or the variable is never initialized. Where is that supposed to be set to zero? And is it being set to zero?
 
This almost always means an uninitialized variable. Either, the print statement is not being passed the correct variable; or the variable is never initialized. Where is that supposed to be set to zero? And is it being set to zero?

That was it. I forgot the part that passes the amount of free units to the text. :mischief:
Not it works as intended. Thank you.
 
Top Bottom