GithubHelp home page GithubHelp logo

amtep / ck3-tiger Goto Github PK

View Code? Open in Web Editor NEW
29.0 7.0 8.0 8.45 MB

Checks Crusader Kings 3 user mod files for common mistakes and warns about them.

License: GNU General Public License v3.0

Rust 99.94% Python 0.04% Makefile 0.01% Shell 0.01%
ck3 crusader-kings-3 mod modding modding-tools linter rust imperator-rome victoria-3 vic3

ck3-tiger's People

Contributors

amtep avatar dementive avatar dragon-archer avatar jazarro avatar mrtats avatar my4ng 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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ck3-tiger's Issues

[Improvement] Some missing field/structure of vic3-tiger

  • Special event targets like num_enemy_units can be used like 'value triggers', while requiring input data scope inside parens
  • name property allows block to implement dynamic naming (just like those in desc)
  • Seems like limited_to_frontier_colonization in law is still not recognized by tiger
  • trigger_event can also trigger on_actions, like trigger_event = { on_action = XXX days = 1 }
  • Several properties in subject_types: can_be_used_in_sway_offers (boolean), lower_autonomy_subject_type_alternatives (array), same_autonomy_subject_type_alternatives (array), higher_autonomy_subject_type_alternatives (array), ai_value (value block), can_target_with_transfer_wargoal (boolean)
  • on_researched in technology

false positive for operator >=

Scripted trigger courtier_guest_management_1001_exceptional_marriage_candidate_trigger in courtier_guest_management_events.txt throwing this error

[MOD] file events/courtier_guest_management_events/courtier_guest_management_events.txt
line 393 TIER >= scope:host.highest_held_title_tier
line 393 ^
ERROR (validation): expected TIER = or ?=, found >=

			marriage_between_characters_unlocks_alliance_of_min_tier_trigger = {
				MY_CHARACTER = scope:host
				THEIR_CHARACTER = scope:marriage_candidate
				TIER >= scope:host.highest_held_title_tier
			}

Several false-positives for Vic3 1.7.*

  • The localization key of a modifier type is simply the type itself, with no modifier_ prefix any more
  • scope:law in can_impose scope under law definitions produces law_type instead of law (However, scope:law in ai_enact_weight_modifier indeed produces law, that is strange, but I've confirmed it under Debug Mode)
    • Reproduce steps: Start as Great Britain in Debug Mode, add Colonization technology for Kaurna, try to impose Colonial Exploitation for it and you can see the correct tooltip, then change scope:law to scope:law.type in the law definition & restart (or hot reload), you'll get thousands of error log complaining about wrong scope type

false positive for landed title from barony?

Scripted trigger pilgrimage_0500_valid_holy_site_trigger in pilgrimage_events.txt throwing this error

[MOD] file events/activities/pilgrimage_activity/pilgrimage_events.txt
line 285 this = capital_province.barony
line 285 ^
WARNING (scopes): barony produces landed title but expected character

The line numbers may be slightly off as it is a edited event but the trigger is untouched vanilla

scripted_trigger pilgrimage_0500_valid_holy_site_trigger = {
	#... we really shouldn't talk about the holy site we might be _in_ right now / invalid capital_province holy site
	NOR = { 
		this = root.location.barony
		AND = {
			exists = capital_province
			this = capital_province.barony
		}
	}
}

[Vic3] scripted_button must have `name` and `desc` field

Currently tiger will accept scripted_button with no name and desc field. Such scripted_button will not trigger error logs, but will cause the game to crash after opening the journal entry containing it. So perhaps tiger should warn for this.

thread '<unnamed>' panicked at 'index out of bounds: the len is 13 but the index is 211', src\ck3\data\interaction_cats.rs:71:42

Hello!

So I decided to try to become a modder for ck3 and for the milestone in it I set the updating an old mod. However, I failed at setupping ck3-tiger correctly for days now 😔. I come to concussion that there may be a bug within tiger code because it would be very embarrassing if that was iust my fault and I'm apologizing already to for it🙏. So this is how i tried to launch it(I tried many ways, this error appears the most).

PS E:\Narzedzia do modow\ck3\tiger> .\ck3-tiger.exe --ck3 "c:/Games/Steam/steamapps/common/Crusader Kings III" "c:/Games/Steam/steamapps/workshop/content/1158310/2218620123/descriptor.mod"
This validator was made for Crusader Kings version 1.12.3 (Scythe).
If you are using a newer version of Crusader Kings, it may be inaccurate.
!! Currently it's inaccurate anyway because it's in beta state.
Using CK3 directory: c:/Games/Steam/steamapps/common/Crusader Kings III
Using mod directory: c:/Games/Steam/steamapps/workshop/content/1158310/2218620123

thread '<unnamed>' panicked at 'index out of bounds: the len is 13 but the index is 211', src\ck3\data\interaction_cats.rs:71:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
PS E:\Narzedzia do modow\ck3\tiger>

As I couldn't find the mentioned file src\ck3\data\interaction_cats.rs in my ck3 directory so I tried by verifying integrity of files, no success. I don't know what to do I really want to make mods for this game and this tool seems essential to me. I would be very grateful for help.
Thanks for the reading and have a nice day!

Possible false positives for missing field

I get these errors but this is vanilla syntax and it's used quite a lot throughout vanilla, with no error log complaints, so not sure if this is legal syntax or not.

line 19847 		any_relation = { this = root }
line 19847 		               ^
ERROR (field-missing): required field `type` missing

[Vic3] Some missing fields

  • country_can_have_mass_migration_to = [country scope]: Not used in vanilla but has its localization in vanilla, and the engine still recognize it
  • can_be_used_in_sway_offers = [bool] and sway_maneuvers_cost = [int]: In common/diplomatic_actions
  • pop_consumption_can_add_infrastructure = [bool]: In common/goods

Suggested feature #include

I have a personal mod that is split over a couple of mods, also a few personal compatches.

I'm finding that running ck3-tiger over some of my mods, especially the compatches are throwing errors because ck3-tiger does not know about triggers, effects, modifiers, etc that are defined in other mods.

I personally think it would make the tool more useful if mods could be specified in an include = { } section in the conf file, so ck3-tiger could load them to resolve a lot of the associated errors.

ofc I would not want to see ck3-tiger actually process the include mods for errors/warning, just to use them as a source for resolution.

False positive about warning(logic)

Currently tiger will emit "warning(logic): setting value here will overwrite the previous calculations" if you use value = xxx in a script value's body (not the first line). This works for most situations, but it will cause false positive with save_temporary_value_as
Example:

da_value_max_3 = {
	if = {
		limit = { scope:_1 > scope:_2 }
		if = {
			limit = { scope:_1 > scope:_3 }
			value = scope:_1
		}
		else = {
			value = scope:_3
		}
	}
	else_if = {
		limit = { scope:_2 > scope:_3 }
		value = scope:_2
	}
	else = { value = scope:_3 }
}
da_test_value = {
	value = 100
	save_temporary_value_as = _1
	value = 200
	save_temporary_value_as = _2
	value = -100
	save_temporary_value_as = _3
	value = da_value_max_3
}

In this example, the paired value = xxx and save_temporary_value_as = yyy actually acts like passing parameters and then call a function, so perhaps we can suppress the warning if it follows a save_temporary_value_as ? Or simply treat save_temporary_value_as as the start of a new script value?

Update the main message for error(filename)

The current main message for error(filename) is a constant 'file in unexpected directory', which has no effective information
Perhaps we could add the quoted filename and/or directory to the main message so that it can be filtered using text
For example, when I update my mod for a new version, I usually move some of my files/folders into a special .obsolete folder, and I'd like tiger to only ignore files in this folder, however, due to the insufficient main message of error(filename), I can only ignore the whole filename key

[Feature] Some new (or missing) modifiers in Vic 1.5.13

  • limited_to_frontier_colonization in common/laws/00_colonial_affairs.txt, with a boolean argument (not documented but used in original game file)
  • show_as_unavailable in all event options, it's actually a trigger block (not documented but can work)
  • min_hiring_rate, max_hiring_rate, and ignores_productivity_when_hiring in building_groups (documented in info and used in original game file)
  • city_lights_color_index in production_methods of urban center (not documented but used in origianl game file at least since 1.4.0)
  • group in jounal entries (documented and used)

[False positive] vic3-tiger misunderstand `modifier` and `modifer_type`

In Victoria 3, the folder common/modifier contains detailed modifiers which can be added directly to an entity (country, character, etc.)
While the folder common/modifier_type contains modifier types that may be used in modifiers or something else, it can also be accessed via modifier:xxx.

Currently, vic3-tiger outputs error(missing-item): modifier XXX not defined in common/modifiers/ when the mod accesses user-defined modifier types, however, actually it should read from common/modifier_types to find user-defined modifier types

Random crash error

image

As shown in the image, it seems that vic3-tiger crashes randomly, because I didn't change anything between the two runs.
The same crash error has occured twice, though I should say it's still relatively rare.

rightclicksound GUI field is unknown

GUI field rightclicksound creates a false positive of being unknown.

While this field is not used in anywhere in vanilla CK3 GUI files, it is a valid parameter. As can be seen on Advanced Cheat Menu mod. (Shameless plug.)

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.