• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Elth

Second Lieutenant
20 Badges
Apr 23, 2012
137
64
  • Dungeonland
  • Leviathan: Warships
  • Magicka
  • Imperator: Rome
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Magicka 2
  • Mount & Blade: Warband
  • War of the Roses
  • Warlock: Master of the Arcane
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • The Showdown Effect
  • Victoria: Revolutions
  • Europa Universalis IV
  • Crusader Kings II
Hello and thanks for reading this.

As some of you may know I'm develoing [S.E.G.O.] mod, and for a few days now I am trying to add stockpile resources to the top bar. I have managed to add the resource icon to the bar but I don't have a clue about adding the numbers that shows how many resources you have or the description that pops up when you hover the mouse.

I created a resource called "test", this resource is acumulative and has the same properties that minerals or energy, then i added this on interface\resources.gfx:

spriteType = {
name = "GFX_resource_test"
textureFile = "gfx/interface/icons/resources/test.dds"
}


and this on interface\main.gui

iconType = {
name = "test_icon"
spriteType = "GFX_resource_test" #this is the name the icon has on resources.gfx
position = { x= 1080 y = 8 }
}

instantTextBoxType={ #This is suposed to be the part with the text that shows the resources you have
name = "test_text"
position = { x= 1113 y= 9 }
font = "cg_16b"
maxWidth = 65
maxHeight = 16
}

Can anyone help me complete this? it's driving me crazy.
 
Pretty sure you need a hook from the hard-code to do this. And pretty sure that hook isn't exposed. It does make customising GUI output pretty much impossible.

You'll probably have more luck event scripting, although I couldn't tell you which events to go on. You should expect performance concerns though and you'll still need to come up with a custom GUI. Currently most solutions for that are triggering dialog events from edicts. Hardly the real-time output you want, unfortunately.
 
Thanks for the suggestion AlphaAsh.

It's kinda sad... I was really specting to be an easy way to display the resources since it's relatively easy to add a new fully working acumulative resource. I'm a bit lost on event scripting, but if I come across something that works I will post it here.

Meanwhile I would like to know if there is some plan fom Paradox to add more support to resource modding in a future patch.
 
I thin it's @Naselus who was experimenting with accumulative resources piping out to the SR inventory. If it is him, he's probably got more experience of banging his head on the wall you're currently headbutting.
 
Pretty sure you need a hook from the hard-code to do this. And pretty sure that hook isn't exposed. It does make customising GUI output pretty much impossible.

Pretty much this. The resources DO stockpile, and work properly, but it seems impossible to add something to show the stockpile.

Or rather, it may not be. The 'resource full' tooltip CAN find the correct number and displays it, complete with the correct icon. If we can find out where that tooltip is coded, then we may be able to steal the correct snippet from it.
 
Or rather, it may not be. The 'resource full' tooltip CAN find the correct number and displays it, complete with the correct icon. If we can find out where that tooltip is coded, then we may be able to steal the correct snippet from it.

On "Stellaris/common/alerts.txt" I found:

alert_capped_resources = {
category = MEDIUM
sound = "alert_negative"
}

and on "localisation/l_english.yml"

alert_capped_resources_title:0 "Resource Storage Full"
alert_capped_resources_instant:0 "Some of our resources have exceeded their storage limit. While our storage is full, any further income in these resources will be wasted."
alert_capped_resources_delayed:0 "We have exceeded our storage limit for the following resources:"

But I don see anything related on how the tooltip collects the data on the resource. I'm not a coder myself but it's driving me crazy. Why would Paradox add a way to create custom resources but not a way to display them? o_O

EDIT:

on "l_english.yml":

RESOURCES_STORED:0 "Stored: $VALUE|Y0$"
RESOURCES_STORED_MAX:0 "Stored: $VALUE|Y0$/$MAX|Y0$"

but not a single idea on how they connect the value with the actual resource... surelly all hard-coded
 
Is it possible to add storage capacity for new accumulable resources? I can see the effect to add mineral and energy capacity, but not a generic version...

Also no. To be honest, the things we can do for new resources are painfully limited, because many of the code hooks are non-generic - so we have mineral_mult = x rather than resource_mult = { type = x amount = x}.
 
An antiquated core engine code-base that could do with some updating, basically.

Nah, that's not got much to do with it at all tbh. There's nothing about the way the engine works which meant they had to make multiple separate modifiers rather than a generic one with multiple targets, and the performance impact from doing it the other way would be negligible. Same with the interface. Both of these things existed in Vicky 2, which is now over 6 years old.

Both of these things can, and likely will, be added at some stage. They just aren't here right now, because Paradox didn't anticipate the extent to which we'd be looking to change SRs.
 
I PM Wiz asking about this issue 2 days ago and he answered:

"Yeah unfortunately we never finished full mod support for accumulative resources. May do so in the future."

So let's hope to see this solved in the future. BTW thank you guys to take the time to help me out.