-
Notifications
You must be signed in to change notification settings - Fork 178
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
[scripts][safe-room]Add support for custom healing plants #6945
Conversation
Is the intention here to make adding more nouns/plant types easier for users? |
Yes. |
How about we make this a list, instead of a pseudo-regex stored in yaml? It'll make the code a bit easier to read, and users can just add a line. no pipes, nor guesswork, etc... We can build the regex from the list inside the script. Instead of using the string-sorta-regex thing. |
That sounds even better, though perhaps beyond my ability to code. Are you thinking of something that would look like:
Or would it be better to keep it as a horizontal entry, just without the quotation marks and pipes, like: |
Have a play with this. If you get stuck, let me know. base.yaml would look something like this healing_plant_adjectives:
- vela'tohr
- swaying
healing_plant_nouns:
- briar
- bush
- plant
- shrub
- thicket
- thornbush Please make sure to add two empty entries in base_empty.yaml as well, namely: healing_plant_adjectives: []
healing_plant_nouns: [] in safe-room you'd then have @plant_adjectives = settings.healing_plant_adjectives
@plant_nouns = settings.healing_plant_nouns Then we combine each array into a regex of its own. @adjectives_regex = Regexp.union(settings.healing_plant_adjectives)
@noun_regex = Regexp.union(settings.healing_plant_nouns)
@plant_regex = Regexp.new("#{@adjectives_regex} #{@noun_regex}") |
Made some updates, and this version seems to be working well, and uses settings in the format you mentioned. I'll keep testing to confirm it works with a variety of plant types. |
Co-authored-by: Mahtra <[email protected]>
Done! Really appreciate your help on this. |
Thank you! |
Added yaml settings to define adjectives and nouns for healing plants and modified safe-room to check for them. Right now, that adds one plant type, "a swaying plant dancing to a melody only heard by the vela'tohr," from the HE store Adaptive Botany, but it will allow for more versatile incorporation of new plant types introduced by fest stores or modified by alterers.