ID:178237
 
I need help with the dblclick proc. I need to make it so it calls another proc when you double click on yourself.

DblClick(M)
if(M == usr)
UseTech()

thats what I got, I'm pretty sure it's the DblClick proc that is wrong and not the way I am calling the "UseTech()"
Please help thx!
Jinks wrote:
I need help with the dblclick proc. I need to make it so it calls another proc when you double click on yourself.

DblClick(M)
if(M == usr)
UseTech()

thats what I got, I'm pretty sure it's the DblClick proc that is wrong and not the way I am calling the "UseTech()"
Please help thx!

This should work,
DblClick()
   if(src == usr)
      UseTech()
Jinks wrote:
I need help with the dblclick proc. I need to make it so it calls another proc when you double click on yourself.

Creek gave you the right format, but I'll explain it so you understand what is going on.

The first argument for DblClick() is the location of the Double Clicked atom. You usually use it to see if the player clicked the item in a specific statpanel or on the map.

src is the atom that is being clicked. You must override the Click() or DblClick() proc of the atom(s) you want to click or double click.

usr is the mob of the person that is doing the clicking. This is one of the few procs that use the usr var. One nice side effect of this is that you can call verbs directly in the Click()/DblClick() proc and they will know who the correct usr is.

This code:
DblClick(M)
if(M == usr)
UseTech()

Calls UseTech() if the item is double clicked inside the usr (which will never happen, since to click an item in the usr, it would have to be in a statpanel.)

This code:
mob
DblClick()
if(src == usr)
UseTech()

Calls UseTech() if you double click yourself.