Two wierd glitches.

Murphy613

Prince
Joined
Nov 18, 2012
Messages
483
I have two weird problems with a scenario I'm working on. Firstly whenever I load the mod this shows up in the logs:

Code:
Database::XMLSerializer (Scenario/Load Screen/MaccabeeScenarioLoadScreen.xml): 'Row' or 'Delete' expected, got 'Box'.
Here's the file its complaining about, I can't make heads or tails out of it (it's copied exactly from the Rise of the Mongols scenario):
Spoiler :
Code:
<Context ColorSet="Beige_Black" Font="TwCenMT20" FontStyle="Shadow" >

	<Instance Name="ItemInstance" >
		<Box Anchor="L,C" Offset="0,0" Size="330,53" Color="255,255,255,0" >
			<Button Anchor="L,C"  Size="330,53" Color="255,255,255,255"  Offset="0,0" StateOffsetIncrement="0,0" ID="Button" >
				<ShowOnMouseOver>
					<AlphaAnim Anchor="L,C" Size="330,56" Pause="0" Cycle="Bounce" Speed="1" AlphaStart="2" AlphaEnd="1">
						<Grid   Size="330,56" Offset="0,0" Padding="0,0" Style="Grid9FrameTurnsHL" />
					</AlphaAnim>
				</ShowOnMouseOver>
				<AlphaAnim Anchor="L,C" Size="330,56" Pause="0" Cycle="Bounce" Speed="1" AlphaStart="2" AlphaEnd="1" ID="SelectionAnim" Hidden="1">
					<Grid   Size="330,56" Offset="0,0" Padding="0,0" Style="Grid9FrameTurnsHL" />
				</AlphaAnim>
				<Image Anchor="L,C"  Size="64,64" Texture="Assets/UI/Art/Icons/DifficultyLevelIcons256.dds" ID="Icon" />
				<Label Anchor="L,C" Offset="64,0" Font="TwCenMT22" ColorSet="Beige_Black_Alpha" FontStyle="Shadow" ID="Name" />
				<Image Anchor="C,B" Offset="0,0" Texture="bar340x2.dds" Size="340.1" />
			</Button>
			<Box Anchor="L,T" Offset="8,8"  Size="300,36" Color="255,255,255,0"  Hidden="1">
				<Label Anchor="L,T" Offset="0,0"  WrapWidth="300" LeadingOffset="-8" Font="TwCenMT18" ColorSet="Beige_Black_Alpha" FontStyle="Shadow" ID="Help" />
			</Box>
		</Box>
	</Instance>

	<Container ID="MainSelection" Size="1024,700" Anchor="c,c" >
		<Grid Size="960,658" Anchor="C,C" Offset="0,36" Padding="0,0" Style="Grid9DetailFive140" >

      <!-- Side treatments Removed because of Expansion UI treatment-->
      <!-- 		
    <AlphaAnim  Anchor="R,C"  AnchorSide="O.O"  Offset="-8,0" Size="16,32" TextureOffset="16.0" Texture="Assets/UI/Art/Controls/buttonsidesglow.dds" Pause="0" Cycle="Bounce" Speed="1" AlphaStart=".99" AlphaEnd=".25" Hidden="0"/>
		<AlphaAnim  Anchor="L,C"  AnchorSide="O.O"  Offset="-8,0" Size="16,32" TextureOffset="0.0" Texture="Assets/UI/Art/Controls/buttonsidesglow.dds" Pause="0" Cycle="Bounce" Speed="1" AlphaStart=".99" AlphaEnd=".25" Hidden="0"/>
		<Image Anchor="R,C" Offset="-8,0" TextureOffset="8.0" AnchorSide="O.O"  Texture="Assets/UI/Art/Controls/buttonsides.dds" Size="8,16" />
		<Image Anchor="L,C" Offset="-8,0" TextureOffset="0.0" AnchorSide="O.O"  Texture="Assets/UI/Art/Controls/buttonsides.dds" Size="8,16" />
    -->

      <Image Anchor="C,T" Offset="0,-33" AnchorSide="O.O"  Texture="Assets/UI/Art/Controls/topframe.dds" Size="512,128" />
			<Image Anchor="C,B" Offset="0,-109" AnchorSide="O.O"  Texture="Assets/UI/Art/Controls/bottomframe.dds" Size="512,128" />


			<!-- Back Button -->
			<GridButton Anchor="L,B"  Style="SmallButton" Size="150,32"  Offset="38,54" StateOffsetIncrement="0,0" ID="BackButton"  >
				<Label Anchor="C,C"  Offset="0,0"  String="TXT_KEY_BACK_BUTTON" Font="TwCenMT18" ColorSet="Beige_Black_Alpha" FontStyle="Shadow"  />
			</GridButton>

			<!-- Start Game  -->
			<GridButton Anchor="R,B" ID="StartButton" Offset="38,54" Size="260,45" Style="BaseButton" String="TXT_KEY_START_GAME"/>

			<!-- Screen Title  -->
			<Label Anchor="C,T" ID="ScreenTitle"  Offset="0,19" Font="TwCenMT20" Color0="30.50.80.255" Color1="133.184.186.255" Color2="133.184.186.255" FontStyle="SoftShadow" String="TXT_KEY_GAME_SELECTION_SCREEN" />

			<!-- Difficulty Selection -->
			<Box Anchor="L,T" Offset="38,55" Size="354,504" Color="255,255,255,0" >

				<Grid Anchor="C,T" Offset="0,0" Size="350,504" Padding="0,0" Style="GridBlackIndent8" Hidden="0" >
					<Grid Anchor="C,T" Offset="0,0" Size="354,504" Padding="0,0" Style="Grid9Frame" Hidden="0" >

						<Image Anchor="L,C" AnchorSide="O.I" Offset="-11,0" Size="32,64" Texture="Assets/UI/Art/Controls/9 Grids/Dec32x64Left.dds" />

						<ScrollPanel Anchor="L,T" Offset="0,32" Size="330,468" Vertical="1" ID="DifficultyScrollPanel" >
							<!-- Scroll Controls -->
							<ScrollBar Style="VertSlider" Length="432" Offset="0.18" Anchor="R,T" AnchorSide="O,I" />
							<UpButton  Offset="0.0"  Style="ScrollBarUp"  Anchor="R,T" AnchorSide="O,I" />
							<DownButton Offset="0.0" Style="ScrollBarDown"  Anchor="R,B" AnchorSide="O,I" />

							<Stack Anchor="L,T" Offset="0,0" StackGrowth="Bottom" Padding="0" ID="DifficultyStack" />

						</ScrollPanel>

					</Grid>
				</Grid>

				<Image Anchor="L,T" Offset="0,-1"  Size="354,45"   Texture="Assets/UI/Art/WorldView/SetupTab2.dds"  >
					<Label Anchor="C,C" Offset="0,-7" Font="TwCenMT20" ColorSet="Beige_Black_Alpha" String="TXT_KEY_AD_SELECT_DIFFICULTY" FontStyle="Shadow" />
				</Image>
			</Box>

			<!-- Dawn of Man-->
			<Box Anchor="R,T" Offset="38,55" Size="524,504" Color="255,255,255,0" >

				<Grid Anchor="C,T" Offset="0,0" Size="520,504" Padding="0,0" Style="GridBlackIndent8" Hidden="0" >
					<Grid Anchor="C,T" Offset="0,0" Size="524,504" Padding="0,0" Style="Grid9Frame" Hidden="0" >

						<Image Anchor="R,C" AnchorSide="O.I" Offset="-11,0" Size="32,64" Texture="Assets/UI/Art/Controls/9 Grids/Dec32x64Right.dds" />

						<ScrollPanel Anchor="L,T" Offset="0,6" Size="500,492" Vertical="1" ID="DoMScrollPanel" >
							<!-- Scroll Controls -->
							<ScrollBar Style="VertSlider" Length="456" Offset="0,18" Anchor="R,T" AnchorSide="O,I" />
							<UpButton  Offset="0.0"  Style="ScrollBarUp"  Anchor="R,T" AnchorSide="O,I" />
							<DownButton Offset="0.0" Style="ScrollBarDown"  Anchor="R,B" AnchorSide="O,I" />

							<Image Anchor="L,T" Size="80,80" Offset="24,16" Texture="assets\UI\Art\Notification\NotificationFrameBase.dds">
								<Image Anchor="C,C" ID="IconShadow" Offset="0,-1" Size="80,80" Texture="assets\UI\Art\Notification\CivSymbolsColor640.dds"/>
							</Image>
							<Stack Anchor="C,T" Offset="0,36" Size="128,128" StackGrowth="Bottom" Padding="12" ID="MainStack" >
								<Label Anchor="C,C" Offset="0,0" ID="Leader" ColorSet="Beige_Black_Alpha" Font="TwCenMT24" FontStyle="Shadow"/>
								<Label Anchor="C,C" Offset="0,0" ID="Civilization" ColorSet="Beige_Black_Alpha" Font="TwCenMT20" FontStyle="Shadow"/>
								<Image Anchor="C,C" Offset="0,0" Texture="bar340x2.dds" Size="340.1"/>
								<Label Anchor="C,C" WrapWidth="460" ID="Quote" LeadingOffset="-4" Offset="0,0" ColorSet="Beige_Black_Alpha" Font="TwCenMT14" FontStyle="Shadow"/>
								<Box Anchor="C.C" Offset="0,0" Size="400,6" Color="White.0"/>
								<Image Anchor="C,C" Offset="0,0" Texture="bar340x2.dds" Size="340.1"/>
								<Label Anchor="C,C" Offset="0,0" ID="BonusTitle" String="BONUS LABEL" ColorSet="Beige_Black_Alpha" Font="TwCenMT24" FontStyle="Shadow"/>
								<Label Anchor="C,C" WrapWidth="460" ID="BonusDescription" LeadingOffset="-4" Offset="0,0" ColorSet="Beige_Black_Alpha" Font="TwCenMT16" FontStyle="Shadow"/>
								<Image Anchor="C,C" Offset="0,0" Texture="bar340x2.dds" Size="340.1"/>
								<Stack Anchor="C,C" Offset="0,0" StackGrowth="Right" Padding="0" ID="SubStack" >
									<Box Anchor="C.C" Offset="0,0" Size="225,48" Color="White.0">
										<Image Anchor="L,C" Offset="0,0" Texture="IconFrame64.dds" Size="64.64" Hidden="0" ID="BF1">
											<Image Anchor="C,C" Size="64,64" Texture="WonderAtlas512.dds" ID="B1"/>
											<Label Anchor="R,T" AnchorSide="O,I" Offset="0,22" ID="BonusUnit" WrapWidth="150" ColorSet="Beige_Black_Alpha" Font="TwCenMT16" FontStyle="Shadow">
											</Label>
										</Image>
									</Box>
									<Box Anchor="C.C" Offset="0,0" Size="225,48" Color="White.0">
										<Image Anchor="L,C" Offset="0,0" Texture="IconFrame64.dds" Size="64.64" ID="BF2">
											<Image Anchor="C,C" Size="64,64" Texture="WonderAtlas512.dds" ID="B2"/>
											<Label Anchor="R,T" AnchorSide="O,I" Offset="0,22" ID="BonusBuilding" WrapWidth="150" ColorSet="Beige_Black_Alpha" Font="TwCenMT16" FontStyle="Shadow">
											</Label>
										</Image>
									</Box>
								</Stack>
								<Box Size="128,36" Color="Black,0" />
							</Stack>
						</ScrollPanel>

					</Grid>
				</Grid>

				<!--<Image Anchor="L,T" Offset="0,-1"  Size="454,45"   Texture="Assets/UI/Art/WorldView/SetupTab2.dds"  >
					<Label Anchor="C,C" Offset="0,-7" Font="TwCenMT20" ColorSet="Beige_Black_Alpha" String="TXT_KEY_MODDING_DESCRIPTION" FontStyle="Shadow" />
				</Image>-->
			</Box>

			<!--<Grid Size="960,658" Anchor="C,C" Offset="0,0" Padding="0,0" Style="Grid9DetailFive140" >
		<Label Anchor="C,T" Offset="0,15" Font="TwCenMT24" ColorSet="Beige_Black_Alpha" FontStyle="Shadow" String="Mongol Scenario"  />


		<Label Anchor="C,T" Offset="0,50" Font="TwCenMT18" ColorSet="Beige_Black_Alpha" FontStyle="Shadow" WrapWidth="620" String="This is some awesome placeholder text!" />

		<GridButton Style="BaseButton"  ID="BackButton" Size="100,32" Anchor="L,B" Offset="100,50"  String="Back"/>
		<GridButton Style="BaseButton"  ID="OKButton" Size="100,32" Anchor="R,B" Offset="100,50"  String="Begin"/>
    </Grid>-->

		</Grid>
	</Container>
</Context>

Also, in adddition to all the normal handicaps, there's another handicap showing up on
my list that says TXT_KEY_AI_HANDICAP_DEFAULT. I have no clue how it got there. Any ideas? Image posted below.
Spoiler :
attachment.php
 
1. It seems you have added that file to OnModActivated->UpdateDatabase. This shouldn't be done, as it's an UI XML file, not a file that updates the database. See here for more details on this subject.

2. This handicap was added in BNW, as the level on which the AI plays. The Mongol scenario was made earlier, so the code used for it doesn't hide this handicap. So it's better to use the code from BNW scenarios.
 
1. It seems you have added that file to OnModActivated->UpdateDatabase. This shouldn't be done, as it's an UI XML file, not a file that updates the database. See here for more details on this subject.
Thanks, I'll fix that.
2. This handicap was added in BNW, as the level on which the AI plays. The Mongol scenario was made earlier, so the code used for it doesn't hide this handicap. So it's better to use the code from BNW scenarios.
I'm using the Mongol code bec. its the only one where you can only play as one civilization, and my scenario is the same. Would you know where I can find (and then delete) the code to add that handicap?
 
I'm using the Mongol code bec. its the only one where you can only play as one civilization, and my scenario is the same. Would you know where I can find (and then delete) the code to add that handicap?

You shouldn't delete that handicap, as it's used in BNW for the AI players (and I assume your scenario is meant to be played with BNW). You should hide it in the scenario screen instead. I checked the code of the Mongol scenario and Scramble for Africa scenario, and I think you should replace this line:
Code:
	for info in GameInfo.HandicapInfos() do

With the following:
Code:
	for info in GameInfo.HandicapInfos("Type <> 'HANDICAP_AI_DEFAULT'") do

Hope this helps :)
 
Back
Top Bottom