obj/HUD
Attack_Button
name = "Attack"
icon = 'buttons.dmi'
icon_state = "button"
layer = MOB_LAYER+10
New(client/c)
world << "Button created!"
screen_loc = "1,1"
c.screen += src
Click()
view() << "It works!"
Problem description:
I am trying to place a button in my game, but I simply can't get any hud to work. I've tried a lot of stuff, and even using a HUD-managing library didn't work for me. I litterally tried copy-pasting code from other people to no avail.
The line "Button created" never pops up, so I'm guessing that's the biggest part of the problem.
and Voila, bearing in mind that you should have an output box somewhere -which i'm gonna guess you will.. :P- the appropriate messages and things should occur as necessary.
Just in case though, since you mentioned you've been stuck on this for some time -unless you didn't take long trying 'a lot of stuff'- and assuming that you aren't a complete beginner to programming with the DM, maybe your past issues were tied to not realising that passing an argument upon initialisation of an obj mattered since you defined it to work as such, i.e.:
Would not work i don't think, because you request it to be as such in New(client/c) without giving the argument/parameter client/c a default value.