Habitat Outpost to create planets?

A place for discussion of making game modifications.
Jem
Posts: 31
Joined: Tue Aug 15, 2017 9:21 am

Habitat Outpost to create planets?

Postby Jem » Thu Nov 28, 2019 5:28 am

This is not a must or priority but I just somehow feel it is 'logical' enough to have a Habitat Outpost be able to [create planets] seeing even Small planets housing 1Mil pop can do it too, which gives the same condition as a Habitat Outpost, except for not living on a planet...

The below code is as far as I can go with the above objective but it isn't working fully, as the [create planet] production process won't complete.
I'd be most thankful if anyone can help.

The ideal result would be just allow Habitat Outposts to ONLY create planets and leave colonizing them to Colony ships. Cheers!

\Lua state\GUI\~GalaxyMap\@ChooseProduction.lua

Code: Select all

  local refit_candidates = refit_option(push)
--habitat allow create planets
  if (limit~='ships')  and no_colony or sum(planet.pop?)==0
    colony_bases(push)
  end
--habitat.end
  if (limit~='ships')  and not no_colony
Last edited by Jem on Sat Jul 25, 2020 9:35 am, edited 2 times in total.

gaerzi
Posts: 210
Joined: Wed Jul 10, 2019 1:30 pm

Re: Habitat Outpost to create planets?

Postby gaerzi » Thu Nov 28, 2019 2:24 pm

I've actually done that.

One thing to watch out for is that if you put a outpost around a tiny planet, and then unlock projects for outposts, the game can crash as it tries to look into terraforming options for your tiny planet. So I had to insert this in Orders/terraforming.lua:

Code: Select all

function make_terraforming_hover_text(planet,target_type)

   -- prevent crash on orbital colonies
   if (planet.size == 'Tiny')
      return
   end
   -- prevent crash on orbital colonies




For your issue with completing the actual production of the planet, what you need to change is in Orders/economy.lua. Specifically, in economy_update = flame_fun('economy_update',|)function(). There are two lines in there that had to be changed.

Code: Select all

    -- the order in which planet's production is updated can
    -- matter, as planet's later in the queue are more likely to be
    -- stalled due to lack of metal.
      for planet in rpairs(empire.planets,|)
      function(p1,p2)
        return lexical_compare(p2.raw_hammer_production,p1.raw_hammer_production, recorded_name(p1), recorded_name(p2) )
      end

      if planet.inhabited or planet.productive -- allow orbital colonies to build stuff

         if(planet.skip_production)
            planet.skip_production=nil
         else -- if not planet.no_colony # commented out to allow orbital colonies to build stuff
            production_update(planet)
            change_production_if_needed(planet)   
        planet:create_overflow_project()
         end
      end end


It's been a while but I think that's all that's needed.

Jem
Posts: 31
Joined: Tue Aug 15, 2017 9:21 am

Re: Habitat Outpost to create planets?

Postby Jem » Sat Nov 30, 2019 12:00 pm

Hello gaerzi, thanks for your input. I haven't tested it yet but I really appreciate the fact someone(you) actually has done this already. Haha

Out of topic, do you happen to know anything about abandoning planets? I recall my 1st time at SiS and being unable to abandon planets really put us or maybe the AI too(?) at a disadvantage as the enemies can create a 'beachhead' at just outside our doors. I'd rather abandon planet(no pop/buildings) and create a 'firebreak' between me and enemy, and especially a really powerful one.

Thanks again! Cheers! :)

gaerzi
Posts: 210
Joined: Wed Jul 10, 2019 1:30 pm

Re: Habitat Outpost to create planets?

Postby gaerzi » Sat Nov 30, 2019 3:32 pm

I haven't looked into it, but you can manually scrap buildings and move out most of the population. Some population types (Viscid, Gaiad, and other sessile species, as well as anyone who's currently rioting) cannot be moved. If you leave a planet with only rioters on it, it should leave your empire by the next turn, and then you can bomb them out of existence.

When a colony has just one population remaining, you can't move it out, the game prevents you from abandoning it. I figure finding this lock and removing it would allow to abandon colonies, but it's possible it creates problems, as in the planet is still considered part of your empire despite having no population or something.

Jem
Posts: 31
Joined: Tue Aug 15, 2017 9:21 am

Re: Habitat Outpost to create planets?

Postby Jem » Sat Nov 30, 2019 5:08 pm

You are right, mustn't leave anything for the enemy. haha. but many a times i forgot to destroy stuff/move pple at my border planets while panicking.

I tried your mod/script and it worked nicely, I didn't put the check for tiny planets as it seems to create a new planet 'infront' of it. and i can still access it(tiny) via the build notice button from galaxy map, but making colonies from the orbital do create problem so I will consciously avoid doing that.

As for abandoning planets, i was thinking to find a way to get script that with a click of 'abandon planet' button to load up all pop into transports & destroy/scrap all buildings/orbitals. I did try what you said abt leaving rioting/slaves in to cause them go revolt then bomb them out of existance but quite a few times when the other races are closeby OR have long reach (Ansible?) they can convert those planets to come under their rule, worst if they're currently friendly with us, so destroying them is a no-no... so the best way is to allow us to initiate abandon planet and no one can own it unless they come all the way here. haha


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 18 guests

cron