Adding Opil

A place for discussion of making game modifications.
RanDumGai
Posts: 5
Joined: Fri Jul 09, 2021 4:41 am

Adding Opil

Postby RanDumGai » Sat Jul 31, 2021 11:48 pm

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: 5
Joined: Fri Jul 09, 2021 4:41 am

Re: Adding Opil

Postby RanDumGai » Sat Jul 31, 2021 11:59 pm

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: 1620
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Adding Opil

Postby sven » Sun Aug 01, 2021 12:11 am

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: 5
Joined: Fri Jul 09, 2021 4:41 am

Re: Adding Opil

Postby RanDumGai » Sun Aug 01, 2021 1:33 am

Thanks!


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 3 guests

cron