Open kaiser-chris opened 1 week ago
Not quite understand how to impelement, may be manually checked and debugged later...
output_scope
and input_compare_scopes
not always the same?input_compare_scopes
be multiple?x
in relations(x)
a scope field expression (just like common root.owner.event_target:xxx
), nested in the whole expression relations(x)
?There must be more uncleared questions...
If you look at this pull request it shows a few examples I defined for test purposes. Maybe that can help with understanding: https://github.com/kaiser-chris/cwtools-vic3-config/commit/afcf0f95b4dc336d823bb19a259ab3c5f180d99f
To your questions:
output_scope
and input_compare_scopes
should generally be different. If you look at the example I provided with relations, the output_scope
is value since a number is returned after the comparision.input_scopes
already.relations(x)
is not a scope expression but a value expression because what it does is take the country that is in scope (this) and gets its relations with another country x. You get the value of something.Just maybe to clarify and provide a further example. Let us look at scripted_bar_progress
.
What does it do:
Here is an example how it is used in a base game file trigger:
... more code before
fail = {
custom_tooltip = {
text = communism_progress_bar_at_full_tt
scope:journal_entry = {
"scripted_bar_progress(communism_1_progress_bar)" >= 100
}
}
}
... more code after
An example how I would configure it in CWT (This is just an idea and example):
scripted_bar_progress = {
compare_from_data = yes # Not in current CWT standard
compare_data_source = <scripted_progress_bar> # Not in current CWT standard
input_scopes = journal_entry
output_scope = value
type = value
}
This is different from relations because it does not expect a scope as input but a type.
Oh I see. it's another specific scope field expression (like script value expression value:xxx|X|X|
)
There are various (and more) 'complex' expressions in paradox script&loc files, and so do plugin's codes. I once thought the implementation for complex expressions is not so good, but currently, luckly, it's still not very hard to implement those language features.
Just one more example I found:
Seems like scope chaining can also happen in there.
Is this correct and necessary? I have no idea to differ and match these two configs exactly yet.
Hmm I think only the arithmetic one is needed.
But I am not 100% sure. I am currently not at home to search the base game files for it.
relations:xxx
This is missing in cwt configs, may be defined first, and implemented by plugin second (througth final cwt configs may be changed)
Hi I think a CWT extension is needed here:
In Victoria 3 scripts you can use a link to get value comparision with another scope.
This gets the number of trade route levels with another country:
num_mutual_trade_route_levels_with_country(root)
This gets the relations number between the in scope country and actor:
relations(scope:actor)
This format is also used in Victoria 3 scripts, which seems to be the same as above:
relations:root
to define something like this in links would need something like:
relations = { input_compare_scopes = country input_scopes = country output_scope = value type = value }
The idea is when input_compare_scopes is set the following things would then be valid:
relations:root
relations:prev
relations(c:PRU)
scope of prussiarelations(scope:actor)
some scope that is defined for the context
For this, relations:root
and relations(root)
shall be all valid and same,
and input_scopes
and input compare_scopes
should be same,
for you cannot use :
to separate prefix relations
and dynamic scope link c:PRU
.
so, it may be just a alias format if datasource = scope_field
or datasource = scope[country]
, etc.
And, it should be only valid and avaiable for value_field (ParadoxValueFieldExpression
, in plugin code)
fyi nearly implemented
There still are some bugs and unimplemented features, like the validation for data source type scope[country]
@kaiser-chris Since now you can create the PR for from_argument
link configs :)
@kaiser-chris Since now you can create the PR for
from_argument
link configs :)
Would love to but I will be unable to until late next week since I am currently traveling.
But thank you already this looks good but does it also support things like the scripted_bar_progress I have written about above or is that part still missing?
If you look at this pull request it shows a few examples I defined for test purposes. Maybe that can help with understanding: kaiser-chris/cwtools-vic3-config@afcf0f9
If you want a few more test cases you can find almost all compare uses in the Commit I linked. I needed to remove them because they broke the original CWT tools but it still provides a comprehensive list of them.
Otherwise I will configure them myself in CWT late next week.
I will seen them next week
Hi I think a CWT extension is needed here:
In Victoria 3 scripts you can use a link to get value comparision with another scope.
This gets the number of trade route levels with another country:
num_mutual_trade_route_levels_with_country(root)
This gets the relations number between the in scope country and actor:
relations(scope:actor)
This format is also used in Victoria 3 scripts, which seems to be the same as above:
relations:root
to define something like this in links would need something like:
The idea is when input_compare_scopes is set the following things would then be valid:
relations:root
relations:prev
relations(c:PRU)
scope of prussiarelations(scope:actor)
some scope that is defined for the context