Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I'm working on mod that rebalances companions and I have found out that whole companion logic in control.lua is hardcoded to entity "companion" (mainly adding entity to custom table of companions) so I have tried to update logic to be more flexible.
I have added startup settings companion-entity-names that by default contains "companion" but can be updated by other mods.
My intention is to update value in settings-updates.lua (setting is already created) in my or any other mod.
New setting is used in control.lua where original logic is replaced with simple check using string.find on new setting.
I have added check that "companion" is always there so even if some mode remove it intentionaly or by mistake so it will not disable default companions.
Updated version seems to work, companions are created in new map, can attack, build, deconstruct, be mided or killed, they follow player, react to equipment changes and to attack/construct toggles and all of it also works on additional entities added to companion-entity-names setting like "companion-mk2" from mod I'm working on.
Would you be so kind and check if this approach suitable? This is my first attempt in moding so there might be something obviously wrong I'm missing.
Thank you in advance.