Additional Policy Trees

abandag

Warlord
Joined
Jun 24, 2012
Messages
120
Just thought I'd ask this before I try it later today. Is it possible to add in more policy trees and have them show up on the policy screen with all the other policy trees? I just want to add a couple of new trees for a little bit of variety.
 
Yeah but I think you have to spend a lot of time in SocialPolicyPopup.lua/xml in order to get the new trees to show up. It's a lot of hassle.
 
SocialPolicyPopup.lua/xml is horribly horribly written. Here's an incomplete list:
  • The lua/xml define ten hard-coded branches rather than instances
  • The lua does crazy stuff, like concatenate branch name and iterator (i) to derive branch button names
  • Pipes ...aghhh...

That said, it is possible to modify. I've added and removed policy branches (maintaining the same number 10). You have to do a lot of things that make you (if you program much at all) feel kind of dirty. Like hard coding your branches to particular IDs, or encoding "dummy" branches that don't really exist.

If you want >10, you will have to rewrite both lua and xml files extensively.
 
Ahhh...Guess I won't be doing that since I know nothing about Lua.

Thanks for the replies though.
 
My own mods added an eleventh branch, but yes, it required a LARGE amount of modification to function. It's just not built for that sort of thing; I had to make the window larger, which has a problem since the current window is sized exactly to 1024x768 and any attempt to make it larger will make the window not work for people playing on low resolutions. So I ended up adding a button to open/close my eleventh box.

If you're keeping it at 10, or replacing the existing boxes entirely, then it's not too bad; it's just that if you want to add to the existing branches, without changing the background images each uses, you won't have enough room.
 
The sad thing is that it would be fairly easy to make policy branches fully moddable. It's a simple use of instances and a scroll bar (all covered in whoward69's tutorial on UI).

When I say "fairly easy", I mean maybe 5 hours from an experienced modder. Problem is, I don't think any of us want to spend that time to rewrite bad code into good code (although unfortunately I've spent that amount of time overcoming the existing code's shortcomings).
 
Back
Top Bottom