-
Notifications
You must be signed in to change notification settings - Fork 276
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
feat: add reproduce area options in debug-map menu #4311
Conversation
Extends the map submenu of the debug menu with an option to force monsters in a rectangular area to reproduce. cow goes moo, sheep goes bah
@chaosvolt / @scarf005 fyi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build fails in lua bindings due to change in function signature.
/home/scarf/repo/cata/Cataclysm/src/catalua_bindings_creature.cpp:285:9: error: no matching function for call to 'resolve'
285 | SET_FX_T( try_reproduce, void() );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/scarf/repo/cata/Cataclysm/src/catalua_bindings_utils.h:28:9: note: expanded from macro 'SET_FX_T'
28 | sol::resolve< func_type >( &UT_CLASS::func_name))
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/scarf/repo/cata/Cataclysm/src/sol/sol.hpp:19779:14: note: candidate function template not viable: no known conversion from 'void (monster::*)(const bool)' to 'void (*)()' for 1st argument
19779 | inline Sig* resolve(Sig* fun_ptr) {
| ^ ~~~~~~~~~~~~
/home/scarf/repo/cata/Cataclysm/src/sol/sol.hpp:19774:14: note: candidate template ignored: could not match 'R (*)(void (*)(), Args...)' against 'void (monster::*)(const bool)'
19774 | inline auto resolve(R fun_ptr(Args...)) -> R (*)(Args...) {
| ^
/home/scarf/repo/cata/Cataclysm/src/sol/sol.hpp:19784:14: note: candidate template ignored: could not match 'void (*)()' against 'bool'
19784 | inline auto resolve(R (C::*mem_ptr)(Args...)) -> R (C::*)(Args...) {
| ^
/home/scarf/repo/cata/Cataclysm/src/sol/sol.hpp:19789:17: note: candidate template ignored: failed template argument deduction
19789 | inline Sig C::*resolve(Sig C::*mem_ptr) {
| ^
/home/scarf/repo/cata/Cataclysm/src/sol/sol.hpp:19794:14: note: candidate template ignored: substitution failure [with Sig = <void ()>, F = void (monster::*)(const bool)]: no matching function for call to 'resolve_i'
19794 | inline auto resolve(F&& f) -> decltype(detail::resolve_i(types<Sig...>(), std::forward<F>(f))) {
| ^ ~~~~~~
1 error generated.
refactor: add reproduce area options in debug-map menu
@scarf005 just tested again on top of latest changes. |
good point, still rusty with github |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scarf005 did you reproduce this on top of just this PR or with extra code you added to force rotting of eggs? |
with the extra code. i guess this is because baby timer isn't initialized cotrectly |
yes just saw that |
@scarf005 curious, I can't seem to repro your issue. I tried causing friendly and not friendly chickens to spawn eggs and i move to their tile to pick up the eggs 1 turn afterwards and examine the items. The age always seems to be '1', not a negative value. What am I missing in the repro steps? :S |
hmm strange, can't reproduce. |
Extends the map submenu of the debug menu with an option to force monsters in a rectangular area to reproduce.
cow goes moo, sheep goes bah
Purpose of change
Purpose is to ease debugging of hard-to-reproduce corner-cases such as what happens when a monster reproduces and spawns offspring.
Describe the solution
Solution works by extending map sub menu of debug menu with an option to force all monsters in an area to reproduce. This can actually be triggered multiple times in the row in order to quickly create a huge flock of creatures out of a specific parent. The forcing of reproduction works by splitting try_reproduce into 2 parts, try() and actual reproduce()
Note that the solution does not cause eggs to hatch as that is based on the rot-timer functionality which is in a different part of the codebase altogether. TODO for future PR.
Describe alternatives you've considered
Testing
spawn creatures. use new debug command to get them to spawn other creatures. then use debug command to kill in area to check that we didnt break that as well due to refactoring. moo
Additional context
Checklist