ID:178825
Mar 31 2002, 7:11 am
|
|
i cannot figure out how to use the MouseDrag proc correctly. i would explain how i am trying to get it to work but it is probably as close from the way it is supposed to be as it could get, lol, so ill spare u the need to laugh and not show it. so what i am asking is if anyone could just quickly explain how u use it correctly. the help doesnt seem to help on this one. thx to anyone with the time to answer.
|
In response to Spuzzum
|
|
i mean how do i make something happen when i move a certain thing from one place to another. i have something in mind but i try to be vague in my descriptions because i prefur it when i dont just get code for it unless that is the only way someone will help me. i like to learn how to use a proc then figure out how to implement it myself. but anywho, i wanted it to do something when i drag an obj from a statpanel to the map. this is the code i said would probly look stupid if i showed it:
MouseDrag(obj/O as obj in src,,/mob/Stat/statpanel("Items"),istype(/turf)) (actions to take place when an obj is dragged from the statpanel to the map go here) (waiting for the laughter to end...) did i get it even close? |
In response to Loduwijk
|
|
Ah.
obj/MouseDrag(atom/over_object, source_location, dest_location) if(!over_object) usr << "I am not above any object on the map." else usr << "I am above [over_object] on the map." usr << "I came from [source_location]." usr << "I am currently over [dest_location]." Try dragging an obj around and see the output it gives you. |
In response to Spuzzum
|
|
thank you, i am studying that lil example u gave, and observing what it does, and it is making more sence now, i am going to try to make it do something useful in my game and hopefully i will succeed this time :)
|
In response to Spuzzum
|
|
that example only lets me drag obj, which is what i wanted to drag, but i had ideas needing other things to be dragged later on, is it possible to drag other things? i dont see how i would get it to do so
|
In response to Loduwijk
|
|
Loduwijk wrote:
that example only lets me drag obj, which is what i wanted to drag, but i had ideas needing other things to be dragged later on, is it possible to drag other things? i dont see how i would get it to do so Yep, you can drag mobs and turfs in the same fashion. Just remember that you can't move turfs, so dragging turfs might seem a little odd to some people. =) |
In response to Spuzzum
|
|
dragging turfs may seem odd, but i had some ideas that required that, ill just have to make some obj that look like turfs. thx a lot for the help, it has taken away this headache i have had for half a week now.
|
In response to Spuzzum
|
|
one more Q about it (i say one more now, but later ill probly have another, but ill save Q's after this one till a later date). i tried to get something to happen when an obj was dragged over a certain turf. i practiced like this to see if i could do it:
if(dest_location==source_location)usr<<"It's where it came from." else usr<<"It's not where it came from." if(dest_location==istype(/turf/ground/floor/ cobbled_floor))usr<<"It is on the hard floor." if(dest_location==istype(/turf/ground/floor/ red_carpet))usr<<"It is on the cumfy rug." i tried if(dest_location=="cobbled floor") before i tried if(dest_location==istype(/turf/ground/floor/cobbled_floor)) but niether worked. how do i get it to do different things based on what it is over? |
In response to Loduwijk
|
|
ignore this, i misread what u said, i thought u said u cant do it with mob and turf, then i reread it and saw i was mistaken
|
In response to Loduwijk
|
|
lol, that was so stupid of me. i said it only let me drag obj. i went and looked and it was in the obj branch. that might be why, lol. umm... i think i should stop rambling on, this thread has about 10 posts and about 7 of them are mine. i think i talked a bit too much
|
In response to Loduwijk
|
|
if(dest_location==istype(/turf/ground/floor/ cobbled_floor))usr<<"It is on the hard floor." Close: if(istype(dest_location, /turf/ground/floor/cobbled_floor)) usr << "It is on the hard floor." else if(istype(dest_location, /turf/ground/floor/red_carpet)) usr << "It is on the comfy rug." (Remember that it'd be best not to copy-and-paste that, since it's not out to the proper indentation (and it uses spaces instead of tabs anyway).) |
I'm not sure you mean by "use it correctly". What do you want to use it correctly for? I can answer that one. =)