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

Player general orders #5638

Merged
merged 11 commits into from
Oct 26, 2023
Merged

Conversation

MjnMixael
Copy link
Contributor

Here is player "general" orders. This new feature leverages LuaAI's foundation to be able to create new orders on the Comm Board that the player can select. These orders do not apply to a ship, however. They simply run arbitrary Lua script with an optional target parameter. Ai_helper.Ship will always be nil here.

You can define an order and set it to an arbitrary category that will show on the top-level Comm Board menu. Orders are then grouped by category.

General orders can be enabled or disabled. They are disabled by default on mission load. Disabled means they will not be visible at all on the Comm Board.

General orders can be valid or invalid. They are invalid by default on mission load. Invalid orders will be visible but greyed out on the Comm Board.

Mission file parsing and saving of default enabled/validated orders is included with this PR. A UI interface is planned and will look very similar to the Allowed Orders dialog in the Ship Editor. However I have a several PRs already that upgrade the Mission Specs dialog (where this will go) that I want to wait for a merge to avoid merge conflicts.

This does also come with sexps to enable/disable and validate/invalidate orders on the fly during a mission. That will suffice for now until I can get the UI dialog created.

@wookieejedi wookieejedi added the feature A totally new sort of functionality label Sep 29, 2023
@JohnAFernandez JohnAFernandez added general modding A general feature or issue related to modding capabilities of FSO Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle labels Oct 1, 2023
Copy link
Member

@BMagnu BMagnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs more const references!
Otherwise some small issues, but generally good to go.
Nice to see LuaAI being expanded in this direction!

code/ai/ailua.cpp Outdated Show resolved Hide resolved
code/ai/ailua.cpp Outdated Show resolved Hide resolved
code/ai/ailua.cpp Outdated Show resolved Hide resolved
code/ai/ailua.cpp Outdated Show resolved Hide resolved
code/ai/ailua.cpp Outdated Show resolved Hide resolved
fred2/missionsave.cpp Outdated Show resolved Hide resolved
qtfred/src/mission/missionsave.cpp Outdated Show resolved Hide resolved
qtfred/src/mission/missionsave.cpp Outdated Show resolved Hide resolved
qtfred/src/ui/widgets/sexp_tree.cpp Outdated Show resolved Hide resolved
fred2/sexp_tree.cpp Outdated Show resolved Hide resolved
@JohnAFernandez JohnAFernandez removed the Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle label Oct 16, 2023
@wookieejedi
Copy link
Member

Will plan to merge later today

@wookieejedi wookieejedi merged commit 91c15e6 into scp-fs2open:master Oct 26, 2023
14 checks passed
@MjnMixael MjnMixael deleted the player_general_orders branch October 26, 2023 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A totally new sort of functionality general modding A general feature or issue related to modding capabilities of FSO
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants