I understand that you can create .svg icons using the inkscape program. However, the icons I put in the mod folder don’t seem to get loaded. My icons are simple text like “HCS” for Housing Construction Subsidy. I believe I have formatted the name of the .svg file the same way as for everything else. The policy itself gets loaded with my mod but the area where the icon should be is blank. Does the icon need to be a particular color or a particular size? And is there a place where I need to specify which icon gets loaded for which policy? I haven’t found any place to specify that.
I guess there are other ways to do this, but here’s my way:
Copy a file of a policy that is already in-game, open with inkscape, remove the image and then create Your own.
It has to be white - To see it better, you can choose a chess a-like background.
File > Properties
Thank you! I was able to get it to work now.
I’m having another issue with modding if anyone can help me. Whenever I start up a new game with my mod I get this error: “Invalid neural function::D:\programming\Democracy4\src_all_operating_systems\sim\SIM_EquationProcessor.cpp 279”
This error message shows up every single turn and is pretty annoying. As far as I can tell all of the policies and overrides I’ve modded in are working without issues now so I’m not sure what’s not working and why I still keep getting these error messages.
One or more of your policy/override equations may be off. I’d go back and check to see if they’re all typed properly and don’t have any unnecessary characters and seeing if they are written properly. Example on how it should be typed: 0.6-(0.6*x). Basically always using a constant +/- a coefficient multiplied by x. This is how the game wants the equations to be typed unless you’re using exponents.
If you’re getting that error message then one of the objects you made has bad syntax in the equation part of it’s definition.
^ this part is wrong in your mod
If it’s happening every turn then it’s either in a simulation object or a policy that is initially on the field at the start.
Unfortunately it isn’t easy to find such errors as the error message doesn’t list the specific equation that is wrong. I would recommend removing all of your policies and then adding them back one at a time until it crashes again. The last one is the one causing the problem.
The error is probably caused by spaces in between your operators (ex. 0.5 + x should be: 0.5+x) or by doing complicated stuff with your exponents that isn’t supported by the game yet (see [Bug 1.126] - Parsing of Exponents doesn't respect parentheses)
Thanks! I’ve been looking through the code many times trying to find a typo but was beginning to think something else was wrong. I’ll have to go over it again I suppose.
Okay, I’ve tried just about everything. Triple checked every line but I still don’t see any typos or extra spaces. Tried ctrl-F to find extra spaces and the like but nothing. The policies look good, the overrides look good. I’m not using any exponents. I’ve tried knocking out policies one by one to see which ones are affecting the game, but removing some of them causes the game to just crash when I try to start a new game for some reason. If it helps at all, I see the error message twice each turn when I’m playing as the country I modded in, but I see it once each turn when playing as any of the original countries. Which makes me think it’s a problem with the overrides maybe but removing all of them doesn’t fix it. I don’t have any simulations modded in, just a handful of policies.
Every part of the mod is working as intended. The only problem is these error messages that keep popping up, but all the policies I put in are working just fine. So is the new country I modded in. I don’t get it.
Sorry I should have mentioned that you will also need to remove the corresponding line in your language files for each policy you try removing. The game will crash if you give it a language line for a policy that doesn’t exist.
I’m assuming that the error message popping up twice per turn for your custom nation indicates that you have two different policies that cause an error and they are both included by default in that nation.
I have had issues with missing commas between arguments causing error messages as well but I think that’s actually a different error message. You could try looking for those as well? Although I don’t think that is your issue. Other then that I’m not sure how else I can help you. Debugging these kind of errors is really annoying as it’s hard to tell where the error is coming from.
Thanks, I will give that a try. Yeah, unfortunately this seems to be a tough nut to crack. It’s like when you’re reading over a story you wrote and your eyes just keep glancing over the comma you forgot to put in because your brain expects it to be there so you see it even though it’s not actually there.
Edit: So yeah, still no luck. It’s especially hard to figure it out because whatever the problem is, it doesn’t actually impede the function of the mod in any way. It just causes error messages to pop up which you have to then click ‘x’ on. It’s still perfectly playable if you ignore the error messages but that’s obviously inconvenient.
Finally figured it out! The problem was that Windows’ folder organization system has hidden desktop.ini files in it. The game tries to read those .ini files if they’re in an override folder and gives error messages. Which is why the error messages showed up but didn’t affect anything, the actual policies and such were completely fine but those pointless .ini files couldn’t be loaded.
I’m facing exact the same error as you… Can you tell me how to fix the “Windows’ folder organization system has hidden desktop.ini files in it” issue?
I forget exactly how I did it but I think I changed my computer’s Windows settings to show hidden files. Then I just deleted the .ini files
@cliffski your game has very severe coding bug, if it reacts to presence of random ini files…
Middleware being meddle-ware?