Theoretical question: "Homeless" minor race?

A place for discussion of making game modifications.
akkamaddi
Posts: 79
Joined: Tue Sep 26, 2017 5:11 am

Theoretical question: "Homeless" minor race?

Postby akkamaddi » Thu Oct 05, 2017 12:30 am

So, a random train of thought (hint if you haven't figured it out: breaks don't work) lead to an interesting idea, if possible.

In short: You can find human refugees, and splinter colonies of your own race. I always thought it would be interesting to find other races that might join you, but would join their main race if encountered.

I then thought that an interesting planetary special would be to find "failed" colony ships or stranded hibernation transports of other races, which you could then send to a colony and absorb some of that race. (Human refugees would fit very well here.)

That lead to the idea of a "hibernation ark". That lead to "what if it's NOT a known race?".

And so, again the short version (I had a much longer story idea), a pre Great War refugee race who emerged only to find a galaxy at war, and then immediately had to flee to the unknown, and things did not go well. Instead of finding a minor race living on a planet, you find a system with a colony ship and two or three cargo ships storing population units of a "lost race" that are "in hibernation". You take control of the ships, and then absorb them by either disembarking them into an existing colony, or colonizing a planet with the colony ship and disembarking the transports there. It would be a scenario similar to the Humans, but which went even more poorly.

So.

Would it be possible to have a system in the epic_systems file that is populated with occupied colony & cargo ships? If so, would it be a trouble to explain how?

Have I mentioned lately that the devs are really awesome people? </shameless_flattery>

User avatar
Arioch
Posts: 936
Joined: Sun Feb 01, 2015 12:56 am
Location: San Jose, California
Contact:

Re: Theoretical question: "Homeless" minor race?

Postby Arioch » Thu Oct 05, 2017 7:09 am

I think it's a cool idea. However, you'll have to get Sven's attention if you want tips on how to code it. Since we're both slammed trying to get Legacies stuff done, I'll caution you not to expect a modding tutorial at the present time.

akkamaddi
Posts: 79
Joined: Tue Sep 26, 2017 5:11 am

Re: Theoretical question: "Homeless" minor race?

Postby akkamaddi » Thu Oct 05, 2017 12:30 pm

I completely understand. :)

User avatar
sven
Site Admin
Posts: 1223
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Theoretical question: "Homeless" minor race?

Postby sven » Sun Oct 15, 2017 5:10 am

akkamaddi wrote:Would it be possible to have a system in the epic_systems file that is populated with occupied colony & cargo ships? If so, would it be a trouble to explain how?


At a high level, the main complication here is that at the point when the callbacks in epic_systems.lua are being processed, the stars and planets referenced aren't yet 'real', they're simply tables that describe the stars and planets that will eventually be created at the end of init_all_stars.lua. And because the stars don't yet exist, we can't place ships around them. So, if you want to spawn ships in an epic system, you need to a 2 part strategy; first create some special variable in the table data that's generated in epic_systems.lua file; then check for that variable after init_all_stars.lua has had a chance to create the star system, and trigger a ship spawn there if you find it.

The easiest way to do this is probably to use the existing 'specials' table, which is already being passed from from table template generated in epic_systems.lua to to the true star data (see init_all_stars.lua: 413).

Note that something very much like what you're trying to do here is already being done in the game, anytime we spawn 'monsters', i.e., space pirates or harpies. And, in fact, you could piggyback on that system to trigger your own custom ship spawning rules; take a look at setup_star_specials.lua, and in particular, how the complete_special_setup() works.

So basically, if you create a new special type in epic_systems.lua, you should then be able to hack a new spawning rule into setup_star_specials.lua.

That gets you colony ships filled with a strange alien race. The next step is to make those ships join (or not), whomever finds them. There's already handlers for this sort of behavior as well, that, again, could be piggybacked on. See, for example, harpy_guards.lua, or splinter_colony.lua. (Which are both hooks onto system-specials that could, in theory, be used as templates for building the sort of encounter you're proposing.)

Programmer's note: harpy_guards.lua and splinter_colony.lua are both built on the encounter_env.lua 'base class'. Of all the various core components in the game, this is one of the pieces I'm least happy with. The whole system seems like it could really use a good re-factoring pass. The dialog tree specification system, and dialog semantic markup rules, are not nearly as nice as those used in other parts of the game. We want to add a bunch more encounters to the game (both pre, and post DLC) so I may rewrite this base class sooner or later. But if/when I do; I almost certainly won't destroy the old system, too much depends on it. What you'll probably see instead is a new file with a name like 'better_encounter_env' that fills the same role, but provides better helper functions for specifying dialog / dialog trees.

akkamaddi
Posts: 79
Joined: Tue Sep 26, 2017 5:11 am

Re: Theoretical question: "Homeless" minor race?

Postby akkamaddi » Sun Oct 15, 2017 5:44 am

Thank you very much for the information.

I was actually planning on using the super dreadnought placed at Ephelos as a base, so it sounds like my idea was on the right track. You have given me other places to look to splice together something that works.

I was rather fond of this idea, as it gives the sense of an ancient past rather than the universe being a tabula rasa. Thanks again.

akkamaddi
Posts: 79
Joined: Tue Sep 26, 2017 5:11 am

Re: Theoretical question: "Homeless" minor race?

Postby akkamaddi » Fri Nov 03, 2017 2:50 am

OK, I'm going to have to beg and grovel a bit. Unfortunately I've had two weekends with little personal time, so I'm coming back to this after a forced break. I have a working event with some filler text, but I'm having trouble with the ship spawning.

I went through the event for the damaged guardian, but that looks like much more than I want. The idea here is the Tacheed Tacheed are on damaged ships, and it's a finders-keepers situation. I don't want to create a monster AI and force a battle. (I would if there was a way to make them surrender, but there is no surrender mechanic in the game yet.)

I'm not quite following the spawning mechanic for pirate bases, even though I went there because they get colony ships. I've also tried to use the function for when the galaxy is created, to spawn a new player colony ship, to no avail.

Is there an easy way to trigger spawning a ship into the discovering empire's local fleet? I'm basically trying to insert this into the event:

function new_colony_ship(empire,species)

Code: Select all

  local design_key = find_design_type(empire,'Colony')

  if design_key
    local rval= spawn_ship( empire,design_key)
    rval.carrying_pop= { [species] = tacheed_tacheed }
    rval.colony=true
    rval.pop_space=1
    return rval
  end

end


(And I've tried leaving species = 1 to see if I could get a vanilla colony ship.)

Thank you for your time.


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest

cron