Hi,
Is it impossible for drags to interact with other drags outside of its own draggroup? I'm trying to create a drag and drop between multiple lists containing items which are interactable between each other, it's hard to code since draggroups doesn't take grids, boxes or anything else other than drags as its child. If there are any tricks or advice given is appreciated.
https://www.renpy.org/doc/html/drag_drop.html
Drag and Drop beyond Drag Group, is it impossible?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Re: Drag and Drop beyond Drag Group, is it impossible?
As the documentation says, drags can be dropped only inside the same drag group.
Drags can be reassigned to other drag groups (therefore they stop belonging to their previous drag group), but it's not necessary in your case.
The whole screen can be covered by the same one drag group.
Here is an example how to exchange items between the backpack and equipment slots:
viewtopic.php?f=51&t=66699
The backpack is a kind of grid, not a Ren'Py grid, but calculating cells positions with Python is trivial.
PS. Just have a separate list or dict for every sortable sequence. Then whatever item gets dropped somewhere, you process it with dragged callback and detect there an action to take.
Positions (pos x, y) of list items in the screen can be calculated by a dedicated Python function (or separate functions for different kinds of lists if you want).
PPS. It's convenient to return from the called screen after every successful drag-n-drop operation. Then process moving items in or between lists and call that screen again, in the cycle.
Drags can be reassigned to other drag groups (therefore they stop belonging to their previous drag group), but it's not necessary in your case.
The whole screen can be covered by the same one drag group.
Here is an example how to exchange items between the backpack and equipment slots:
viewtopic.php?f=51&t=66699
The backpack is a kind of grid, not a Ren'Py grid, but calculating cells positions with Python is trivial.
PS. Just have a separate list or dict for every sortable sequence. Then whatever item gets dropped somewhere, you process it with dragged callback and detect there an action to take.
Positions (pos x, y) of list items in the screen can be calculated by a dedicated Python function (or separate functions for different kinds of lists if you want).
PPS. It's convenient to return from the called screen after every successful drag-n-drop operation. Then process moving items in or between lists and call that screen again, in the cycle.
If the problem is solved, please edit the original post and add [SOLVED] to the title.
Re: Drag and Drop beyond Drag Group, is it impossible?
Thanks for advice. I'll look into this.Here is an example how to exchange items between the backpack and equipment slots:
viewtopic.php?f=51&t=66699
edit:
Umm... I get an error when opening the demo. Sorry, but do you know how to fix?
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "renpy/common/000namespaces.rpy", line 33, in set
setattr(self.nso, name, value)
Exception: config.check_conflicting_properties is not a known configuration variable.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "D:\Renpy\renpy-8.0.3-sdk\renpy\bootstrap.py", line 277, in bootstrap
renpy.main.main()
File "D:\Renpy\renpy-8.0.3-sdk\renpy\main.py", line 558, in main
renpy.game.context().run(node)
File "game/gui.rpyc", line 15, in script
File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python3.9/site-packages/future/utils/__init__.py", line 441, in raise_
File "game/gui.rpyc", line 15, in script
File "D:\Renpy\renpy-8.0.3-sdk\renpy\ast.py", line 2441, in execute
self.set()
File "D:\Renpy\renpy-8.0.3-sdk\renpy\ast.py", line 2459, in set
ns.set(self.varname, value)
File "renpy/common/000namespaces.rpy", line 33, in set
setattr(self.nso, name, value)
File "D:\Renpy\renpy-8.0.3-sdk\renpy\defaultstore.py", line 105, in __setattr__
raise Exception('config.%s is not a known configuration variable.' % (name))
Exception: config.check_conflicting_properties is not a known configuration variable.
Windows-10-10.0.19045 AMD64
Ren'Py 8.0.3.22090809
Drag 1.0
Sat Jun 3 18:06:04 2023
Re: Drag and Drop beyond Drag Group, is it impossible?
The demo was made with RenPy 8.1. You can use the last Ren'Py SDK or manually find and remove config.check_conflicting_properties from gui.rpy.Deimos96 wrote: ↑Sat Jun 03, 2023 6:53 am Umm... I get an error when opening the demo. Sorry, but do you know how to fix?Code: Select all
I'm sorry, but an uncaught exception occurred. Exception: config.check_conflicting_properties is not a known configuration variable.
If the problem is solved, please edit the original post and add [SOLVED] to the title.
Who is online
Users browsing this forum: Ahrefs [Bot]