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

Improve documentation of terrain types #6633

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

Conversation

BlackYps
Copy link
Contributor

@BlackYps BlackYps commented Jan 20, 2025

I had a closer look at the terrain types while I was working with the map editor and noticed that the documentation what they actually do is a bit lacking, so we should fix that.

I tried to understand how types that differ from the default are handled, but I have not fully figured it out. Apparently the game sometimes falls back onto the default terrain type if it can't find certain effects, but it also seems possible to remove default effects. @Hdt80bro you had a closer look at this all a while ago, can you provide some insights?

Somewhat related:
A discussion on discord: https://discord.com/channels/197033481883222026/1044974379232149535/1048015638502846535
A mod by balthazar to edit unit blueprints to use the feature: https://github.com/The-Balthazar/BrewLAN/tree/master/mods/BrewLAN_Plenae/ExpertCamo

@github-actions github-actions bot marked this pull request as draft January 20, 2025 14:51
@BlackYps
Copy link
Contributor Author

And what is going on here?

fa/lua/TerrainTypes.lua

Lines 119 to 127 in fc5368a

---@alias TerrainEffectType
---| LayerTerrainEffectType # block type `Layer`
---| "FXImpact" # block type `ImpactType`
---| "FXMotionChange" # block type `MotionChangeType`
---| "FXLayerChange" # block type `LayerChangeType`
---@alias LayerTerrainEffectType
---| "FXIdle"
---| "FXMovement"
---| "FXOther"

@Hdt80bro
Copy link
Contributor

Which effect table is used is handled here. Those block types are the four ways this function gets called. The FX tables have different key names of the same block type I annotated next to it (So the LayerTerrainEffectType tables all have key names of Layer, the FXImpact table has keys from ImpactType, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants