Kailric
Jack of All Trades
I am wanting to make it so if you rename your ship with a persons name, like "Captain Jack Sparrow" when you get messages about that unit it doesn't say "Your Captain Jack Sparrow blah blah blah". Instead of rewriting all the text files I am trying to pull one tag from xml text file and place it in another xml file and then display the information to the player via the "gDLL-getInterfaceIFace()->addMessage" in the SDK.
These lines:
<Tag>TXT_KEY_YOUR</Tag>
<English>Your</English>
<Tag>TXT_KEY_CAPTAIN</Tag>
<English>Captain</English>
are in my text files.
This is my code but the message appears corrupted and neither Your or Captain will appear, nor the name of the unit. What do I need to do to fix it.
Example?
These lines:
<Tag>TXT_KEY_YOUR</Tag>
<English>Your</English>
<Tag>TXT_KEY_CAPTAIN</Tag>
<English>Captain</English>
are in my text files.
This is my code but the message appears corrupted and neither Your or Captain will appear, nor the name of the unit. What do I need to do to fix it.
Example?
Code:
CvWString szYourorCaptian;
if (!hasCaptain())
{
szYourorCaptian = gDLL->getText("TXT_KEY_YOUR");
}
else
{
szYourorCaptian = gDLL->getText("TXT_KEY_CAPTIAN");
}
CvWString szBuffer = gDLL->getText("TXT_KEY_UNIT_ACTION", szYourorCaptian, getNameOrProfessionKey());
gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_BUILD_BANK", MESSAGE_TYPE_INFO, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"));
Code:
<TEXT>
<Tag>TXT_KEY_UNIT_ACTION</Tag>
<English>%s1 %s2_UnitName has died</English>