Request for help

Mynex

Warlord
Joined
Sep 30, 2010
Messages
287
I'm trying to add 2 new policies to the game.. I've got the basic setup in place, things show up in the civilpedia as they should...

But I can't seem to wrap my brain around the policies popup box xml and lua files to add the extra 2 policies at the far right of the screen.

The 2 files in question are in: Assets\UI\InGame\Popups
the 2 files are: SocialPolicyPopup.xml and SocialPolicyPopup.lua

Too keep it simple I was using the Liberty and Order policy branches graphics, just renamed to 'Green Society' and 'Consumerism'.

XML I have so far for it (no I haven't populated the items in each category yet, I wanted to get the display working first);
Civ5PolicyChanges.xml
Code:
<GameData>
<!-- Update XML/GameInfo/CIV5Policies.xml with the below -->
	<Policies>
		<Row>
			<Type>POLICY_GREEN_SOCIETY</Type>
			<Description>TXT_KEY_POLICY_BRANCH_GREEN_SOCIETY</Description>
			<BuildingProductionModifier>-10</BuildingProductionModifier>
			<Civilopedia>TXT_KEY_CIV5_POLICY_GREEN_SOCIETY_TEXT</Civilopedia>
			<Help>TXT_KEY_POLICY_GREEN_SOCIETY_HELP</Help>
			<PortraitIndex>24</PortraitIndex>
			<IconAtlas>POLICY_ATLAS</IconAtlas>
			<IconAtlasAchieved>POLICY_A_ATLAS</IconAtlasAchieved>
		</Row>
		<Row>
			<Type>POLICY_CONSUMERISM</Type>
			<Description>TXT_KEY_POLICY_BRANCH_CONSUMERISM</Description>
			<PortraitIndex>30</PortraitIndex>
			<BuildingProductionModifier>25</BuildingProductionModifier>
			<Civilopedia>TXT_KEY_POLICY_CONSUMERISM_TEXT</Civilopedia>
			<Help>TXT_KEY_POLICY_CONSUMERISM_HELP</Help>
			<IconAtlas>POLICY_ATLAS</IconAtlas>
			<IconAtlasAchieved>POLICY_A_ATLAS</IconAtlasAchieved>
		</Row>
	</Policies>
	<Policy_Flavors>
		<Row>
			<PolicyType>POLICY_GREEN_SOCIETY</PolicyType>
			<FlavorType>FLAVOR_EXPANSION</FlavorType>
			<Flavor>10</Flavor>
		</Row>
		<Row>
			<PolicyType>POLICY_CONSUMERISM</PolicyType>
			<FlavorType>FLAVOR_GOLD</FlavorType>
			<Flavor>10</Flavor>
		</Row>
	</Policy_Flavors>
			<!-- Update XML/GameInfo/CIV5PolicyBranchTypes.xml with the below -->
	<PolicyBranchTypes>
		<Row>
			<Type>POLICY_BRANCH_GREEN_SOCIETY</Type>
			<Description>TXT_KEY_POLICY_BRANCH_GREEN_SOCIETY</Description>
			<Help>TXT_KEY_POLICY_BRANCH_GREEN_SOCIETY_HELP</Help>
			<Title>TXT_KEY_GREEN_SOCIETY_TITLE</Title>
			<EraPrereq>ERA_MODERN</EraPrereq>
			<FreePolicy>POLICY_GREEN_SOCIETY</FreePolicy>
		</Row>
		<Row>
			<Type>POLICY_BRANCH_CONSUMERISM</Type>
			<Description>TXT_KEY_POLICY_BRANCH_CONSUMERISM</Description>
			<Help>TXT_KEY_POLICY_BRANCH_CONSUMERISM_HELP</Help>
			<Title>TXT_KEY_CONSUMERISM_TITLE</Title>
			<EraPrereq>ERA_MODERN</EraPrereq>
			<FreePolicy>POLICY_CONSUMERISM</FreePolicy>
		</Row>
	</PolicyBranchTypes>
<!-- Update XML/NewText/EN_US/CIV5GameTextInfos_Jon.xml with the below -->
	<Language_en_US>
		<Row Tag="TXT_KEY_POLICY_BRANCH_GREEN_SOCIETY">
			<Text>Green Society</Text>
		</Row>
		<Row Tag="TXT_KEY_POLICY_BRANCH_GREEN_SOCIETY_CAP">
			<Text>GREEN SOCIERTY</Text>
		</Row>
		<Row Tag="TXT_KEY_POLICY_BRANCH_GREEN_SOCIETY_HELP">
			<Text>A [COLOR_POSITIVE_TEXT]Green Society[ENDCOLOR] ADD TEXT HERE[NEWLINE][NEWLINE] ADD TEXT HERE [COLOR_POSITIVE_TEXT]BUIDING MAINTENANCE[ENDCOLOR] by 10%.[NEWLINE][NEWLINE]</Text>
		</Row>
		<Row Tag="TXT_KEY_POLICY_BRANCH_CONSUMERISM">
			<Text>Consumerism</Text>
		</Row>
		<Row Tag="TXT_KEY_POLICY_BRANCH_CONSUMERISM_CAP">
			<Text>CONSUMERISM</Text>
		</Row>
		<Row Tag="TXT_KEY_POLICY_BRANCH_CONSUMERISM_HELP">
			<Text>[COLOR_POSITIVE_TEXT]Consumerism[ENDCOLOR] ADD TEXT HERE[NEWLINE][NEWLINE] ADD TEXT HERE [COLOR_POSITIVE_TEXT]BUIDING MAINTENANCE[ENDCOLOR] by 10%.[NEWLINE][NEWLINE]</Text>
		</Row>
		<Row Tag="TXT_KEY_CIV5_POLICY_GREEN_SOCIETY_HEADING">
			<Text>Green Society</Text>
		</Row>
		<Row Tag="TXT_KEY_CIV5_POLICY_GREEN_SOCIETY_TEXT">
			<Text>GREEN SOCIETY TEXT ADD TEXT</Text>
		</Row>
		<Row Tag="TXT_KEY_POLICY_GREEN_SOCIETY_HELP">
			<Text>GREEN SOCIETY HELP ADD TEXT</Text>
		</Row>
		<Row Tag="TXT_KEY_SOCIALPOLICY_GREEN_SOCIETY_ADV_QUEST">
			<Text>GREEN SOCIETY ADV QUEST ADD TEXT</Text>
		</Row>
		<Row Tag="TXT_KEY_SOCIALPOLICY_GREEN_SOCIETY_HEADING3_BODY">
			<Text>GREEN SOCIETY HEADING3 BODY ADD TEXT</Text>
		</Row>
		<Row Tag="TXT_KEY_SOCIALPOLICY_GREEN_SOCIETY_HEADING3_TITLE">
			<Text>Green Society</Text>
		</Row>
		<Row Tag="TXT_KEY_CIV5_POLICY_CONSUMERISM_HEADING">
			<Text>Consumerism</Text>
		</Row>
		<Row Tag="TXT_KEY_POLICY_CONSUMERISM_TEXT">
			<Text>CONSUMERISM TEXT ADD TEXT</Text>
		</Row>
		<Row Tag="TXT_KEY_POLICY_CONSUMERISM_HELP">
			<Text>CONSUMERISM HELP ADD TEXT</Text>
		</Row>
		<Row Tag="TXT_KEY_SOCIALPOLICY_CONSUMERISM_ADV_QUEST">
			<Text>CONSUMERISM ADV QUEST ADD TEXT</Text>
		</Row>
		<Row Tag="TXT_KEY_SOCIALPOLICY_CONSUMERISM_HEADING3_BODY">
			<Text>CONSUMERISM HEADING3 BODY ADD TEXT</Text>
		</Row>
		<Row Tag="TXT_KEY_SOCIALPOLICY_CONSUMERISM_HEADING3_TITLE">
			<Text>Consumerism</Text>
		</Row>
		<Update>
			<Where Tag="TXT_KEY_SOCIALPOLICY_HEADING1_BODY" />
				<Set Text="Social Policies are branches of choices representing the way you choose to govern your people. Will you be an authoritarian ruler, sacrificing a little freedom for discipline and increased productivity? Will you organize your civilization to have a strong military, or will you concentrate your efforts on expanding culture and borders?  Do you want to set up your civ as a monarchy or democracy? There are 12 different branches to choose from, each headlining a specific aspect of government.[NEWLINE][NEWLINE]Social policies have concrete effects for gameplay. Some increase your cities' production, while others generate more wealth, and still others help create a more effective military. There are no right or wrong policy choices in the game, and one policy may be better for a given circumstance than another, or better suit your personal playing style. Try them out and see.[NEWLINE][NEWLINE]Policies are arranged into 10 separate branches, each of which (once adopted) unlock a tree of five different policies. Unlocking these individual policies will give you the benefits described, and can even lead to a Cultural Victory." />
		</Update>
	</Language_en_US>
<!-- Update XML/BasicInfos/CIV5Concepts.xml with the below -->
	<Concepts>
		<Row>
			<Type>CONCEPT_SOCIAL_POLICY_BRANCH_GREEN_SOCIETY</Type>
			<Topic>TXT_KEY_TOPIC_SOCIALPOLICY</Topic>
			<Description>TXT_KEY_SOCIALPOLICY_GREEN_SOCIETY_HEADING3_TITLE</Description>
			<Summary>TXT_KEY_SOCIALPOLICY_GREEN_SOCIETY_HEADING3_BODY</Summary>
			<AdvisorQuestion>TXT_KEY_SOCIALPOLICY_GREEN_SOCIETY_ADV_QUEST</AdvisorQuestion>
			<Advisor>ECONOMIC</Advisor>
			<CivilopediaHeaderType>HEADER_POLICIES</CivilopediaHeaderType>
		</Row>
		<Row>
			<Type>CONCEPT_SOCIAL_POLICY_BRANCH_CONSUMERISM</Type>
			<Topic>TXT_KEY_TOPIC_SOCIALPOLICY</Topic>
			<Description>TXT_KEY_SOCIALPOLICY_CONSUMERISM_HEADING3_TITLE</Description>
			<Summary>TXT_KEY_SOCIALPOLICY_CONSUMERISM_HEADING3_BODY</Summary>
			<AdvisorQuestion>TXT_KEY_SOCIALPOLICY_CONSUMERISM_ADV_QUEST</AdvisorQuestion>
			<Advisor>ECONOMIC</Advisor>
			<CivilopediaHeaderType>HEADER_POLICIES</CivilopediaHeaderType>
		</Row>
	</Concepts>
</GameData>

And PolicyBoxUpdate.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 10/26/2010 7:11:39 PM -->
<!-- Update UI/InGame/Popups/SocialPolicyPopup.xml (Tied into SocialPolicyPopup.lua? Need to check) with the below -->
<Box>
	<Grid>
		<Stack>
			<!-- GREEN_SOCIETY BOX  -->
			<Box Size="190,290 " Anchor="C,T" Color="0,0,0,0">
				<!-- Policy Branch Image -->
				<Image Anchor="C,T" Offset="0,0" TextureOffset="0.40" Size="190,90" Texture="Assets/UI/Art/Icons/SocialPoliciesLiberty.dds" ID="BranchBack1" ToolTip="TXT_KEY_POLICY_BRANCH_GREEN_SOCIETY_HELP"/>
				<Image Anchor="C,T" Offset="0,0" Size="190,290" Texture="Assets/UI/Art/Icons/SocialPoliciesTrim.dds">
					<!-- Policy Choices ScrollPanel  -->
					<ScrollPanel Anchor="C,T" Offset="0,86" Size="190,500" Vertical="1" ID="LibertyPanel">
						<ScrollBar Offset="-4,0" Style="VertSlider" Anchor="R,C" AnchorSide="I,I" Length="460"/>
						<UpButton Offset="-4,-3" Style="ScrollBarUp" Anchor="R,T" AnchorSide="I,I"/>
						<DownButton Offset="-4,-3" Style="ScrollBarDown" Anchor="R,B" AnchorSide="I,I"/>
					</ScrollPanel>
				</Image>
				<!-- Disabled Boxes -->
				<Box ID="LockedBox1" Size="190,260" Offset="0,30" Anchor="C,T" Color="0,0,0,0">
					<HideOnMouseOver>
						<Image Anchor="C,T" Offset="0,0" TextureOffset="0.30" Size="190.260" Color="255.255.255.255" Texture="Assets/UI/Art/Icons/SocialPoliciesLiberty.dds"/>
					</HideOnMouseOver>
				</Box>
				<!-- adopt button -->
				<GridButton Size="170,36" Anchor="C,T" Offset="0,46" Font="TwCenMT18" String="" FontStyle="Shadow" Color0="Beige.255" Color1="Black.128" Style="BaseButton" ToolTip="TXT_KEY_POLICY_BRANCH_GREEN_SOCIETY_HELP" Hidden="0" ID="BranchButton1">
					<Image Anchor="R,C" Offset="0,0" Size="48,48" Texture="48Lock.dds" ID="Lock1"/>
				</GridButton>
				<Box ID="DisabledBox1" Size="190,290" Offset="0,0" Anchor="C,T" Color="0,0,0,0">
					<HideOnMouseOver>
						<Image Anchor="C,T" Offset="0,0" Size="190.290" Color="255.255.255.255" Texture="Assets/UI/Art/Icons/SocialPoliciesLiberty.dds"/>
						<Box Size="190,290" Offset="0,0" Anchor="C,T" Color="0,0,0,200"/>
					</HideOnMouseOver>
				</Box>
				<!-- Title -->
				<Label Anchor="C,T" Offset="0,8" String="TXT_KEY_POLICY_BRANCH_GREEN_SOCIETY_CAP" Font="TwCenMT20" FontStyle="Shadow" Color0="Beige.255" Color1="Black.255"/>
				<!-- Era Label 
						<Label ID="EraLabel1" Anchor="C,T" Offset="0,40"  WrapWidth="185" LeadingOffset="-4" String="TXT_KEY_ERA_AVAILALBE" Font="TwCenMT16"  FontStyle="Shadow"  Color0="Beige.255" Color1="Black.128"  />
                        -->
			</Box>
			<!-- CONSUMERISM BOX  -->
			<Box Size="190,290 " Anchor="C,T" Color="0,0,0,0">
				<!-- Policy Branch Image -->
				<Image Anchor="C,T" Offset="0,0" TextureOffset="0.50" Size="190,90" Texture="SocialPoliciesOrder.dds" ID="BranchBack8" ToolTip="TXT_KEY_POLICY_BRANCH_CONSUMERISM_HELP"/>
				<Image Anchor="C,T" Offset="0,0" Size="190,290" Texture="Assets/UI/Art/Icons/SocialPoliciesTrim.dds">
					<!-- Policy Choices ScrollPanel  -->
					<ScrollPanel Anchor="C,T" Offset="0,86" Size="190,500" Vertical="1" ID="OrderPanel">
						<ScrollBar Offset="-4,0" Style="VertSlider" Anchor="R,C" AnchorSide="I,I" Length="460"/>
						<UpButton Offset="-4,-3" Style="ScrollBarUp" Anchor="R,T" AnchorSide="I,I"/>
						<DownButton Offset="-4,-3" Style="ScrollBarDown" Anchor="R,B" AnchorSide="I,I"/>
					</ScrollPanel>
				</Image>
				<!-- Disabled Boxes -->
				<Box ID="LockedBox8" Size="190,260" Offset="0,30" Anchor="C,T" Color="0,0,0,0">
					<HideOnMouseOver>
						<Image Anchor="C,T" Offset="0,0" TextureOffset="0.30" Size="190.260" Color="255.255.255.255" Texture="SocialPoliciesOrder.dds"/>
					</HideOnMouseOver>
				</Box>
				<!-- adopt button -->
				<GridButton Size="170,36" Anchor="C,T" Offset="0,46" Font="TwCenMT18" String="" FontStyle="Shadow" Color0="Beige.255" Color1="Black.128" Style="BaseButton" ToolTip="TXT_KEY_POLICY_BRANCH_CONSUMERISM_HELP" Hidden="0" ID="BranchButton8">
					<Image Anchor="R,C" Offset="0,0" Size="48,48" Texture="48Lock.dds" ID="Lock8"/>
				</GridButton>
				<Box ID="DisabledBox8" Size="190,290" Offset="0,0" Anchor="C,T" Color="0,0,0,0">
					<HideOnMouseOver>
						<Image Anchor="C,T" Offset="0,0" Size="190.290" Color="255.255.255.255" Texture="SocialPoliciesOrder.dds"/>
						<Box Size="190,290" Offset="0,0" Anchor="C,T" Color="0,0,0,200"/>
					</HideOnMouseOver>
				</Box>
				<!-- Title -->
				<Label Anchor="C,T" Offset="0,8" String="TXT_KEY_POLICY_BRANCH_CONSUMERISM_CAP" Font="TwCenMT20" FontStyle="Shadow" Color0="Beige.255" Color1="Black.128"/>
				<!-- Era Label 
						<Label ID="EraLabel8" Anchor="C,T" Offset="0,40"  WrapWidth="185" LeadingOffset="-4" String="TXT_KEY_ERA_AVAILALBE" Font="TwCenMT16"  FontStyle="Shadow"  Color0="Beige.255" Color1="Black.128"  />
                        -->
			</Box>
		</Stack>
	</Grid>
</Box>

The policyboxupdate is just a straight cut of the current socialpolicybox.xml replacing liberty & Order with my names... I haven't changed anything else in it because I couldn't get my brain to wrap around the changes I need to make...

so, asking for some assistance please!
 
I could be wrong, but I don't think you can add more at the end. I think you have to edit/replace what is already there.
 
That's essentially the point of this exercise... to see if it is possible...

And I still haven't been able to wrap my head around this... everytime I look at it, I get a freaking headache. *sigh*

I'm not keen on replacing the policies just yet... yea, sure they need some help here and there (which Thal has done, thanks man!)... but they work for the most part..

meh, hopefully someone with far better LUA skills than myself will come along and kick me, er, kickstart me where/how to add in the LUA & XML. :p
 
Oh! It's possible. I know I've seen threads on it around here somewhere. I'm just not crazy enough to try messing with that stuff :)
 
lol... Well crazy... yea, have to accept that knock. ;o

I know I need to reassign the box size, set ID's for the new policies... but if I even change _one_ thing the policies window just fails to show up.

I'm beginning to wonder if I have to re-ID all the policies because of the crazy ID scheme they used in the first place, top row vs bottom row...

Meh, I'll try that next. *grabs advil*
 
Oh Crap! I didn't mean it like that! I'm having a hard time getting a basic mod up and running. For me, even considering what you are able to do is insane :D

It sounds to me like there are a few things that reference the policies and changing one thing without updating those relationships might be causing that to happen.
 
Well, someone has replaced all the policies... So there's nothing 'hidden' in there (that's obvious anyways)... It's just a matter of tweaking the damned thing until I get _something_ to display...

Of course, they very well could have put a limit of 10 policies displayed in the DLL... which would be monumentally stupid, but wouldn't surprise me with some of the other *cough*less than stellar*cough* choices of things they've locked up in the dll.

ah well, it is what it is... either I'll get it to work, or I won't... honestly, I'm not too worried about it, like I said, I just wanted to see if it was possible... still think it is... I just haven't hit the right button yet in me wee brain. :p
 
Back
Top Bottom