ID:2041123
 
(See the best response by Nadrew.)
Hey guys,

so I have been missing for quite a long time and wanted to get started again but after the first 2h of coding I am expirencing the first blocking issue. I have been trying to use the Mousedown() on verbs which are not located on the map. Is this even possible?


Thanks in advance
That doesn't make any sense, verbs never exist on the map.
To describe my problem with an example:

A user wants to use punching bags to increase his stamina and I want to avoid AFK players (as much as possible) which could be solved by only using the verb "Train" as long as the verb has a MouseDown() event on itself.

I know that there are no verbs located on the map but the only possible place to make MouseDown() work was on the map which kind of irritated me.
Well, for one, punching bags are bad design, a train verb is worse design.

You don't need a verb at all, if you insist on punching bags, simply use MouseDown() to make the person train on the thing as long as the button is pressed.

mob
var/tmp/is_training = 0
proc/StupidTrain()
while(is_training)
src << "i iz tranung"
sleep(10)

obj/stupid_bag
MouseDown()
if(!usr.is_training)
usr.is_training = 1
spawn() usr.StupidTrain()
MouseUp()
usr.is_training = 0


Or something along those lines.
Well.. this is a solution for my training example (it was only an example and not planned. Sorry for the bad example) So i assume that using MouseDown() on verbs is not possible?
Best response
Verbs are one-off actions that trigger a function, they're not subject to mouse actions, only things on the map are.

Sounds like you don't want a verb at all, but something on the map that triggers a proc as the mouse is held down on something.
Well my first intention was to use this MouseDown event on verbs for techniques/spells which would require an incantation but I guess I will use another way for making this work efficiently

Thanks for the help :)
For that you'd probably want to put a hotbar or something on the map and go that route, verb panels are a really out-dated concept on BYOND and are pretty ugly.