Adding Opil

A place for discussion of making game modifications.
Post Reply
RanDumGai
Posts: 6
Joined: Fri Jul 09, 2021 4:41 am
Location: TX, USA

Adding Opil

Post 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.
RanDumGai
Posts: 6
Joined: Fri Jul 09, 2021 4:41 am
Location: TX, USA

Re: Adding Opil

Post by RanDumGai »

It should be noted that I am not a programmer, and I'm also not a very good modder xP
User avatar
sven
Site Admin
Posts: 1621
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Adding Opil

Post 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).
RanDumGai
Posts: 6
Joined: Fri Jul 09, 2021 4:41 am
Location: TX, USA

Re: Adding Opil

Post by RanDumGai »

Thanks!
Post Reply