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

Spawn a group from a debug menu #78976

Open
Brambor opened this issue Jan 6, 2025 · 1 comment
Open

Spawn a group from a debug menu #78976

Brambor opened this issue Jan 6, 2025 · 1 comment
Labels
Code: Debug Debugging and troubleshooting the game, also includes the debug menu Info / User Interface Game - player communication, menus, etc. <Suggestion / Discussion> Talk it out before implementing

Comments

@Brambor
Copy link
Contributor

Brambor commented Jan 6, 2025

Is your feature request related to a problem? Please describe.

People testing need to look for things where the group they are testing spawns. And hope they find the group.

Example:

Solution you would like.

Spawn the group directly from the debug menu. Preferabely here (debug menu > s Spawning…)

image

Make it the second entry and name it g Spawn an item group

Describe alternatives you have considered.

No response

Additional context

It was discussed on Discord and they say it is not possible in the current game. So we should make it possible.

https://discord.com/channels/598523535169945603/598529174302490644/1324075950442545193

Notable discussion entries:

can I debug-spawn an item group (like toy_engine_kit) directly?

You can't, no

(What for?)

to spawn a filled box and check on it

I thought the "project in a box" kits like the toy_engine_kit were collapsed on spawn, but their boxes didn't have the COLLAPSE_CONTENTS flag, so I was thinking of double checking, but "can't do it easily with debug menu" was beyond my lazy threshold
#78886

There is a debug map that spawn one itemgroup across entire 24x24, you just need to edit the group id it spawns

(I assume this needs reloading the game and it is somewhat hidden from the devs.)

@Brambor Brambor added <Suggestion / Discussion> Talk it out before implementing Info / User Interface Game - player communication, menus, etc. Code: Debug Debugging and troubleshooting the game, also includes the debug menu labels Jan 6, 2025
@CLIDragon
Copy link
Contributor

Just fill out the spawn_item_group function with what you need.

diff --git a/src/debug_menu.cpp b/src/debug_menu.cpp
index 97b0d47c20..9681bf92e8 100644
--- a/src/debug_menu.cpp
+++ b/src/debug_menu.cpp
@@ -274,6 +274,7 @@ std::string enum_to_string<debug_menu::debug_menu_index>( debug_menu::debug_menu
 		case debug_menu::debug_menu_index::WRITE_CITY_LIST: return "WRITE_CITY_LIST";
         case debug_menu::debug_menu_index::TALK_TOPIC: return "TALK_TOPIC";
         case debug_menu::debug_menu_index::IMGUI_DEMO: return "IMGUI_DEMO";
+        case debug_menu::debug_menu_index::SPAWN_ITEM_GROUP: return "SPAWN_ITEM_GROUP";
         // *INDENT-ON*
         case debug_menu::debug_menu_index::last:
             break;
@@ -966,6 +967,7 @@ static int spawning_uilist()
         { uilist_entry( debug_menu_index::SPAWN_ARTIFACT, true, 'a', _( "Spawn artifact" ) ) },
         { uilist_entry( debug_menu_index::SPAWN_CLAIRVOYANCE, true, 'c', _( "Spawn clairvoyance artifact" ) ) },
         { uilist_entry( debug_menu_index::SPAWN_HORDE, true, 'H', _( "Spawn a dummy horde twenty submaps(10 OMTs) to the north" ) ) },
+        { uilist_entry( debug_menu_index::SPAWN_ITEM_GROUP, true, 'I', _( "Spawn an item group at the chosen location." ) ) },
     };
 
     return uilist( _( "Spawning…" ), uilist_initializer );
@@ -3663,6 +3665,11 @@ static void spawn_named_npc()
     g->load_npcs();
 }
 
+static void spawn_item_group()
+{
+
+}
+
 static void unlock_all()
 {
     if( query_yn( _(
@@ -3924,6 +3931,10 @@ void debug()
         }
         break;
 
+        case debug_menu_index::SPAWN_ITEM_GROUP:
+            spawn_item_group();
+            break;
+
         case debug_menu_index::SPAWN_MON:
             debug_menu::wishmonster( std::nullopt );
             break;
diff --git a/src/debug_menu.h b/src/debug_menu.h
index 13d4c0acbc..1f388e9a4d 100644
--- a/src/debug_menu.h
+++ b/src/debug_menu.h
@@ -45,6 +45,7 @@ enum class debug_menu_index : int {
     SPAWN_ARTIFACT,
     SPAWN_CLAIRVOYANCE,
     SPAWN_HORDE,
+    SPAWN_ITEM_GROUP,
     MAP_EDITOR,
     CHANGE_WEATHER,
     WIND_DIRECTION,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Debug Debugging and troubleshooting the game, also includes the debug menu Info / User Interface Game - player communication, menus, etc. <Suggestion / Discussion> Talk it out before implementing
Projects
None yet
Development

No branches or pull requests

2 participants