Global Defines w/ Key's & Tables...

Shiggs713

Immortal
Joined
Mar 11, 2007
Messages
2,361
Location
Indianapolis
I'm wondering if anyone has messed with these yet, as I'm trying to and everything I've tried doesn't seem to take effect. Here's my code

Code:
<GameData>
	<Defines>
		<Update>
			<Where Name="NUM_AND_TECH_PREREQS"/>
			<Set Value="7"/>
		</Update>
		<Update>
			<Where Name="CALENDAR_DEFAULT"/>
			<Set Key="CALENDAR_MONTHS"/>
			<Set Table="Calendars"/>
		</Update> 
	</Defines>
</GameData>

the first update was working, at least until I added the second one, to be honest I think it is still working. Its also not a problem with the Action, I know for sure, because like I said, this is just adding onto a file that was already working.

I also tried it with only the setting the Key but it was the same result, and using "Value" instead of "Key", but it appears it should be key. Its just these rows with multiple tags, none of the others are troubling me. Thanks for any assistance,

Shiggs

Edit: also here is the code in the global defines and the calendars xml so you don't have to bother digging it up;

Code:
<Row Name="STANDARD_CALENDAR">
			<Key>CALENDAR_DEFAULT</Key>
			<Table>Calendars</Table>
		</Row>

Spoiler :
Code:
<GameData>
    
    <!-- Table definition -->
    <Table name="Calendars">
        <Column name="ID" type="integer" primarykey="true" autoincrement="true" />
        <Column name="Type" type="text" />
        <Column name="Description" type="text" />
    </Table>

    <!-- Table data -->
    <Calendars>
        <Row>
            <ID>0</ID>
            <Type>CALENDAR_DEFAULT</Type>
            <Description>TXT_KEY_CALENDAR_DEFAULT</Description>
        </Row>
        <Row>
            <ID>1</ID>
            <Type>CALENDAR_BI_YEARLY</Type>
            <Description>TXT_KEY_CALENDAR_BI_YEARLY</Description>
        </Row>
        <Row>
            <ID>2</ID>
            <Type>CALENDAR_YEARS</Type>
            <Description>TXT_KEY_CALENDAR_YEARS</Description>
        </Row>
        <Row>
            <ID>3</ID>
            <Type>CALENDAR_TURNS</Type>
            <Description>TXT_KEY_CALENDAR_TURNS</Description>
        </Row>
        <Row>
            <ID>4</ID>
            <Type>CALENDAR_SEASONS</Type>
            <Description>TXT_KEY_CALENDAR_SEASONS</Description>
        </Row>
        <Row>
            <ID>5</ID>
            <Type>CALENDAR_MONTHS</Type>
            <Description>TXT_KEY_CALENDAR_MONTHS</Description>
        </Row>
        <Row>
            <ID>6</ID>
            <Type>CALENDAR_WEEKS</Type>
            <Description>TXT_KEY_CALENDAR_WEEKS</Description>
        </Row>
    </Calendars>

</GameData>
 
noticed what I think was a mistake, fixed it and still nothing...

Code:
<GameData>
	<Defines>
		<Update>
			<Where Name="NUM_AND_TECH_PREREQS"/>
			<Set Value="7"/>
		</Update>
		<Update>
			<Where Name="CALENDAR_STANDARD"/>
			<Set Key="CALENDAR_MONTHS"/>
			<Set Table="Calendars"/>
		</Update> 
	</Defines>
</GameData>

tried with and without the Table, no difference. :(

oops :lol: now i see it... STANDARD_CALENDAR

edit: still no difference, this thing is a bugger
 
Code:
<GameData>
	<Defines>
		<Update>
			<Where Name="NUM_AND_TECH_PREREQS"/>
			<Set Value="7"/>
		</Update>
		<Update>
			<Where Name="CALENDAR_STANDARD"/>
			<Set Key="CALENDAR_MONTHS"/>
			<Set Table="Calendars"/>
		</Update> 
	</Defines>
</GameData>

The basic problem is, when you are Setting multiple values, you need to include ALL values in a SINGLE Set element, like this:

<Set Key="CALENDAR_MONTHS" Table="Calendars"/>

That should fix your problem. However I notice you don't actually need Table="Calendars" because that's the default value anyway!
 
yea, thats why I've been trying it with and without, I wasn't completely sure because its not working the way I thought it would.

edit:
I've got it boiled down to this;

Code:
<GameData>
		<Defines>
			<Update>
				<Where Name="NUM_AND_TECH_PREREQS"/>
				<Set Value="7"/>
			</Update>
			<Update>
				<Where Name="STANDARD_CALENDAR"/>
				<Set Key="CALENDAR_MONTHS"/>				
			</Update>
		</Defines>
</GameData>

still nothing. I even deleted the entire file, clean, rebuild, add new item, paste, re-made the action, rebuild and still nothing. :confused:
 
Oh lol. Now I see. STANDARD_CALENDAR is actually in <PostDefines> which is a separate table to <Defines> but it's easy to miss! I first noticed that <Defines> doesn't HAVE a Key field, only Value. Only <PostDefines> has Key.

Correct form is as follows:

Code:
<GameData>
		<Defines>
			<Update>
				<Where Name="NUM_AND_TECH_PREREQS"/>
				<Set Value="7"/>
			</Update>
		</Defines>
		<PostDefines>
			<Update>
				<Where Name="STANDARD_CALENDAR"/>
				<Set Key="CALENDAR_MONTHS"/>				
			</Update>
		</PostDefines>
</GameData>
 
wow, it still not working actually, this thing is really a pain.
 
has anyone modified any Defines or PostDefines successfully?

i just pasted that code into another file, that I have double checked is working (gamespeeds; research rate) I made it 10x normal to make it obvious. So I can rule out it not recognizing the file now.

I noticed the end at an era mods alters the same pre_req techs define but honestly I looked at it, its exactly the same as mine in the globaldefines, so I'm wondering if its even doing anything either.
 
ok this is freaking weird, apologies for the quadruple post. i guess these must not be used yet...

i remembered that the Legions mod changes some of the global defines, specifically the unit per tile rule.

So i copy that code, paste it into my globalDefines.xml, save, rebuild, now it is working, and the other stuff still isn't....

my code
Code:
<GameData>
	<Defines>
		<Update>
			<Where Name="PLOT_UNIT_LIMIT"/>
			<Set Value="2"/>
		</Update>
		<Update>
			<Where Name="NUM_AND_TECH_PREREQS"/>
			<Set Value="7"/>
		</Update>
	</Defines>
	<PostDefines>
		<Update>
			<Where Name="STANDARD_CALENDAR"/>
			<Set Key="CALENDAR_MONTHS"/>
		</Update>
	</PostDefines>
</GameData>

:( very bad news for scenario mods
 
Yeah, I can't seem to update <PostDefines> either. This is very bad for modders.
 
Back
Top Bottom