Useful Viscids, a simple player hack

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

Useful Viscids, a simple player hack

Postby akkamaddi » Mon Oct 09, 2017 12:34 am

This was my first attempt to hack Stars in Shadows, and I’m sharing it for anyone else who would like to follow suit. The simple purpose of this is to make the Viscids a more useful race. The first section of this will be some comments and warnings, the second the actual how-to, and the third my commentary.

There are a lot of things that must be said up front. To start with, if things suddenly get weird or become broken in your game, try moving the content of the Mods folder out of the Stars in Shadow folder and restart the game. The developers cannot be responsible for player made changes, so your support could become limited. The changes here are very minor, and I have not experienced any issues with them.

What I did experience was a game crash because I forgot a comma. Work slowly and carefully, and work on the copies in “Mods”, not the live lua files. Remember to check for closing bounds, { and ( REQUIRE ) and }, and most lines end with a comma, .

I will also be referring to using your computer’s file manager to make directories and copy files, and edit text files. To be blunt, it is not the scope of this to teach you how to use your computer and edit files. It is in your own best interest to know the basics of your computer operating system before you launch yourself into hacking a game.

On text editors, for Windows, Notepad works fine, but there are some free programmer text editors that do really useful things, like line numbering. Also, if you use Notepad, this is VERY IMPORTANT: if you save the file as a new file, change the file type from “text” to “all”, or Notepad will append a “.txt” extension to the file, and Windows defaults to hiding common file types. This means the file name will change but you can’t see the change. Programmer text editors are designed not to do this.

While I will make it clear I am not endorsing any third party programs, I did the code changes for this and the Abbizi race using only Notepad++.

Work slow, be careful, take responsibility, and don’t do anything you don’t know how to do.

Copy files, don’t move them, and don’t alter the original files.

Another important point on modding is that the official recommendation is to disable auto-updating. That may be currently undesirable, with Legacies imminent. Given that this modification is small, it may be preferable to allow updates. When the game menu shows a new version, archive the modded files, copy the new files from the Lua state folder, and re-add the alterations. If that is not personally acceptable, disable updates and do this only when an official update is desired. You may want to avoid this if you are using the rapidly updating development builds.

And remember much of this is case sensitive.


WHAT TO DO

Close SiS, and get your text editor ready. I find this easier with two file manager windows open. Take a deep breath and remind yourself to be careful. File and folder names will be bold, and should be copied exactly. I usually do this with copy-and-paste between file manager windows. Note that changes to Startup\forced_planets_fun.lua are optional, as this modifies the Viscid home world.

We will mark all changes with
-- #MODIFIED
To make changes easier to find. The double-dash is a comment character.

Open both file manager windows to the SiS folder. In one go to the folder called Mods. In Mods, make a folder called Lua state .

In both file manager windows, enter the respective (main and Mods) Lua state folder. In the Mods\Lua state window, make folders @Technology , Galaxy , and (optional) Setup . You will see these same folders in the main Lua state folder, and we are replicating them under Mods.

Go to the @Technology folder in both windows. Copy the file RACES.lua from the main folder to the folder under Mods.

Go up one folder, and then go to the folder Galaxy in both windows. Copy the file planet_types.lua from the main folder to the folder under Mods.

Go up one folder. If you are altering the Viscid home world, go to the folder Setup in both windows. Copy the file forced_planets_fun.lua from the main folder to the foler under Mods. (If you are leaving the home world random, you do not need to make the Setup folder or copy this file, but we will assume from this point you will.)

Close the file manager window for the main Lua state, you are done with it. You should be using the window for Mods\Lua state\ from now on, which should contain three folders and files:
@Technology\RACES.lua
Galaxy\planet_types.lua
Setup\forced_planets_fun.lua


First open the RACES.lua file for editing. This will be the largest change, as it is the flavor text. Use your editor’s search feature to search for: --!! viscid

When you find the text below, replace:

Code: Select all

--!! viscid
  {
    name = "Viscid",

    sessile=true,
    primitive=true,

    beaker_production = 0,
    hammer_production = 0,
    food_production = 0,
    coin_production = 0,

    native_desc = new_desc_object [=[

      Planetary scans show signs of life on <PLANET_NAME>.  They are a curious
      gelatinous organism living in the ooze of the swampy regions, which our
      scouts have taken to calling the Viscid. It is not clear whether they are
      truly intelligent, and we have been unable to communicate with them,
      but they are certainly aware of our presence. If we were to colonize this
      world, it’s not clear whether these creatures would be able to provide
      anything to us except a nuisance.

    ]=],

    habitat_desc = new_desc_object [=[

      These globs of protoplasm seem remarkably intelligent for their
      primitive physiology, in that they seem to be very inventive in finding
      ways of getting into our food supply, and have been resistant thus far to
      our attempts to exterminate them.
   
    ]=],


with

Code: Select all

  -- #MODIFIED
  --!! viscid
  {
    name = "Viscid",

    ambivalent=true,
    primitive=true,

    beaker_production = 0,
    hammer_production = 0.25,
    food_production = 1,
    coin_production = 0,
    combat_strength = 1.0,

    native_desc = new_desc_object [=[

      Planetary scans show signs of life on <PLANET_NAME>.  They are a curious
      gelatinous organism living in the wetland regions, which our scouts have
     taken to calling the Viscid. It seems they have learned enough to tend to
     wild fruit producing vegetation, and even tend food colonies in tidal
     pools. Their tool use seems almost non-existent, and they appear to have
     only a vague idea of personal property. They might be trainable as farm labor.
     <br><br>
     It is clear this world was terraformed. Scout scientists have found traces of
     mutagens that were once used in advanced terraforming. Some of these mutagens
     have actually become metabolites in the Viscids. There were ways to remove these
     compounds after terraforming. We do not know if this world is uninhabited because
     the terraforming was stopped or interrupted.
     <br><br>
     A more disturbing possibility is the Viscids are descendants of an ill fated technical crew.

    ]=],

    habitat_desc = new_desc_object [=[

      These globs of protoplasm seem remarkably intelligent for their
      primitive physiology. Their tool use is highly limited, with no
     fine object manipulation. Their native culture has developed to
     limited agrarian skills and some rather creative aquaculture,
     and so they have acclimated well to more modern farming techniques.
     Their view of technology and personal property is simplistic,
     so they express little interest in science or commerce. They also
     have few emotional reactions to events, and generally stay focused
     on the present.
   
    ]=],

  },


Be sure to have the closing }, bounds. Save and close the file, and be sure to not change the file type to .txt. If you are using Notepad, change the “Save as type:” from “Text Document” to “All files”.

Next, open the file planet_types.lua for editing. There are two points to change, but the changes are small. First, do a text search for: viscid =

There should be two hits. First, replace

Code: Select all

viscid = {forest = 4.0, arid = 1.5, },


with

Code: Select all

-- #MODIFIED
viscid = {forest = 4.0, swamp=4, reef = 2.5, ocean = 1.5, },


On the second hit, replace

Code: Select all

growth_rate.viscid = growth_rate.human


with

Code: Select all

-- #MODIFIED
growth 'viscid' {
  High = { 'Swamp', 'Island', 'Coral', },   
  Low = {'Arid', 'Glacier', 'Hive', },
}


Note that the growth statement does not end with a comma. Save and close the file, and be sure to not change the file type to .txt.

Lastly, open forced_planets_fun.lua for editing. Search for: viscid=

Replace

Code: Select all

    {
      type = random_draw { Garden=1, Arid=1, Glacier=1, },
      arable=true,
      special = { 'natives', pop = {viscid=3, }, },   
    },


With

Code: Select all

-- #MODIFIED
    {
      type = 'Paradise',
      name = 'Blrp Blrp Glrp',
      size='Small',
      special = { 'natives', pop = {viscid=3, }, farms=1, }, 
    },


Be sure to have the closing }, bounds. Save and close the file, and be sure to not change the file type to .txt.

At this point, you should be able to close the file manager windows, the text editors can be closed, and you can re-start the game.

If you get an error, check your work to ensure you included any final comas, as that is the most likely error. If nothing has changed, make sure the files were not saved as .lua.txt files.


COMMENTARY

Why?

Ajadar. :-)

I understand the point of the four immovable races. Each is a specific challenge. However, I don’t particularly like the idea of a useless moocher / eater race. I grew up with science fiction teeming with aliens and diversity, where everyone had a place to uplift society. So, the idea of a race being a food sync which you have to out-populate did not sit well with me.

And I wanted to see how the code works, because the point of a hackable game is that the developers know you may want things a little different, so they let you make things a little different.

So, this re-working is loosely inspired by the magnate race from MoO3, the Ajadar, which were a low gravity aquatic “protoplasmic” race.

The changes in RACES.lua reflect this. These Viscids seem to be an unintended result from an ancient, almost-complete terraforming effort. They have learned to tend wild-growing plants, and cultivate tidal pools of small, edible animals. While their industrial value is limited, they are capable farmers. They also have the Ambivalent feature re-added, which was apparently lost in an update. (There is a post elsewhere.) They just schlorp about their lives and tend to their work.

In planet_types.lua, their nature is changed from the normal human default to a more semi-amphibious life. They have become a little closer to the Gremak. They thrive in forests and swamps. (I am hoping we get more swamp biomes in the future.) They also do well in reef environments, and a little better than average in floating ocean colonies. Being fluid, their tolerance for Ice or Arid environments is below average.

In the same file on growth rates, Garden and Paradise worlds default to high growth speed for all races. The viscids also grow quickly on Coral and Island worlds. They grow more slowly on Arid, Glacier, and Hive worlds. (For Hive worlds, they still have high population density, but a slow growth rate in the artificial environment.)

Lastly, their world is a small (low gravity) terraformed world. While I cannot make it work right now, in the future I would like their home world to also have the Super Grain special. That would reinforce the story that an ancient race put a lot of effort into terraforming this world, and then….



Can this be done with the other races?

Easily. It would be different from the devs’ vision, and I see reasons to be careful with this. The Pell I am very tempted to change. That could be a second homage to MoO3 (Audrieh). The drawback of the Pell is that, as friendly pacifists, they offer no resistance to invading armies. The Gaiad and Scavengers would be an interesting change. Scavengers are hard workers. Gaiad are good farmers and decent scientists. However, when things get tough, the Gaiad’s response is to burn down the cities, and the Scavenger’s response is violent riots and looting.

A major design point here is AI handling. The AI does not seem to “manage” alien races. They colonize planets and make colony ships, and there is only basic AI determining what races go where. If an AI empire expands with Pell on many planets, their empire would become an easy target for land invasion. If they spread Gaiad or Scavengers and a war begins to go bad, the empire could have a violent uprising gutting some of their colonies.

While a player may enjoy managing potentially volatile populations, it could make AI empires randomly implode. (Let’s be honest, that might be fun.)

Return to “Modding”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron