Help with Renpy Drag and Drop

swimsoot

Member
Game Developer
Mar 14, 2020
249
615
Hey party people,
I'm trying to add a simple screen where MC can drag a vibrator over different parts of a character and give her the time of her life. I'm using Drag and Drop for the vibrator icon so that whenever the draggable vibrator icon is hovered over the droppable body part, a simple response occurs. Currently, I can get the vibrator to drag around the screen and even get a reaction when it lands on the droppable spot using the following:
screen buzz():
imagemap:
ground "buzz ground"

draggroup:
drag:
drag_name "pussy"
xpos 0.42
ypos 0.68
child "buzzdrop"
draggable False
droppable True

drag:
drag_name "wand"
xpos 0.55
ypos 0.1
child "magicwand"
draggable True
droppable False
drag_offscreen True
dragged drag_placed, draggedsound

Unfortunately, when the draggable gets dropped on the droppable, it just jumps to the screen before. When I try commands to the droppable like

dropped Jump("buzzdone")
or
hovered Show("hoverbuzz")

I get errors like: _call_() takes exactly 1 argument (3 given)

I've watched online tutorials, but nothing has given me the answer. What's the simplest code to make this happen?
Thanks so much!
 

osanaiko

Engaged Member
Modder
Jul 4, 2017
2,118
3,405
In order to help us help you, two requests:

1. please post the code using the "code" formatter.

1714278021693.png

2. The issue is probably around the context of where/how you are showing the screen, or how a "return" is handled on the drop event. Please show the code where you call/show the " buzz " screen.


EDIT: I went to look at the code and saw that RenpyTom is throwing mad shade in the :

" More complicated systems take significant programming skill to get right. " :ROFLMAO::ROFLMAO:

So I take back my initial guess as to the cause of the issue - looks like old drag-and-drop is more complex than that...

...

Double looking at your code.... [ dragged drag_placed, draggedsound this looks wrong.
dragged
A callback (or list of callbacks) that is called when the Drag has been dragged. It is called with two arguments. The first is a list of Drags that are being dragged. The second is either a Drag that is being dropped onto, or None of a drop did not occur. If the callback returns a value other than None, that value is returned as the result of the interaction.
I think that means if you have more than one callback, you need to put those two+ callbacks in a list:
Code:
dragged [drag_placed, draggedsound]

Regarding hovered Show("hoverbuzz") ... what are you trying to do? show a vibrating version of the draggable "wand" image when it is hovered?
The documentation for this is extremely poor, but some brief search engine use landed me on this post:
Which suggests that instead of a "child" attribute, you need to set the individual "hover/idle/selected_hover/selected_idle" attributes separately, and then they should be able to swap the displayable for you, rather than needing you to run a Show action.
 
Last edited:

swimsoot

Member
Game Developer
Mar 14, 2020
249
615
First of all, I heart you! Second...
The vibrator drag works great, it's when it hovers over certain erogenous zones that I want the simple animation to occur. Right now, I can get the animation to occur if you drag the vibrator over her mound and click (the "drag_placed" code in the draggable vibrator seems to work fine if you know to go right over the droppable spot on her mound and click - not ideal)

I tried putting the callbacks in a list like you said. Didn't hurt, didn't help.
I tried setting the vibrator's attribute to two distinct "selected_hover_child" and "selected_idle-child". Didn't work.
I tried making the droppable of her mound a selected_hover_child (even though it's a droppable, I figured it might work - it didn't)
I tried making her mound a hotspot. Didn't work (although maybe there's some way to work this that I don't know.)

It's seems so totally doable, and yet continued failure. Hmm... Thoughts?
 
  • Like
Reactions: osanaiko