Page 1 of 1

Adding Opil

Posted: Sat Jul 31, 2021 11:48 pm
by RanDumGai
How would I go about adding Opil crystals to all island worlds?

I'd like to do this because I feel like the Phidi shouldn't be the only species to benefit from the increased influence from Opil crystals, not to mention the financial boon.

Re: Adding Opil

Posted: Sat Jul 31, 2021 11:59 pm
by RanDumGai
It should be noted that I am not a programmer, and I'm also not a very good modder xP

Re: Adding Opil

Posted: Sun Aug 01, 2021 12:11 am
by sven
RanDumGai wrote:How would I go about adding Opil crystals to all island worlds?
I don't have the code in front of me right now, but, off the top of my head...

The easiest option is probably to just write a for loop over the all_planets list that adds the opil special to any planet with the 'Island' type. There are lot of places where you could put a for loop like that and have it work -- anytime in new_galaxy() after init_all_stars() has been called should work.

But, for testing purposes, you could actually write that loop outside any function (say at the bottom new_galaxy.lua), and it would be called implicitly while you where playing. That would make it easier to debug the logic (because then you won't have to re-run galaxy generation anytime you want to test your code snippit).

Re: Adding Opil

Posted: Sun Aug 01, 2021 1:33 am
by RanDumGai
Thanks!