Conversation
Adds a with the mode being required, and every parameter after that being an optional unlocked mod option, allowing users to customize that mode from its defaults. This calls a vote on the set.
|
I'm not sure I understand the goal of this PR. After taking a brief look at the code, it seems this new Maybe if you explain what functionality you need exactly I can try to answer better. Regarding the code itself:
|
|
Thanks for the detailed feedback! So we're building a mode system in BAR where players can switch between curated gameplay configurations (e.g. "Easy Tax" bundles specific sharing/economy options together). The problem it solves is that currently, changing a "mode" requires voting on each mod option individually, which creates a wall of sequential votes. You're right that SPADS doesn't do anything functional with the mode name, and that's intentional. The mode name gets passed through to the vote message, and Chobby uses it client-side to look up the mode definition (which lives in the game archive) and render a rich vote panel showing the mode name, defaults, any deviations the player made, and which optional options are being disabled. SPADS just needs to validate and apply the key=value pairs. I did look at battle presets, but those seem to be server-admin configuration (defined per SPADS instance in Totally open to moving this to a plugin instead of a core change, that makes sense. I'll look at the plugin tutorials and rewrite it as a standalone plugin. Will close this PR once that's ready. Good catch on the missing help.dat entry too, will add that to the plugin version. Sorry for not reaching out first, lesson learned! Happy to discuss the design further. |
|
Went ahead and did that, had most of this commit already done but just needed the plugin part, much better thank you! beyond-all-reason/BYAR-Chobby@0f474e4 I might reach out to you and ask for help on the best way to set up a test harness/emulate a vote for this plugin. |
|
Ok I see. Making SPADS aware of these game-defined modoption presets so that it can use them directly as such might be more efficient, but I understand the use case better now. Regarding your plugin code, it seems it no longer checks that the modoption definitions provided as
This means that a user could put the lobby in an incorrect state by calling the In your Regarding automated tests, I usually use my own lobby server emulation module in Perl which offers ways to simulate players joining, calling commands etc. Unfortunately it's not documented and it would take some time to explain everything... |
|
I realize a |
|
I added the isSettingValueAllowed function to the plugin API, so fixing your code just consists in adding a call to this function to check the values before performing the configuration changes. |
It would be interesting if we incorporated your perl module layer as a script in BAR-Devtools, maybe? That's what I'm using to boot the stack so it would fit nicely. The tests don't need to be automated in this case, that would require me have some sort of bootstrapped test runner in Chobby which I did not intend to set up for this spike. |
Adds a
/mode easy_tax resource_sharing_tax=0.5command with the mode being required, and every parameter after that being an optional unlocked mod option. This allows users to customize that mode from its defaults, or just short-hand the mode itself and skip the details. Right now, the modes are focused on co-op solutions but they could be expanded to other categories, somodeseems appropriately general.In chobby, this calls a vote on the set highlighting any differences from the mode defaults.
Testing: Working on testing this now.
LLM Disclosure: Opus 4.6, but read it then re-read it and it looks correct.
Issue: beyond-all-reason/BYAR-Chobby#1040