Drag and Drop beyond Drag Group, is it impossible?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
Deimos96
Regular
Posts: 26
Joined: Tue Nov 15, 2022 5:34 am
Contact:

Drag and Drop beyond Drag Group, is it impossible?

#1 Post by Deimos96 »

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

jeffster
Veteran
Posts: 452
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: Drag and Drop beyond Drag Group, is it impossible?

#2 Post by jeffster »

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.
If the problem is solved, please edit the original post and add [SOLVED] to the title. 8)

Deimos96
Regular
Posts: 26
Joined: Tue Nov 15, 2022 5:34 am
Contact:

Re: Drag and Drop beyond Drag Group, is it impossible?

#3 Post by Deimos96 »

Here is an example how to exchange items between the backpack and equipment slots:
viewtopic.php?f=51&t=66699
Thanks for advice. I'll look into this.

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

jeffster
Veteran
Posts: 452
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: Drag and Drop beyond Drag Group, is it impossible?

#4 Post by jeffster »

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.
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.
If the problem is solved, please edit the original post and add [SOLVED] to the title. 8)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]