Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow somehow through cwt configs to generate pseudo definitions for scripted effect, game concepts etc. #77

Open
adriangaro opened this issue Apr 27, 2024 · 3 comments
Labels
cwt config related Need modify or extend cwt config enhancement New feature or request

Comments

@adriangaro
Copy link

adriangaro commented Apr 27, 2024

It is often the case to avoid boilerplate code i have to call to using inline_scripts to avoid repetitive definitions, especially for stuff life game_concepts, economic categories and so on.

For example i have the below inline

# concepts/tec_district_concept

concept_tec_$district$$suffix$ = {
	alias = { 
		concept_tec_$district$$suffix$_plural 
		concept_tec_$district$$suffix$_icon 
		concept_tec_$district$$suffix$_plural_icon 
	}
	icon = "gfx/interface/icons/districts/$icon$.dds"
}

and it is invoked as

inline_script = {
    script = concepts/tec_district_concept
    district = district_tec_eco_farming
    suffix = "_machine"
    icon = district_tec_eco_farming 
}

But due to its nature of using interpolation and inlines, the concepts will no be available for autocomplete in localisation, and will show errors.

Would be nice to somehow be able to say that if this inline is called, expect this definitions to exist, maybe by providing a string template for the name, although probably hard. Alternatively maybe just infer new definitions from inlines.... but that might need them to actually be evaluated more thoroughly which seems more complicated (should be doable since technically the parameters are static)

@DragonKnightOfBreeze DragonKnightOfBreeze added the enhancement New feature or request label Apr 27, 2024
@DragonKnightOfBreeze
Copy link
Owner

Definitions in inline script files are not yet to be indexed

@DragonKnightOfBreeze
Copy link
Owner

So what you want is (are) ?

  1. Indexing definitions in inline script files.
  2. Indexing definitions (and other things) in inline script files after parameters inlined (if possible)
  3. Provide a way to specify definitions that will be declared in inline scripts / parameters by extended configs (and definition names can be matched by wildcards)
  4. Provide a way to ignore 'unresolved xxx' if related extended config exists (code completion should be already available)

@adriangaro
Copy link
Author

1 and 2 would be the most ideal, making 3 not needed at all. 4 on its own could be useful for compatibility, to not have to make dummy declarations.

@DragonKnightOfBreeze DragonKnightOfBreeze added the cwt config related Need modify or extend cwt config label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwt config related Need modify or extend cwt config enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants