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

[scripts][safe-room]Add support for custom healing plants #6945

Merged
merged 8 commits into from
Oct 30, 2024

Conversation

Tirost
Copy link
Contributor

@Tirost Tirost commented Oct 22, 2024

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.

@MahtraDR MahtraDR changed the title Update safe-room.lic and base.yaml for custom healing plants [scripts][safe-room]Add support for custom healing plants Oct 23, 2024
@MahtraDR
Copy link
Collaborator

Is the intention here to make adding more nouns/plant types easier for users?

@Tirost
Copy link
Contributor Author

Tirost commented Oct 23, 2024

Yes.

@MahtraDR
Copy link
Collaborator

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.

@Tirost
Copy link
Contributor Author

Tirost commented Oct 24, 2024

That sounds even better, though perhaps beyond my ability to code. Are you thinking of something that would look like:

healing_plant_adjectives:
- vela'tohr
- swaying

Or would it be better to keep it as a horizontal entry, just without the quotation marks and pipes, like: healing_plant_adjectives: vela'tohr swaying ?

@MahtraDR
Copy link
Collaborator

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}")

@Tirost
Copy link
Contributor Author

Tirost commented Oct 30, 2024

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.

safe-room.lic Outdated Show resolved Hide resolved
@Tirost
Copy link
Contributor Author

Tirost commented Oct 30, 2024

Done! Really appreciate your help on this.

@MahtraDR MahtraDR merged commit eede990 into elanthia-online:master Oct 30, 2024
3 checks passed
@MahtraDR
Copy link
Collaborator

Thank you!

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