Help with custom species?

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderators: Oberlus, Committer

Post Reply
Message
Author
SikeSky
Space Krill
Posts: 3
Joined: Thu Apr 28, 2016 12:07 am

Help with custom species?

#1 Post by SikeSky »

I remember almost a year ago I tried to add a custom species to the game, but it would never show up in the game. I ended up just modifying the Human entry to make what I wanted. It's a bit OP, but here it is:

Code: Select all

Species
    name = "SP_CUSTOM"
    description = "SP_CUSTOM_DESC"
    gameplay_description = "SP_CUSTOM_GAMEPLAY_DESC"
    Playable
    CanProduceShips
    CanColonize
    
    tags = [ "LITHIC" "STYLISH" "AI_TAG_BAD_SUPPLY" ]
    
    foci = [
        [[HAS_INDUSTRY_FOCUS]]
        [[HAS_RESEARCH_FOCUS]]
        [[HAS_MINING_FOCUS]]
        [[HAS_ADVANCED_FOCI]]
    ]
    
    preferredfocus = "FOCUS_INDUSTRY"
    
    effectsgroups = [
        [[GREAT_INDUSTRY]]
        [[GOOD_RESEARCH]]

        [[AVERAGE_POPULATION]]
        [[AVERAGE_HAPPINESS]]
        [[BAD_SUPPLY]]
        [[GREAT_GROUND_TROOPS]]
        [[DESCRIPTION_EFFECTSGROUP_MACRO(GREAT_INDUSTRY)]]
        [[DESCRIPTION_EFFECTSGROUP_MACRO(GOOD_RESEARCH)]]
        [[DESCRIPTION_EFFECTSGROUP_MACRO(AVERAGE_POPULATION)]]
        [[DESCRIPTION_EFFECTSGROUP_MACRO(BAD_SUPPLY)]]
        [[DESCRIPTION_EFFECTSGROUP_MACRO(GREAT_GROUND_TROOPS)]]
        
        // not for description
        [[AVERAGE_PLANETARY_SHIELDS]]
        [[BAD_PLANETARY_DEFENSE]]
        [[LARGE_PLANET]]
    ]
    
    [[TOLERANT_EP]]
    
    graphic = "icons/species/human.png"
I have the appropriate description entries in the en.txt file in stringtables.

Nevertheless, when I go to start a game, only the basic starter races are available to start as.
Help would be appreciated!
Last edited by SikeSky on Mon Jan 01, 2024 9:52 pm, edited 1 time in total.

User avatar
Cpeosphoros
Space Kraken
Posts: 124
Joined: Sat Jan 30, 2016 11:29 am

Re: Help with custom species?

#2 Post by Cpeosphoros »

You have also to provide the appropriate colony building at /freeorion/default/scripting/buildings/colonies - either by creating one or by editing col_bld_gen.py and running it.
All contributions are released under GPL or LGPL v2 or later, or under appropriate Creative Commons licence, consistent with project guidelines.

User avatar
matt474
Space Krill
Posts: 2
Joined: Thu Apr 28, 2016 11:22 am

Re: Help with custom species?

#3 Post by matt474 »

One problem I see is that [[BAD_PLANETARY_DEFENSE]] does not appear to exist. The only two options are [[AVERAGE_PLANETARY_DEFENSE]] and [[NATIVE_PLANETARY_DEFENSE]].
The code provided is also missing #include statements at the end.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Help with custom species?

#4 Post by Geoff the Medio »

matt474 wrote:One problem I see is that [[BAD_PLANETARY_DEFENSE]] does not appear to exist.
If nonexistent macro substitutions are attempted, I would expect some error messages in the client or server log noting the parser failure. Have a look for those.

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Help with custom species?

#5 Post by MatGB »

Ruling out the obvious: did you quit out of the game and reload it after all processes had finished?

Because I've forgotten to do that more than once. :oops:
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

SikeSky
Space Krill
Posts: 3
Joined: Thu Apr 28, 2016 12:07 am

Re: Help with custom species?

#6 Post by SikeSky »

Cpeosphoros wrote:You have also to provide the appropriate colony building at /freeorion/default/scripting/buildings/colonies - either by creating one or by editing col_bld_gen.py and running it.

Okay, I've run that python file and now have this:

Code: Select all

BuildingType
    name = "BLD_COL_INGA"
    description = "BLD_COL_INGA_DESC"
    buildcost = 50 * [[COLONY_UPKEEP_MULTIPLICATOR]]
    buildtime = 1.0 * max(5.0, 1.0 +
        (min value = ShortestPath object = Target.SystemID object = LocalCandidate.SystemID
            condition = And [
                Planet
                OwnedBy empire = Source.Owner
                Species name = "SP_INGA"
                Population low = [[MIN_RECOLONIZING_SIZE]]
                Happiness low = 5
                ResourceSupplyConnected empire = Source.Owner condition = Target
            ]
        ) / (60
             + 20 * (If condition = Or [
                 OwnerHasTech name = "SHP_MIL_ROBO_CONT"
                 OwnerHasTech name = "SHP_ORG_HULL"
                 OwnerHasTech name = "SHP_QUANT_ENRG_MAG"
             ])
             + 20 * (If condition = Or [
                 OwnerHasTech name = "SHP_ORG_HULL"
                 OwnerHasTech name = "SHP_QUANT_ENRG_MAG"
             ])
             + 20 * (If condition = OwnerHasTech name = "SHP_QUANT_ENRG_MAG")
             + 10 * (If condition = OwnerHasTech name = "SHP_IMPROVED_ENGINE_COUPLINGS")
             + 10 * (If condition = OwnerHasTech name = "SHP_N_DIMENSIONAL_ENGINE_MATRIX")
             + 10 * (If condition = OwnerHasTech name = "SHP_SINGULARITY_ENGINE_CORE")
             + 10 * (If condition = OwnerHasTech name = "SHP_TRANSSPACE_DRIVE")
             + 10 * (If condition = OwnerHasTech name = "SHP_INTSTEL_LOG")
        )
    )
    location = And [
        Planet
        OwnedBy empire = Source.Owner
        Population high = 0
        Not Planet environment = Uninhabitable species = "SP_INGA"
        Not Contains Building name = "BLD_COL_INGA"
        ResourceSupplyConnected empire = Source.Owner condition = And [
            Planet
            OwnedBy empire = Source.Owner
            Species name = "SP_INGA"
            Population low = [[MIN_RECOLONIZING_SIZE]]
            Happiness low = 5
        ]
    ]
    EnqueueLocation = And [
        Planet
        OwnedBy empire = Source.Owner
        Population high = 0
        Not Planet environment = Uninhabitable species = "SP_INGA"
        Not Contains Building name = "BLD_COL_INGA"
        Not Enqueued type = Building name = "BLD_COL_INGA"
        ResourceSupplyConnected empire = Source.Owner condition = And [
            Planet
            OwnedBy empire = Source.Owner
            Species name = "SP_INGA"
            Population low = [[MIN_RECOLONIZING_SIZE]]
            Happiness low = 5
        ]
    ]
    effectsgroups = [
        EffectsGroup
            scope = And [
                Object id = Source.PlanetID
                Planet
            ]
            activation = And [
                Not OwnerHasTech name = "GRO_LIFECYCLE_MAN"
                Turn low = Source.CreationTurn + 1 high = Source.CreationTurn + 1
            ]
            effects = [
                SetSpecies name = "SP_INGA"
                SetPopulation value = 1
            ]
        EffectsGroup
            scope = And [
                Object id = Source.PlanetID
                Planet
            ]
            activation = And [
                OwnerHasTech name = "GRO_LIFECYCLE_MAN"
                Turn low = Source.CreationTurn + 1 high = Source.CreationTurn + 1
            ]
            effects = [
                SetSpecies name = "SP_INGA"
                SetPopulation value = [[MIN_RECOLONIZING_SIZE]]
            ]
        EffectsGroup
            scope = And [
                Object id = Source.PlanetID
                Planet
            ]
            activation = Turn low = Source.CreationTurn + 1 high = Source.CreationTurn + 1
            effects = [
                GenerateSitRepMessage
                    message = "SITREP_NEW_COLONY_ESTABLISHED"
                    icon = "icons/species/chato-matou-gormoshk.png"
                    parameters = [
                        tag = "species" data = "SP_INGA"
                        tag = "planet" data = Target.ID
                    ]
                    empire = Source.Owner
            ]
        EffectsGroup
            scope = Source
            activation = Turn low = Source.CreationTurn + 2
            effects = Destroy
    ]
    icon = "icons/species/chato-matou-gormoshk.png"
in the col_buildings file in the main "default" folder. I can't find any scripting path within the games installation folder. It still isn't working however. When I try to start a new game, only the normal races are there. Is it possible that BLD_COLONY_INGA_DESC doesn't exist in the stringtable or something?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Help with custom species?

#7 Post by Geoff the Medio »

Again, instead of guessing, have a look at the sever and client logs after starting up a game. They probably have error messages about parser failures for the new species script.

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Help with custom species?

#8 Post by MatGB »

Also, is your game definitely pointing to and getting info from the default folder you're working in? It's possible to change it and sometimes people forget to point things in the right direction.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

SikeSky
Space Krill
Posts: 3
Joined: Thu Apr 28, 2016 12:07 am

Re: Help with custom species?

#9 Post by SikeSky »

Geoff the Medio wrote:Again, instead of guessing, have a look at the sever and client logs after starting up a game. They probably have error messages about parser failures for the new species script.

Code: Select all

2016-04-30 14:13:11.593617 [debug] Client : Logger initialized
2016-04-30 14:13:11.597619 [debug] Client : v0.4.5 [build 2015-09-01.f203162] MSVC 2013
2016-04-30 14:13:12.094949 [debug] Client : OpenAL initialized. Version 1.1 ALSOFT 1.15.1Renderer OpenAL SoftVendor OpenAL Community
Extensions: AL_EXT_ALAW AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_LOKI_quadriphonic AL_SOFT_buffer_samples AL_SOFT_buffer_sub_data AL_SOFTX_deferred_updates AL_SOFT_direct_channels AL_SOFT_loop_points AL_SOFT_source_latency

2016-04-30 14:13:12.978442 [debug] Client : ProductionWindow:  app-width: 1024 ; windowed width: 1362
2016-04-30 14:13:13.815969 [debug] Client : BasesListBox::Populate
2016-04-30 14:13:13.815969 [debug] Client : BasesListBox::PopulateWithSavedDesigns
2016-04-30 14:13:13.816970 [debug] Client : DesignWnd::MainPanel::ReregisterDesigns
2016-04-30 14:13:14.484212 [debug] Client : Limited FPS to 60
2016-04-30 14:13:14.485213 [debug] Client : OpenGL Version Number: 4.0
2016-04-30 14:13:14.486212 [debug] Client : (HumanClientFSM) IntroMenu
2016-04-30 14:13:14.487213 [debug] Client : HumanClientApp::KillServer()
2016-04-30 14:13:14.487213 [debug] Client : Process::Kill
2016-04-30 14:13:14.487213 [debug] Client : Process::Kill found no m_impl
2016-04-30 14:13:14.487213 [debug] Client : Process::Kill calling RequestTermination()
2016-04-30 14:13:14.487213 [debug] Client : ClientNetworking::SetPlayerID: player id set to: -1
2016-04-30 14:13:14.488215 [debug] Client : HumanClientApp::HandleFocusChange()
2016-04-30 14:13:14.637314 [debug] Client : HumanClientApp::HandleFocusChange()
Nothing there jumps out at me.

This is in freeorion.log in the appdata/roaming/FreeOrion folder

dbenage-cx
Programmer
Posts: 389
Joined: Sun Feb 14, 2016 12:08 am

Re: Help with custom species?

#10 Post by dbenage-cx »

You might also check the freeoriond.log file (the server log file).
v0.4.5 [build 2015-09-01.f203162] MSVC 2013
Wont see a scripting directory as it still uses the single species.txt file, you might try a more recent build if you are running into issues.
Any content posted should be considered licensed GNU GPL 2.0 and/or CC-BY-SA 3.0 as appropriate.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Help with custom species?

#11 Post by Geoff the Medio »

dbenage-cx wrote:You might also check the freeoriond.log file (the server log file).
Also, click "single player" to get into the galaxy setup screen before quitting, or it may not attempt to load and parse the scripts and thus wouldn't have anything in the logs (plural) about failing to do so.

Post Reply