Well I haven't coded in awhile and want to get it back up again. Right now I'm trying to code a simple drag out of inventory to within once space of the character to drop. I don't remember how to do so and would like it very much if you could show/tell me.
NOTE. I have looked in the reference and it didn't help that much
Thanks!
ID:161476
May 3 2008, 11:20 am
|
|
In response to Garthor
|
|
I still don't get how to do this cant you just post some code showing how it could be done?
|
In response to Elextra
|
|
Off Topic: If you need to refresh you memory read the Dm guide again and look at tutorials. It will come back to you slowly.
|
In response to Master rla
|
|
I never new how to do this.... Can't anyone just supply that one little bit of code?
|
In response to Nategrant
|
|
This is Developer How-To, not Developer Do-For-Me. Garthor gave some pretty good instructions of how to get it to function, but I wouldn't expect anyone to just give you the code when that much has been done for you already.
|
In response to Devourer Of Souls
|
|
I just don't understand what he was saying...
|
In response to Nategrant
|
|
Read the link Garthor posted. Also remember to use that page (The DM Reference, also available by the F1 key within Dream Maker) frequently when coding.
If you override the atom/MouseDrop() proc, it will be called whenever an atom is dropped (caused when it has been 'dragged' by the mouse by a player and the player let go of the mouse button) onto another atom (possibly on a statpanel, or in the map, etc). The proc arguments let you know exactly where it was dropped, where it was before, what statpanel or other location it is on, etc (the player that did the dragging is usr: the mouse procs are an exception where usr is safe to use. the object that was dragged is naturally the source of the proc, or 'src'). So you can manage what you wanted by overriding that proc and doing your action. obj/item |
In the object's MosueDrop proc, if the conditions are correct (src in usr and isturf(over_object) and over_object in range(usr,1)), then Move() it there.