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 for multiple companion types #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

OndrejMus
Copy link

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.

@OndrejMus
Copy link
Author

Fixed comparison logic by disabling pattern comparison and updated setting definition

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.

1 participant