Need help with modding the UI

I added an extra resource to the game, but this has given me 2 problems:

 

1) There is no counter on the UI showing me how much of said resource I have currently accumulated.

2) It is impossible to trade the resource, because it doesn't appear in the trading UI either.

I can live with both of the problems, but for the sake of convenience and completeness, I'd rather fix them both if it's not too much trouble.

So I'm looking for help on how to mod the UI. The only thing I came across so far is the advice to use DesktopX to mod the UI. DesktopX is no longer available though. So yeah....help?

18,689 views 13 replies
Reply #2 Top

Current code:

 

Code: xml
  1. <ResourceType InternalName="Resource_Spiders">
  2. <DisplayName>Wild Harridan</DisplayName>
  3. <Type>Harridan</Type>
  4. <Description>Build a Cellar here to produce Harridan mounts.</Description>
  5. <LongDescription>These spiders, normally hostile to anyone approaching their youngs, can be domesticated and used as mounts with the right technologies.</LongDescription>
  6. <BarredTerrain>River</BarredTerrain>
  7. <BarredTerrain>HillsTerrain</BarredTerrain>
  8. <PreferredTerrain>Category:Land</PreferredTerrain>
  9. <MinPerPlayer>0.5</MinPerPlayer>
  10. <Rarity>250</Rarity>
  11. <CanBeRazed>1</CanBeRazed>
  12. <NeedsToBeUnlocked>0</NeedsToBeUnlocked>
  13. <HarvestType>Mounts</HarvestType>
  14. <Production>1</Production>
  15. <Worth>5</Worth>
  16. <Global>1</Global>
  17. <ShowInGlobalDisplay>1</ShowInGlobalDisplay>
  18. <OnSelectSFX>Click_Spider_Lair</OnSelectSFX>
  19. <EnvironmentType>DeadEnvironment</EnvironmentType>
  20. <EnvironmentSpreadIntensity>100</EnvironmentSpreadIntensity>
  21. <EnvironmentSpreadRadius>1</EnvironmentSpreadRadius>
  22. <GameModifier>
  23. <ModType>Resource</ModType>
  24. <Attribute>TileYieldMaterials</Attribute>
  25. <Value>6</Value>
  26. <PerTurn>1</PerTurn>
  27. </GameModifier>
  28. <GameModifier>
  29. <ModType>Player</ModType>
  30. <Attribute>UnlockDiplomacyWndAbility</Attribute>
  31. <StrVal>Harridan</StrVal>
  32. </GameModifier>
  33. <AIData AIPersonality="AI_General">
  34. <AIPrefType>AIPrefType_MOUNT</AIPrefType>
  35. <AIPriority>3</AIPriority>
  36. </AIData>
  37. <Medallions InternalName="">
  38. <All>L_Black_Widow_01.png</All>
  39. </Medallions>
  40. <Icon>MapEditorIcon_Creatures.png</Icon>
  41. <IconColor>0,0,0</IconColor>
  42. <ClothIcon>Lair_Widow.png</ClothIcon>
  43. <TileDesign>R_Wild_Spiders_01</TileDesign>
  44. <ModelColor>0,0,0</ModelColor>
  45. </ResourceType>

 

Still doesn't show up in either spot. Or is the GameModifier supposed to go in the relevant tech (which would make sense)?

I'll try to remember the questions thread next time I mod myself into any trouble.

 

Edit: Spiders are tradeable now that I've moved the GameModifier to the Spider tech (will move it to Trading once everything works as it's supposed to). Still no counter on the main UI though.

Reply #4 Top

It's in the gfx directory. And I made sure that I had produced at least one before trying to look at both icons.

Will try adding the gfx part to the code.

Reply #5 Top

Quoting Phillybear, reply 2

Current code:

Code: xml
 
<ShowInGlobalDisplay>1</ShowInGlobalDisplay>
 
End of Phillybear's quote

 

Its <ShownInGlobalDisplay> not <ShowInGlobalDisplay>.

Note the n: ShowN

Reply #7 Top

Quoting random_thoughts_7, reply 5


Its <ShownInGlobalDisplay> not <ShowInGlobalDisplay>.

Note the n: ShowN
End of random_thoughts_7's quote

 

That did the trick. Thanks for your help both. Much appreciated.

 

Note to self: copy-paste instructions next time, it makes you look less like a fool.

Reply #9 Top

Quoting StevenAus, reply 8

Don't worry, we all look like a fool sometimes.
End of StevenAus's quote

 

It's just happening a lot to me lately :p

Reply #10 Top

@Phillybear,

Just curious, do you have your xml file with that new Resource Type in your mod folder?  And if so, does it work... i.e. does it generate Wild Harridan resources on the map?

Because I've got something similar but I found the resources don't generate unless the xml file for the ResourceType is in the Core folder, wondering if you experienced any different.

Thanks.

Reply #11 Top

I am more interested to know about the beer resource.

 

Is it made from the brewery upgrade in towns?  One every 15 turns or something?

What does it do?  Reduce empire wide unrest by 1?

 

Sounds like an awesome resource the way I am imagining it.  Kinda late in the tech tree and you would need a lot of towns to go ICS with it.

Reply #12 Top

Quoting abob101, reply 10

@Phillybear,

Just curious, do you have your xml file with that new Resource Type in your mod folder?  And if so, does it work... i.e. does it generate Wild Harridan resources on the map?

Because I've got something similar but I found the resources don't generate unless the xml file for the ResourceType is in the Core folder, wondering if you experienced any different.

Thanks.
End of abob101's quote

 

That code is in the Core file. I made it in my mod folder first, but nothing happened as long as the code wasn't in the Core file.