Giter Club home page Giter Club logo

cwtools-stellaris-config's Introduction

cwtools nuget

A library for parsing, editing, and validating Paradox Interactive script files.
Supports all modern Paradox Interactive games, and targets .net standard 2.0.

Considering contributing? Start here!

Projects that use CW Tools

An interactive tech tree visualiser that uses CW Tools to parse the vanilla tech files, and extract localisation.

A mod manager that uses CW Tools for parsing and manipulating mod files.

Example usage (C#)

This is a simple example of loading an event file, modifying it, and printing the updated events.

            //Support UTF-8
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

            //Parse event file
            var parsed = CWTools.Parser.CKParser.parseEventFile("./testevent.txt");
            var eventFile = parsed.GetResult();

            //"Process" result into nicer format
            var processed = CK2Process.processEventFile(eventFile);

            //Find interesting event
            var myEvent = processed.Events.FirstOrDefault(x => x.ID == "test.1");
            
            //Add is_triggered_only = true
            var leaf = new Leaf("is_triggered_only", Value.NewBool(true));
            myEvent.AllChildren.Add(Child.NewLeafC(leaf));
            // or
            myEvent.AllChildren.Add(Leaf.Create("is_triggered_only", Value.NewBool(true)));

            //Output
            var output = processed.ToRaw;
            Console.WriteLine(CKPrinter.printKeyValueList(output, 0));

Which will take a file like

namespace = test

#One event
country_event = {
        id = test.1
    desc = "test description"
}
#Another event
country_event = {
    id = test.2
desc = "test 2 description"
}

and output a file like

namespace = test
#One event
country_event = {
        is_triggered_only = yes
        id = test.1
        desc = "test description"
         }
#Another event
country_event = {
        id = test.2
        desc = "test 2 description"
         }

cwtools-stellaris-config's People

Contributors

17blue17 avatar arkhorse avatar caligulacaesar avatar calniotrey avatar corsairmarks avatar cubuzz avatar ebrenes avatar f1r3pr1nc3 avatar goldziher avatar hadaev8 avatar iyur avatar juliemars avatar mcawesome123 avatar nikitalita avatar oldent avatar pastthefuture avatar persepheus avatar ramit110 avatar tboby avatar the24thds avatar tokillthelight avatar tuttu avatar victoriousraptor avatar violentbeetle avatar xvcv19 avatar yard1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cwtools-stellaris-config's Issues

update scope switch for create fleet

please see the cw243 error in distant_stars_events.txt line 18360- the error there appears because the parser does not recognize the scope context switch of the effect, i believe.

Add fleet actions

Fleet actions and queue_actions should be added. Had said he might do it, and so did Iyur.

fix parsing of filepath using //

a lot of vanilla errors are due to filepath being defined using //, example:

gfx//interface/icons/icon_name.dds

The parser should consider // and / identical. If there might be a problem with linux this should be added as a blue warning - to promote a different coding standard.

List of missing elements and bugs

  1. add the following scopes/targets: system_star, observation_outpost_owner, closest_system

  2. add firing scopeless events using country_event, planet_event etc. - this currently gives a false bug report.

  3. owner_main_species not recognized as target

  4. add ambient object as possible target for location and set_location. Also - see the vanilla event diplomatic.19, which sets location to "music_listening_planet"

  5. if an event is set to hidden = yes and it has picture =, desc =, title =, location = etc... this currently gives an unexpected node message. This should be changed into a yellow notification along the lines of "event set to hidden, desc, title and picture are not displayed." same of course for options and the like. These do not give an error message and are not strictly speaking bugs, they can be redundant code or event that are either temporarily or permanently changed from one type to another but keep functioning (sub optimal of course, but still).

  6. if an event is not defined as diplomatic but it has custom_gui defined for it, a yellow notification should be given rather than an error message.

  7. CW999 should be removed. This notification was set for version 2.0.2, and this is no longer relevant. If it is it should be a blue notification.

  8. numerous errors in vanilla indicate the country is not defined as a viable target for effects that check species in cwtools, but it is a viable target and has a species. So this should be updated. This also applies to ship - but the check there should be whether the ship is shipclass_colonizer or not (otherwise it doesn't have species = xyz }

  9. capital_scope can be used in solar_system scope. This should be added.

  10. when a new species archetype is defined the game auto-generates modifiers for this archetype. These require localisation. Currently cwtools doesn't recognize or expect these modifiers, leading to errors messages. Example modifeirs from STNH:

    BIOLOGICAL_species_trait_points_add #this is the only vanilla one here!
    HUMANOID_species_trait_points_add
    CHANGELING_species_trait_points_add
    CRYSTALINE_species_trait_points_add
    SILICOID_species_trait_points_add
    FLUIDIC_species_trait_points_add
    INSECTOID_species_trait_points_add
    AQUATIC_species_trait_points_add
    CYBORG_species_trait_points_add

  11. It appears that some solar system initializers do not have galactic_object as root but rather country. The primary.example are the vanilla fallen empire solar system initializers. This needs to be worked out.

  12. When new ethics are added, the game auto-generates modifiers for these in the form of pop__attraction_mult. Example: pop_ethic_egalitarian_attraction_mult. CWtools currently doesnt expect this.

Ignore false localisation warnings in vanilla

  1. The localisation errors in GUI files appear to be false. As Iyur asserted, these seem to refer to hardcoded localisation keys.

  2. CWTools currently doesn't parse non-English localisations refered to in scripted localisations. As a result there is a false error with all the French scripted locs, with keys beginning in FRLOC_... these should be either parsed or ignored (some mods like Caligula also use a similar structure, so parsing is better.)

List of elements to be added

The following things are currently missing from cwtools validation and should be added:

game/map - this is important, I suggest speaking with Annatar, who is the only expert on this I know.
game/common/colors - might be redundant.
game/common/precursor_civilizations - should be updated, file added.

spawn_planet works with size random

but cwtools expects only float

spawn_planet = {
class = "rl_habitable_normal" #"pc_ringworld_habitable"
location = fromfrom.planet
orbit_location = yes
orbit_angle_offset = 45
orbit_distance_offset = 12
size = random
has_ring = no

		init_effect = {

Add loc ignore list cwt

The idea is to add a configurable file that allows us to define hardcoded locs, as used in GUI types. This way number of vanilla errors will be drastically reduced.

Add the missing localisation [functions]

Data from the file provided by blackninja:

Army:
GetName
GetRulerName

Building:
GetName

Country
GetName
GetAdj, GetAdjective
GetSpeciesName
GetSpeciesAdj
GetSpeciesNamePlural
GetSpeciesClass
GetSpeciesClassPlural
GetAllianceName
GetRulerName
GetRulerTitle
GetHeirName
GetHeirTitle
GetPersonalityName
GetSpeciesNameInsult
GetSpeciesNamePluralInsult
GetSpeciesNameCompliment
GetSpeciesNamePluralCompliment
GetSpeciesSpawnName
GetSpeciesSpawnNamePlural
GetSpeciesOrganName
GetSpeciesMouthName
GetSpeciesHandName
GetRandomSpeciesSound
GetHomeWorldName

Event Special:
GetMidGameDate
GetLateGameDate
GetDate

Fleet:
GetName, GetFleetName
GetLeaderName
GetStarName
GetRulerName
GetAdj

Leader:
GetName
GetRegnalName
GetPopFactionName
GetSubjectPronoun, GetSheHe, GetHeShe
GetSubjectPronounCap, GetSheHeCap, GetHeSheCap
GetObjectPronoun, GetHerHim, GetHimHer
GetPossPronoun, GetHerHis, GetHisHer
GetPossPronounCap, GetHerHisCap, GetHisHerCap
GetReflexivePronoun, GetHerselfHimself, GetHimselfHerself
GetRulerTitle
GetTitle

Planet:
GetName
GetAdj
GetStarName
GetPlanetMoon
GetPlanetMoonCap
GetNebula
GetLeaderName
GetOwnerName
GetControllerName
GetClassName

Pop Faction:
GetName

Species:
GetName
GetSpeciesName
GetSpeciesNamePlural
GetSpeciesNameAdj

Ship:
GetName
GetNebula
GetFleetName
GetLeaderName
GetStarName

Species:
GetName
GetAdj
GetNamePlural
GetClass
GetClassPlural
GetNameInsult
GetNamePluralInsult
GetNameCompliment
GetNamePluralCompliment
GetSpawnName
GetSpawnNamePlural
GetOrganName
GetMouthName
GetHandName
GetRandomSpeciesSound

fix the issue with room asset selectors

I have no idea why this is occuring, but im getting a lot of false errors with room asset selectors - both in vanilla and in my own mods. Please fix this asap, since its incredibly annoying for me.

Add check for planet sound effect

Vanilla planets have sound effects defined for them. This is done in the sound asset files and not planet classes. But if a planet class is not added to the sound assets (check and see where all the pc_ are defined there) it will not ger sound effects. I therefore recommend adding a blue or yellow alert if a planet is not added to the sounds assets.

Check whether flags used in `has_x_flag` have been set somewhere

Please add validation check for whether a flag that is being checked using has_country/pop/planet_flag = xyz, whether flag xyz is set anywhere in the script on the respective scope being checked? This would be tremendously helpful to modders. Although some things are necessary for inter-mod compatibility (global flags usually), this is a minor detail

Add check for icons tied to key

The following stellaris elements require an icon with a name identical to the key:

buildings (gfx/interface/icons/buildings) - icon should have a name identical to the building_key.dds unless its overridden by an icon = <building_key> entry in the building define. the icon = <building_key> connects to the icon of a different building, and of course that icon should be looked for in that case.

technologies (gfx/interface/icons/technology) - icon should have an identical name to the tech_key.dds unless its overridden by icon = <sprite_type> (see tech_basic_industry) or icon = filepath (not sure about this one, but i believe its possible!)

civics (gfx/interface/icons/governments/civics) - icon should have an identical name to the civic_key.dds unless its overwridden by icon = filepath

authorities (gfx/interface/icons/governments/authorities) - icon should have an identical name to the authority.dds unless its overwridden by icon = filepath

governmenets (gfx/interface/icons/governments) - icon should have an identical name to the governmenet.dds unless its overwridden by icon = filepath

ethics (gfx/interface/icons/ethics) - icon should have an identical name to ethic_key.dds

ascension_perks (gfx/interface/icons/ascension_perks) - icon should have an identical name to ascension_perk_key.dds

tile_blockers (gfx/interface/icons/tile_blockers) - icon should have an identical name to tile_blocker_key_int.dds; what does it mean? you can in fact have multiple icons for the same tile_blocker key (as many as you want), and these are numbered. The first (and perhaps only) icon should always be named tile_blocker_key_01.dds, and any extra icons should have sequential numbers. Example: tb_active_volcano is automatically linked to tb_active_volcano_01.dds and a modder could easly add tb_active_volcano_02.dds, tb_active_volcano_03.dds and so forth with the game automatically using this.

tile_background (gfx/interface/icons/tile_backgrounds) - a tile background is automatically expected for any planet class (see common/planet_classes) that is defined as colonizable = yes. The principle is quite similar to that of tile blockers, and you have to always have at least 1 tile background defined for a planet. The format though is different: planet_class_int.dds without a 0. So for example, pc_continental has pc_continental_1.dds, pc_continental_2.dds, pc_continental_3.dds, pc_continental_4.dds and the game alternates these when generating tiles for continental planets. You can have as many icons as you want there and the game will alternate them with a minimum of 1 icon defined for a planet!

enviornment (gfx/portraits/enviornments) - enviornment portraits are automatically expected for all planets defined under planet_classes (common/planet_classes). This also includes stars and asteroids with no exception. Saying that there are two different kinds of files stored under gfx/portraits/enviornments: files that have a _sky suffix and those that have an _I0int suffix. Each planet class automatically requires an enviornment portrait named planet_class_key_sky.dds. There are then alternative files that can be added for each planet class and the game alternates them, but these are optional. Thus for example pc_continental has the required pc_continental_sky.dds, and then it has pc_continental_I01.dds, pc_continental_I02.dds, pc_continental_I03.dds, pc_continental_I04.dds

Fix unassign_leader scopes

It supports dual usage, in the scope of a leader, and in the scope of a led entity. What should target be for the latter?

Invalid characters in localisation files

This is a common newbie modder error (or simply careless copying between Word and localisation files). The following characters are confirmed to be invalid characters:

„“ ‚‘ – ” ’ … —

They show as "?" ingame, which it is obviously best to avoid!

Fix hidden event errors

Currently vanilla is full of errors caused by events defined as hidden, which nonetheless have stuff like location, options, desc, title etc. defined for them. These should be warnings, and I'd recommend grouping them together into a single generic warning, to reduce error/warning spam.

Extend support for custom modifiers and add icon and localisation validation for them

A. The game auto-generates modifiers for the following elements:

  1. species_archetypes
    example: "BIOLOGICAL_species_trait_points_add" (country modifier).
  2. ethics
    example: "pop_ethic_fanatic_xenophile_attraction_mult" (country scope - note, even ethics that do not have ethic attraction like gestalt_consciousness get modifiers generated).
  3. tech_categories
    example: "category_materials_research_speed_mult" (country scope).
  4. ship_sizes - these have multiple different modifiers generated for each shipsize.
    example: "shipsize_corvette_build_speed_mult", "shipsize_corvette_build_cost_mult"
    "shipsize_corvette_upkeep_mult", "shipsize_corvette_hull_mult", "shipsize_corvette_hull_add"
    (country scope)
  5. ship_classes - these have multiple modifiers generated for any shipsize that has a class defined (only buildable ships have classes!)
    example: "shipclass_colonizer_build_cost_mult", "shipclass_colonizer_build_speed_mult", "shipclass_colonizer_hull_mult", "shipclass_colonizer_damage_mult", "shipclass_colonizer_evasion_add"
    "shipclass_colonizer_disengage_mult" (country scope)
  6. building_tags - these have two modifiers generated, please add a note to cwtools that the build_speed_mult type modifier doesn't have any effect in game except being displayed (obviously not fully implemented.)
    example: "hydroponics_farm_construction_speed_mult", "hydroponics_farm_build_cost_mult" (planet/country/sector scopes/leader - i believe)
  7. component_tags - each component tag auto generates three modifiers. Of course only those that are defined for weapon type actually have an effect, but the game auto generates modifeirs for all component tags.
    example: "point_defence_weapon_damage_mult", "point_defence_weapon_fire_rate_mult" "point_defence_speed_mult" (modifier/ship modifier on ship sizes and ship modifier applied through events).
  8. special_projects (country/leader scope).
    example: "yuht_1_cat_research_speed_mult", "yuht_2_cat_research_speed_mult", "yuht_3_cat_research_speed_mult" etc.
  9. planet_classes habitability (pop/trait/planet scopes) - do not require GFX.
    example: "pc_tropical_habitability"
  10. resources - these get multiple potential modifiers, applying both to resources defined as is_rare = yes and is_rare = no.
    example:
    static_resource_energy_add
    static_planet_resource_energy_add
    tile_resource_energy_mult
    country_resource_energy_mult
    tile_building_resource_energy_add
    tile_resource_energy_add
    planet_resource_energy_add
    country_resource_energy_add
    max_energy --> only for resources defined as accumulative!
    country_federation_member_resource_energy_mult
    country_federation_member_resource_energy_max_mult
    country_subjects_resource_energy_mult
    country_subjects_resource_energy_max_mult
    country_strategic_resources_resource_energy_mult
    country_strategic_resources_resource_energy_max_mult
    country_planet_classes_resource_energy_mult
    country_planet_classes_resource_energy_max_mult

You can see these in the modifier dump of the setup.log file.

B. Each new modifier requires localisation and most also require an icon (stored in gfx/interface/icons/modifiers) with an identical key. But not all modifiers require an icon - and those that do require an icon require it only if they are used in code somewhere that applies them as a planet or country modifier (example: on buildings, a planet_class, an ethic etc.).

Name list enum/type

E. G. Rename species refers to type name list which doesn't actually collect the name lists

fix multiple trait fields in create species

create species allows one to use multiple traits = fields. Example:

traits = target
traits = {
trait = xyz
}

the reason for this is that this allows you to add new traits to a species without creating a mod species (using the modify_species effect), or to combine different species into one. This needs to be fixed since the tool currently throws an error there.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.