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

Support Vic3 defines #97

Closed
kaiser-chris opened this issue Nov 20, 2024 · 4 comments
Closed

Support Vic3 defines #97

kaiser-chris opened this issue Nov 20, 2024 · 4 comments
Labels
cwt config related Need modify or extend cwt config enhancement New feature or request

Comments

@kaiser-chris
Copy link

Hi,

I don't know whether other games use them like vic3 but there are defines with a Namespace and a Variable (configured in folder 'defines').
These are then referenced with the define:<Namespace>|<Variable Name>. This is done in a few vanilla locations but one notable location is in pop_types.
Below I have example code that at least allows me to link to a Namespace but I do not know how to configure the part after the pipe ( | ).

This feature seems to be missing from CWT in general.

common/defines/00_graphics.txt (excerpt)

... (more code before)
NRoutes = {
	DIRTROAD_BRIDGES = { "dirtroad_bridge_01" }
	RAILROAD_1_BRIDGES = { "railroad_bridge_01" "railroad_bridge_02" }
	BRIDGE_SIZES = {
		"_small_mesh"
		"_medium_mesh"
		"_large_mesh"
		}
	ROUTE_ENTITIES_CUTOFF = 250				# zoom at which we hide all route entities
}

NPortrait = {
	GRACEFUL_AGING_START = 25	# After this age, added life expectancy will make a character look younger than they are; the effect grows the further past this point one goes
	GRACEFUL_AGING_END = 70		# This is the apparent age at which life expectancy stops slowing down visual aging (each year onwards ages you visually 1 year)
	MAX_AGE = 100.0				# At this age portraits will use the special age gene at full strength
	PORTRAIT_MALE_ADULT_AGE = 18	# The boy -> male portrait change happens at this age
	PORTRAIT_FEMALE_ADULT_AGE = 18	# The girl -> female portrait change happens at this age
}

NProvinceHighlight = {
	TEXTURE_WIDTH = 2048
	TEXTURE_HEIGHT = 1024
	# Province highlights use poisson disc sampling to create a gradient
	# Poisson disc allows for a wider sample are with fewer samples
	KERNEL_SCALE = 8	# Size of the sample area, in world space
	SAMPLE_COUNT = 16	# How many samples to use (max 16)
}
... (more code after)

common/pop_types/capitalists.txt (excerpt)

... (more code before)
	portrait_age = {
		integer_range = {
			min = define:NPortrait|GRACEFUL_AGING_START
			max = define:NPortrait|GRACEFUL_AGING_END
		}
	}
... (more code after)

common/defines.cwt

types = {
    type[define] = {
        path = "game/common/defines"
    }
}

define = {

}

links.cwt (Excerpt)

... (more code before)
	define = {
		desc = " Reference the value of a numeric define: define:Namespace|Name"
		from_data = yes
		data_source = <define>
		prefix = define:
		output_scope = value
		type = value
	}
... (more code after)

IDE Screenshots:
image
image

@DragonKnightOfBreeze DragonKnightOfBreeze added enhancement New feature or request cwt config related Need modify or extend cwt config labels Nov 21, 2024
@DragonKnightOfBreeze
Copy link
Owner

Maybe PLS should provide new index and more language features for define namespaces and define variables.

@DragonKnightOfBreeze
Copy link
Owner

ddc9dac48572dab4577ddfb202ba6634

@DragonKnightOfBreeze
Copy link
Owner

DragonKnightOfBreeze commented Nov 22, 2024

Also available for code completion.

c431788ed00b74d16760ab5a2b124ac5

@DragonKnightOfBreeze
Copy link
Owner

@kaiser-chris remember to create pull request to plugin's vic3 config repo, with necessary $define_reference,thanks :)

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