[UI]DiploWillard - Easier City-States management from one window

Onni

Chieftain
Joined
Oct 9, 2010
Messages
82
This mod has been merged with CivWillard. Please disable this one and use that in the future...

With this mod you can manage City-states and see their data in an easy single screen. You will have a handy small button on your screen to open it at any time. Button even keeps you informed when your next ally or friend City-state is about to expire.

This is my first Civilization mod and for that reason I wanted to see what can be accomplish with the SDK's and API. Therefore I tried to make the mod as dynamic and modular as possible so it's easy to build on it in the future. This also enabled me to give the end user much more power to optimize the mod to their liking. As no Civ core files are changed or required this mod should be compatible with any other mod.

  • no dependencies (on other mods or core files)
  • handy button to open/close the window (right click to open options)
  • useful turn counter for the next City-State influence level change
  • configurable big tooltip for less important info needs
  • user-friendly controls for data and window management
attachment.php

attachment.php

attachment.php


Credits:
to Afforess, killmeplease and Whys for the awesome job on the serialize & deserialize functions discussed here. :king:

Version history:
V6.0
  • hotfix: button was behind CityWillards button
V5.0
  • added better options statistic selection dropdowns
  • added right clicking name centers the view to the city-state
  • added option to use mini-skin
  • added configurable big tooltip
  • added ability to create and rename views
  • added all options are saved individually for every view
  • added right clicking the main button opens options
  • added shorter names for city-states
  • fixed decimal number sorting
  • fixed better window positioning
  • fixed scrollbar not always showing
V4.0
  • fixed smoother window and button positioning
  • fixed window and button reset not saving bug
  • fixed wrong color for enemy City-states bug
  • fixed visible DiploWillard version number on the window
Even older version history:
Spoiler :

v3.0
  • fixed a game freezing bug
  • added better performance for the whole mod
  • added new stat (combined food/culture/military bonus)
v2.0
  • fixed 120+ influence counter bug
  • added Protected column
  • added options screen (custom colors, custom columns, etc.)
  • added saving of user settings
v1.0
  • initial version
 

Attachments

  • DiploWillard_minor_view.jpg
    DiploWillard_minor_view.jpg
    44.4 KB · Views: 19,370
  • DiploWillard_mini_skin.jpg
    DiploWillard_mini_skin.jpg
    11.7 KB · Views: 19,080
  • DiploWillard_misc_view.jpg
    DiploWillard_misc_view.jpg
    99.3 KB · Views: 175
  • DiploWillard_button.jpg
    DiploWillard_button.jpg
    5 KB · Views: 181
  • DiploWillard_big_tooltip.jpg
    DiploWillard_big_tooltip.jpg
    23.3 KB · Views: 206
  • DiploWillard_options.jpg
    DiploWillard_options.jpg
    31.7 KB · Views: 19,129
  • DiploWillard (v 6).zip
    DiploWillard (v 6).zip
    25.1 KB · Views: 416
  • DiploWillardCheat (v 6).zip
    DiploWillardCheat (v 6).zip
    25 KB · Views: 194
If anybody knows how to save options between different games then please do tell?

Game:GetScriptData and Game:SetScriptData allows Lua to save and retrieve a string. With some manipulation, you can convert most information into a large string of data, save it, then retrieve it when needed.
 
Very nice mod. :)

Two issues: the button seems to stay on top of city-screen. It should be an easy task modify this, but I couldn't find how to do this.

I was trying to change "ally" and "friend" colors to have them as in city-state icons (ie. green for friend and cyan for ally). I modified GG.GetColor(atWar, infLevel), this changed the name colors but icon colors remain as before.
 
Very nice, love it. Thanks a bunch for this.
 
Very nice mod. :)

Two issues: the button seems to stay on top of city-screen. It should be an easy task modify this, but I couldn't find how to do this.

I was trying to change "ally" and "friend" colors to have them as in city-state icons (ie. green for friend and cyan for ally). I modified GG.GetColor(atWar, infLevel), this changed the name colors but icon colors remain as before.

You could propably hide the button in city-screen with this event attachment:
Events.SerialEventEnterCityScreen.Add( hide_function )
I only have GG.OnToggle function there so maybe wrap that in a new hide function? For me this was a non-issue, since I preferred the button at the bottom, but if you move it then it can of course get in a way.

The City-state name is an xml-label and the icon an xml-image. That's why changing their colors works a bit different. Haven't yet figured any other than manual way to convert the predefined color tags (e.g. [COLOR_POSITIVE_TEXT]) to tables that are used with the xml-images. :( But you can do this manually in that GG.GetColor function by editing the table value after color tag.

Just setting up an options screen. Since now I can actually save these settings then maybe I'll add some of these there?
 
Game:GetScriptData and Game:SetScriptData allows Lua to save and retrieve a string. With some manipulation, you can convert most information into a large string of data, save it, then retrieve it when needed.

Hmm. This doesn't seem to work. When I try to run the command it gives an error message:
"Runtime Error: [string "_cmdr = {Game:GetScriptData("test")}"]:1: NYI"
NYI = Not Yet Implemented ?

It does work with pPlayer:GetScriptData. But the user needs to save the game to store it and even then it works only with that save game.

Right now I'm thinking about using that pPlayer:GetScriptData and some sort of parameter string copy&paste solution for new games? Any better ideas? :)
 
You could propably hide the button in city-screen with this event attachment:
Events.SerialEventEnterCityScreen.Add( hide_function )
I only have GG.OnToggle function there so maybe wrap that in a new hide function?
Thanks, I will try to figure it out.

There is some issue with turns to status change. If IP for city-state is grater then 120 then the number of turns to 120IP threshold is shown, not the number of turns to the ally-friendship threshold.
 
First great mod. However I think there may be a problem with your newest version. I haven't had any freezes until this morning. The game will freeze up after about a dozen turns (saved game or new game). I installed a few mods this morning so the first thing I tried was to play a vanilla game to make sure the freezing was the result of a mod... vanilla game worked fine with no freezes. So I started some trial an error by disabling mods one by one and I think I've narrowed down the problem to your mod. I've disabled it and now have played past 50 turns with no issues.

Has anyone else had issues with V2.0?
 
First great mod. However I think there may be a problem with your newest version. I haven't had any freezes until this morning. The game will freeze up after about a dozen turns (saved game or new game). I installed a few mods this morning so the first thing I tried was to play a vanilla game to make sure the freezing was the result of a mod... vanilla game worked fine with no freezes. So I started some trial an error by disabling mods one by one and I think I've narrowed down the problem to your mod. I've disabled it and now have played past 50 turns with no issues.

Has anyone else had issues with V2.0?
Thanks for the heads up! I haven't experienced this myself, but I'll look into this and get back as soon as there are any news. If anybody else is having these kind of problems then please let me know?
 
great mod... i've been wanting a better way to keep track of the city states...

i do have one suggestion though, might just be me nitpicking, but have you considered collapsing the food/culture/turns till new units into one column? dunno what you would call it, maybe B for benefits... but since a city state will only give you one thing, either food, culture or units... it seems a waste of space to have 3 columns for those things...
 
This kind of City-state window should be in vanilia. Great mod.

I observed the same as Ktulu. Yesterday the game crashed every few turn, always when starting my turns. I have though it was due to large number of units, but today I started a new game and every turn game friezes or a little when starting my turns and after some it crashes. I switched off your mod, and freezes are gone and I played ~20 turns without problems.
 
Wow, what a kick-ass mod! I just about melted when I saw the "move button", "move window", and resize height in the options! Is this really crashing on everyone? What a shame...

Minor bug: The WAR COLOR doesn't seem to be working for me. I am at war with Edinburgh, -60 rating, and it shows up using the NEUTRAL color instead...

Hope you can figure out why it's dying.
 
Version 3.0 is now available.

My apologies for the game freezing bug. :blush: I tracked it down to be caused by lua events that I had attached to the main update function. Nothing wrong with the event, but I hadn't really stress-tested this mod before. After that test I had my hands full in fixing my mistakes. I have so slow computer myself and so many windows opened that I really didn't notice anything out of the ordinary before. ;)

i do have one suggestion though, might just be me nitpicking, but have you considered collapsing the food/culture/turns till new units into one column? dunno what you would call it, maybe B for benefits... but since a city state will only give you one thing, either food, culture or units... it seems a waste of space to have 3 columns for those things...

This was a great idea so I implemented it with the fix. Thanks Lounahtic!
 
Cool! But this is weird: I went to look for it in the Downloads section here under Modpacks. v3.0 isn't showing up, v2.0 is gone. I figured you pulled it, or moved it. But when I Search for "Willard" it tells me it's in Civ5-Modpacks! Huh?

Found it through the game's browser though. The WAR COLOR thing is blatantly reproducible, I think, I didn't do anything special to make it happen again. Wasn't sure if I did something weird the first time.

Another minor thing: It still says v1.0 in the corner of the main window!
 
Nice mod, i like it!

The button looks and behave odd though. There is a square background just below the button, and since all other civ5 buttons are round, yours look out of place. Even when I move the button to other position, the ugly background still follows. Also when I mouse over the button, it moves upward a tiny distance. All other buttons stays in the same place when being mouse overed. There is no tooltip when mouseing over your button. Although this isn't needed, it would be neat if your button behaved and acted just like all other buttons.
 
Back
Top Bottom