various improvements for ease of empire management

A place for discussion of making game modifications.
User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

various improvements for ease of empire management

Postby siyoa » Tue May 30, 2017 6:04 am

*** FOR LATEST FILES CHECK THIS POST ***

it should now work in Mod folder just fine, also cleaned up PopIcons.lua so that it contains only the function I added

any issue, please let me know

if you want just empty slots showing (and not fancy icons for population), you only need @PlanetListPane.lua from the zip file

*** 2018-May-05 ***

added race icons and orbital structures to @PlanetListPane.lua, to enable change following variable to true, it is at the very beginning of the file

added Population Pane (credit Harpy Eagle, thanks :) )

*** known issues ***

sorting doesn't work properly

Code: Select all

--[[ *** Show RACE icons *** ]]--
local eee_show_race_icons=false
--[[ *** END *** ]]--
Attachments
E_GUI.7z
(86.18 KiB) Downloaded 920 times
Last edited by siyoa on Sat May 05, 2018 5:21 pm, edited 8 times in total.
How did YOU get a key? All right, go in.

User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: various improvements for ease of empire management

Postby siyoa » Sun Mar 18, 2018 2:27 am

so, I redesigned this ... it no longer shows on planet pane ... it shows on star system overview

the reason I like this, is that it helps me to micro manage the game ... I now can quickly say if I have all races available to me on the particular planet to maximize population cap and to unlock as many improvement slots as I can

I am function over form, so it is ugly, is there anyone willing to help me figure out how to change the text to nice little icons representing races ? I was looking into the code a bit and it goes beyond what I want to spend on it :oops:

EDIT: the file doesn't contain all races in the game, just edit as necessary
Attachments
planetrow.jpg
planetrow.jpg (74.09 KiB) Viewed 27176 times
Last edited by siyoa on Mon Apr 16, 2018 9:41 pm, edited 2 times in total.
How did YOU get a key? All right, go in.

User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: various improvements for ease of empire management

Postby siyoa » Thu Mar 22, 2018 4:38 am

showing amount of available empty improvement slots on Planetary Report

EDIT: renamed the thread, also can it please be moved to mods area ? thanks
Attachments
planetary_report_02.jpg
planetary_report_02.jpg (36.86 KiB) Viewed 27133 times
Last edited by siyoa on Mon Apr 16, 2018 9:41 pm, edited 1 time in total.
How did YOU get a key? All right, go in.

User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: various improvements for ease of empire management

Postby siyoa » Sat Mar 24, 2018 7:27 pm

siyoa wrote:EDIT: the file doesn't contain all races in the game, just edit as necessary


for adding tinkers (they like to play tricks), the edit needs to look like this

Code: Select all

local raw = remove_race_suffix(race)
if raw == 'tinker' then eee_pop_sum=tostring (eee_pop_sum..'ti.') end
How did YOU get a key? All right, go in.

User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: various improvements for ease of empire management

Postby siyoa » Sun Mar 25, 2018 10:04 pm

that thing about tinkers got me thinking, my approach is sub-optimal here, not really taking into account unhappy or harmonized type of population, every race should really be stripped of suffix

anyway, I may redo it completely, it seems I figured how to show race icon, all I need now is to make the size smaller and figure were to place it
Attachments
planetrow2.jpg
planetrow2.jpg (48.88 KiB) Viewed 27073 times
Last edited by siyoa on Mon Mar 26, 2018 2:02 am, edited 1 time in total.
How did YOU get a key? All right, go in.

User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: various improvements for ease of empire management

Postby siyoa » Sun Mar 25, 2018 10:31 pm

I think I got it, for now
Attachments
planetrow3.jpg
planetrow3.jpg (100.34 KiB) Viewed 27067 times
Last edited by siyoa on Mon Apr 16, 2018 9:40 pm, edited 1 time in total.
How did YOU get a key? All right, go in.

User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: various improvements for ease of empire management

Postby siyoa » Sun Mar 25, 2018 10:35 pm

hmm, I may need a help here from Sven or Arioch

it seems that chibi_draw shows the same icon for human dissidents as it is for regular humans, or quite possibly I am doing something wrong :D
Attachments
chibi_draw.jpg
chibi_draw.jpg (426.33 KiB) Viewed 27067 times
How did YOU get a key? All right, go in.

User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: various improvements for ease of empire management

Postby siyoa » Sun Mar 25, 2018 11:02 pm

this maybe a solution, scaling is probably not perfect, you need both files as I had to create new function in PopIcons.lua
Attachments
planetrow4.jpg
planetrow4.jpg (47.28 KiB) Viewed 27065 times
Last edited by siyoa on Mon Apr 16, 2018 9:40 pm, edited 1 time in total.
How did YOU get a key? All right, go in.

User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: various improvements for ease of empire management

Postby siyoa » Sun Apr 01, 2018 10:09 pm

trying to add a number for each population (I also added tanks to be displayed here) ... I am failing badly, I just cannot think today

basing my approach as per the picture (in other words, looking into the code of ShipMidscreenPane.lua) ... do I have to use add_resize_callback | function () ? or is there a way around ? is it even possible in PlanetRow.lua ? please help :cry:
Attachments
units_amount.jpg
units_amount.jpg (65.84 KiB) Viewed 26998 times
How did YOU get a key? All right, go in.

User avatar
siyoa
Posts: 182
Joined: Fri Apr 21, 2017 3:19 pm

Re: various improvements for ease of empire management

Postby siyoa » Tue Apr 03, 2018 4:53 pm

sven ? arioch ?
How did YOU get a key? All right, go in.

zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: various improvements for ease of empire management

Postby zolobolo » Sat Apr 07, 2018 12:13 pm

Hi Siyoa

Looks really inserting: displaying icons and troop types/number on planet should be very useful if large amount of planets to keep track of everything without having to browse through a lot of planets

Question: which file should be downloaded for the icons and troop numbers on the planet? You have attached a couple of additions files since the original upload

Also: would you be interested to do a pie-chart based on the cum of all pop types in the diplomacy menu - wherever it can be inserted?
This is nothing important game-play wise but it should look rely cool to see the empire composition. Think Stellaris had something like this, but due to the boring graph elements I don1t think anyone rely looked at it - should not be a problem with these pop icons though

User avatar
sven
Site Admin
Posts: 1620
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: various improvements for ease of empire management

Postby sven » Sat Apr 07, 2018 9:30 pm

siyoa wrote:it seems that chibi_draw shows the same icon for human dissidents as it is for regular humans, or quite possibly I am doing something wrong :D


You're not doing anything wrong -- there is no chibi asset for any of the dissident types. Because they can't be moved, the vanilla version of the game doesn't include any chibi assets for them. The standard fallback behavior when a popicon asset doesn't exist is just to draw the 'vanilla' version of that pop -- and you're hitting that behavior here.

User avatar
sven
Site Admin
Posts: 1620
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: various improvements for ease of empire management

Postby sven » Sat Apr 07, 2018 9:47 pm

siyoa wrote:basing my approach as per the picture (in other words, looking into the code of ShipMidscreenPane.lua) ... do I have to use add_resize_callback | function () ? or is there a way around ? is it even possible in PlanetRow.lua ? please help :cry:


OK -- I'm back after a bit of a hiatus, and catching up on old messages / bug reports.

Basically, the number in the chibi passenger display is a bit tricky, because it's a pre-rendered asset that needs to be re-rendered anytime the screen resolution changes. The easiest way to get one in PlanetRow.lua would be to render one using the tooltip_text_context, which is a sortof global misc-text render rendering context you can use for this kindof stuff. You don't need to render it inside an add_resize_callback, but, you do need to do something to ensure it gets re-rendered on screen resizes, and, obviously, you don't want to re-render a new asset on each screen refresh. I usually use weak memoization hacks in this kind of situation.

So, putting all that nonense together; I'd suggest writing a helper function that looked kinda like this:

Code: Select all

local shadow_options = {sigma=.8,spread=.5,opacity=.9}
local small_shadowed_word_drawer  = weak_memoizeNN | function(text)
  local tooltip_text_context in SCOPE._ELEMENT_ENV
   local word= tooltip_text_context!.lazy_word_render('vera14',text)
    if not word.draw_shadow
    shadowed_word(shadow_options,word)
  end

  return function(cx,cy)
    local x=cx-word.w*.5
    local y=cy
    word.draw_shadow(x,y)
    word.draw(x,y)
  end
end


Then you can draw your numbers (with back shadow) using something like:

Code: Select all

  small_shadowed_word_drawer(format("%d",2))(x,y)

grothmag
Posts: 26
Joined: Sun Apr 08, 2018 5:14 am

Re: various improvements for ease of empire management

Postby grothmag » Mon Apr 09, 2018 4:32 am

siyoa wrote:showing amount of available empty improvement slots on Planetary Report


I hope it's OK to ask a question here - I don't want to add a new topic to Modding overall, though this question might be about how to use mods in general.

I've tried to use this very useful and quite simple mod, but no change to the Planet List is observed.

I've placed the @PlanetListPane.lua file in:
(game directory)\Mods\ShowPlanetSitesAvailable\GUI\~GalaxyMap

...which mirrors the original file location, but with Mods in place of "Lua state". On startup, the game correctly shows ShowPlanetSitesAvailable as an installed mod, so the folder is seen. But the change (just to planet_draw(), I think) does nothing. The same is true for attempting to use the PopIcons/PlanetRow mod.

I apologize for asking a mod user question on a thread meant for mod devs, but I don't see a more appropriate forum. I've read makingmods.txt, and http://stars-in-shadow.com/modding.html, but as far as I can tell I'm doing as they instruct. Akkamaddi's examples create a "Lua state" folder in the Mod directory, but that contradicts MakingMods.txt and prevents easy uninstall when using multiple mods.

User avatar
sven
Site Admin
Posts: 1620
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: various improvements for ease of empire management

Postby sven » Mon Apr 09, 2018 4:52 am

grothmag wrote:
siyoa wrote:showing amount of available empty improvement slots on Planetary Report


I hope it's OK to ask a question here - I don't want to add a new topic to Modding overall, though this question might be about how to use mods in general.

I've tried to use this very useful and quite simple mod, but no change to the Planet List is observed.

I've placed the @PlanetListPane.lua file in:
(game directory)\Mods\ShowPlanetSitesAvailable\GUI\~GalaxyMap


I'm afraid this is another instance of the modding bug I was discussing with harpy eagle earlier today. Long story short, to make the mod work inside the Mods\ subdir, you'll probably need to add the line

Code: Select all

reload_script [[GUI\~GalaxyMap\GalaxyMap.lua]]

To the bottom of the PlanetRow.lua file.

In a perfect world, this wouldn't be necessary; I will see if I can update the way mod loading works under-the-hood so that these kinds of strange reload hints aren't needed.


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 17 guests

cron