Skip to content

[lua, sql, cpp] Implement Family/Species Wide Lua File System; Goblin Family Skill Audit#9659

Draft
CriticalXI wants to merge 1 commit intoLandSandBoat:basefrom
CriticalXI:mob_family_lua
Draft

[lua, sql, cpp] Implement Family/Species Wide Lua File System; Goblin Family Skill Audit#9659
CriticalXI wants to merge 1 commit intoLandSandBoat:basefrom
CriticalXI:mob_family_lua

Conversation

@CriticalXI
Copy link
Copy Markdown
Contributor

@CriticalXI CriticalXI commented Mar 22, 2026

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

  • Introduces a family-level (aka the more accurate name of "species") lua script layer that sits between individual mob scripts and the engine's default behavior. Family scripts apply shared logic to all mobs of a given mob_family_system.sql family name string without duplicating code across hundreds of individual mob files.
    • The current implementation is setup so that if an individual mob has a lua file using the same function, it overrides the family wide logic.
    • I had thought to add a super() equivalent for this system but thought I'd leave this initial implementation to be more simple until something comes up needing that.
  • Adds the new Goblin and Goblin-Armored family luas to control mob skill usage percentages for all goblins in the game as an example of this new system.
    • Adjusts existing Goblin families to account for this logic adjustment.
    • I left a TODO for adjusting all the Goblin NMs with their own specific mob skill logic but I didn't want to make this PR too big.
    • Utilized Jimmayus's notes on goblin behavior to introduce a 9:9:2 ratio of goblin rush/bomb toss/bomb toss suicide rates.

Steps to test these changes

  1. Create a family script at scripts/globals/families/{FamilyName}.lua where {FamilyName} matches the family column in mob_family_system.sql exactly.
  2. Define functions using the standard mob entity setup, such as onMobFight, onMobMobSkillChoose, etc.
  3. Spawn a mob of that family.
  4. Verify the family handler fires by either seeing the logic you added fire or add a print.
  5. Edit the family script and confirm the filewatcher picks up changes without a server restart.

@CriticalXI CriticalXI marked this pull request as draft March 23, 2026 19:36
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

This PR has been automatically marked as stale because
it has not had recent activity. It will be closed if no
further activity occurs.

@github-actions github-actions bot added the stale label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant