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

Mission deadlines supports dialogue variables #77047

Merged

Conversation

RenechCDDA
Copy link
Member

@RenechCDDA RenechCDDA commented Oct 14, 2024

Summary

Features "Mission deadlines supports dialogue variables"

Purpose of change

Mission deadlines are almost unused, despite being one of the most obvious things any good 'quest' should have.

Also the whole point of giving out the "faction succession" mission was to show the cooldown before you can do it again. There wasn't a way to actually put in the cooldown. This PR lets us put in the cooldown, and display the timer appropriately.

Describe the solution

load the deadline as a dur_or_var, which means that existing durations can be loaded seamlessly while also supporting newly loaded dialogue variables which supports times, integers, math expressions, and variable objects. This did end up taking out the old deadline_low and deadline_high, as previous code assumed their values were days.

Add a kwarg( /optional argument?) to assign_mission allowing access to mission::set_deadline

...Also a fix for EOC_FACTION_SUCCESSION_CHECK which still had a coded value of checking against the old 90-day cooldown, instead of the npctalkvar time_between_succession

Describe alternatives you've considered

the game_start and game_begin events require some really, really stupid piping. I'd strongly consider reversing their order so game_begin always runs first if it could be done easily.

Testing

2024-10-14.13-18-39.mp4

Additional context

@github-actions github-actions bot added <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON Missions Quests and missions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership [Markdown] Markdown issues and PRs labels Oct 14, 2024
@RenechCDDA RenechCDDA marked this pull request as draft October 14, 2024 22:49
@RenechCDDA
Copy link
Member Author

Found a problem in my implementation: It previously accepted integers as a valid input and counted them as days. dur_or_var also accepts integers as input, but counts them as seconds.

Now I could work around that, but at that point I might as well rip out the old json loading and replace the few instances we have in repo with a single deadline member that accepts either a min and max or just a min. Plus this will help with clang's complaints.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 15, 2024
@RenechCDDA RenechCDDA force-pushed the dialogue_set_mission_deadline branch from ce4b978 to 5d32994 Compare October 15, 2024 23:31
@github-actions github-actions bot added Mods Issues related to mods or modding Mods: Dark Days of the Dead Anything related to the DDotD mod (classic style zombies) Mods: Innawood 🌲 Anything to do with Innawood mod labels Oct 15, 2024
@RenechCDDA RenechCDDA marked this pull request as ready for review October 15, 2024 23:32
@RenechCDDA RenechCDDA force-pushed the dialogue_set_mission_deadline branch from 5d32994 to 842670f Compare October 15, 2024 23:39
@RenechCDDA
Copy link
Member Author

Found out deadlines were undocumented when I went to change the documentation for them :(

Then found a bunch more undocumented stuff so threw all that in there too

Sorry but this commit is just churn
@Maleclypse Maleclypse merged commit 6d791fb into CleverRaven:master Oct 24, 2024
23 of 27 checks passed
@RenechCDDA RenechCDDA deleted the dialogue_set_mission_deadline branch October 24, 2024 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Missions Quests and missions Mods: Dark Days of the Dead Anything related to the DDotD mod (classic style zombies) Mods: Innawood 🌲 Anything to do with Innawood mod Mods Issues related to mods or modding NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants