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

[Feature request] Make a debug function that deletes items. #12908

Closed
Soyweiser opened this issue Jul 12, 2015 · 12 comments

Comments

Projects
None yet
7 participants
@Soyweiser
Copy link
Contributor

commented Jul 12, 2015

We have an option to spawn items, but no way of removing items reliably. It would be great if we could remove them using a debug item. Perhaps a simple "remove all items from a square" option, that allows you to target a square and remove everything.

Edit: http://smf.cataclysmdda.com/index.php?topic=10688.0 (posted link to this issue here).

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2015

Could be also integrated with the editmap edit items on square option. Currently editmap allows only editing items on a single square, doesn't allow wishing quantities, deleting items, displaying items from multiple squares etc.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jul 12, 2015

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2015

Of course it isn't really needed for debugging, but it could help people to do whatever they want in this sandbox of ours. I have seen the request pop up before.

@Rail-Runner

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2015

Well, you can just create an acid field on the pile of items you want to remove.

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2015

Use the Lua debug console (in the debug menu) and enter map:i_clear(player:pos()), I have used this quite often and it works fine (it removes the items on the location of the player). Of course you can use specific points just as well: map:i_clear(tripoint(1,2,3)).

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2015

Would it be possible to have bindable Lua "macros"? Could be useful for some debugging cases.

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2015

Would it be possible to have bindable Lua "macros"? Could be useful for some debugging cases.

You mean with configurable key bindings accessible from withing the main game environment? That would require some code with the main input context. Add an action and let it trigger some Lua code. But I think it's not that much useful. Calling the debug menu is one key press (I mapped it to Q), selecting Lua is another (n), pressing the up-arrow to get the least recently entered string and press enter twice.

The Lua console stores the last few entered strings (like the filter menu in "list items around you" view), you can press the up-key to access them.

Alternatively, you can put big function in data/json/main.lua or data/json/preload.lua, they can be called from the debug console.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jul 13, 2015

Useful or not, it's a debug menu, not a "cheat" menu or "convenience" menu, cluttering it up with cheat options sets a bad precedent.

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Jul 13, 2015

Well, as you can use the Lua commands to already do this, you don't really need it. So, don't go implementing this. Not closing the issue right now as I have some more questions.

Is there a Lua guide for CDDA? Or something like that? I sadly don't have a lot of Lua experience. Probably I should do something about that. So I have no idea what the capabilities of Lua are.

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2015

Is there a Lua guide for CDDA? Or something like that? I sadly don't have a lot of Lua experience. Probably I should do something about that. So I have no idea what the capabilities of Lua are.

What do you need? Programming in Lua (http://www.lua.org/pil/contents.html) should give you enough information to understand the syntax, and there is doc/LUA_SUPPORT.md.

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Jul 13, 2015

Well, was thinking that for other players it might be useful to have some of the more requested commands listed somewhere.

But for myself, reading those will be enough.

@Barhandar

This comment has been minimized.

Copy link
Contributor

commented Jul 28, 2015

Debug in a lava tile (which is currently only terrain with DESTROY_ITEM), drop items on it, remove lava tile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.