ID:890523
 
(See the best response by Albro1.)
Code:
world
view="35x23"
loop_checks=0
/* setting the view to 35 tiles along X axis and 23 tiles Y axis
To make it full-interface, set your view and then open an interface file
and delete all but the map section, stretch the map to cover the whole screen
and then right click it, set anchors at top left and bottom right, or top right
and bottom left and your final step is to, set the winset of the user too winset(usr,"Map","focus=true")
under the Login proc
*/

client/proc/StartHotkeys()// This is the proc for actually giving the bare hud as objects to the user, implement this
new/obj/Numbers/Key0(src)
new/obj/Numbers/Key1(src)
new/obj/Numbers/Key2(src)
new/obj/Numbers/Key3(src)
new/obj/Numbers/Key4(src)
new/obj/Numbers/Key5(src)
new/obj/Numbers/Key6(src)
new/obj/Numbers/Key7(src)
new/obj/Numbers/Key8(src)
new/obj/Numbers/Key9(src)
new/obj/Numbers/Key10(src)
new/obj/Numbers/Key11(src)
new/obj/Numbers/Key12(src)
new/obj/Keys/Key0(src)
new/obj/Keys/Key1(src)
new/obj/Keys/Key2(src)
new/obj/Keys/Key3(src)
new/obj/Keys/Key4(src)
new/obj/Keys/Key5(src)
new/obj/Keys/Key6(src)
new/obj/Keys/Key7(src)
new/obj/Keys/Key8(src)
new/obj/Keys/Key9(src)
new/obj/Keys/Key10(src)
new/obj/Keys/Key11(src)
new/obj/Keys/Key12(src)
obj/Hotkeys
layer = 99
icon='Hotkeys.dmi'
var/locc
New(client/C)// Creating on the clients screen, so that no one else can see the hotbars
screen_loc=locc
C.screen+=src
Z1
icon_state = "z1"
locc = "1,14"
Z2
icon_state = "z2"
locc = "1,13"
X1
icon_state = "x1"
locc = "15,2"
X2
icon_state = "x2"
locc = "16,2"
X3
icon_state = "x3"
locc = "15,1"
X4
icon_state = "x4"
locc = "16,1"

obj/Keys// Creating blank boxes so that the hotbars 'identity' remains hovering
layer=10// over skillcards added to the bar
icon='Hotkeys.dmi'
icon_state = ""
var/locc
New(client/C)
screen_loc=locc
C.screen+=src
Key0
locc = "2,1"
Key1
locc = "3,1"
Key2
locc = "4,1"
Key3
locc = "5,1"
Key4
locc = "6,1"
Key5
locc = "7,1"
Key6
locc = "8,1"
Key7
locc = "9,1"
Key8
locc = "10,1"
Key9
locc = "11,1"
Key10
locc = "12,1"
Key11
locc = "13,1"
Key12
locc = "14,1"
obj/Numbers
layer=25
icon='Hotkeys.dmi'
var/locc
New(client/C)
screen_loc=locc
C.screen+=src
Key0
icon_state = "~"// The hotbar identities, this is the '~' identity, it will hover over skillcards
locc = "2,1"
Key1
icon_state = "1"
locc = "3,1"

Key2
icon_state = "2"
locc = "4,1"
Key3
icon_state = "3"
locc = "5,1"
Key4
icon_state = "4"
locc = "6,1"
Key5
icon_state = "5"
locc = "7,1"
Key6
icon_state = "6"
locc = "8,1"
Key7
icon_state = "7"
locc = "9,1"
Key8
icon_state = "8"
locc = "10,1"
Key9
icon_state = "9"
locc = "11,1"
Key10
icon_state = "0"
locc = "12,1"
Key11
icon_state = "-"
locc = "13,1"
Key12
icon_state = "+"
locc = "14,1"





obj
var
screenlocation
SlotLoc = 0
SkillType = "None"
DblClick()

obj/skill
layer=95
icon='Skill.dmi'
MouseDrag()
mouse_drag_pointer=src
MouseDrop(obj/overobject,srclocation,overlocation)
if(istype(overobject,/obj/Keys/))
screen_loc=overobject.screen_loc
usr.client.screen+=src
if(name==usr.slot0)usr.slot0=null
if(name==usr.slot1)usr.slot1=null
if(name==usr.slot2)usr.slot2=null
if(name==usr.slot3)usr.slot3=null
if(name==usr.slot4)usr.slot4=null
if(name==usr.slot5)usr.slot5=null
if(name==usr.slot6)usr.slot6=null
if(name==usr.slot7)usr.slot7=null
if(name==usr.slot8)usr.slot8=null
if(name==usr.slot9)usr.slot9=null
if(name==usr.slot10)usr.slot10=null
if(name==usr.slot11)usr.slot11=null
if(name==usr.slot12)usr.slot12=null
switch(overobject.icon_state)
if("0")usr.slot0=name
if("1")usr.slot1=name
if("2")usr.slot2=name
if("3")usr.slot3=name
if("4")usr.slot4=name
if("5")usr.slot5=name
if("6")usr.slot6=name
if("7")usr.slot7=name
if("8")usr.slot8=name
if("9")usr.slot9=name
if("10")usr.slot10=name
if("11")usr.slot11=name
if("12")usr.slot12=name
else
usr.client.screen-=src
if(name==usr.slot0)usr.slot0=null
if(name==usr.slot1)usr.slot1=null
if(name==usr.slot2)usr.slot2=null
if(name==usr.slot3)usr.slot3=null
if(name==usr.slot4)usr.slot4=null
if(name==usr.slot5)usr.slot5=null
if(name==usr.slot6)usr.slot6=null
if(name==usr.slot7)usr.slot7=null
if(name==usr.slot8)usr.slot8=null
if(name==usr.slot9)usr.slot9=null
if(name==usr.slot10)usr.slot10=null
if(name==usr.slot11)usr.slot11=null
if(name==usr.slot12)usr.slot12=null
Click()
if(loc!=usr)del src
..()
Heal
icon_state="Heal"
Click()usr.Heal()







mob/verb
Hotslot0()
set hidden=1
if(slot0)skilluse(slot0)
Hotslot1()
set hidden=1
if(slot1)skilluse(slot1)
Key2()
set hidden=1
if(slot2)skilluse(slot2)
Key3()
set hidden=1
if(slot3)skilluse(slot3)
Key4()
set hidden=1
if(slot4)skilluse(slot4)
Key5()
set hidden=1
if(slot5)skilluse(slot5)
Key6()
set hidden=1
if(slot6)skilluse(slot6)
Key7()
set hidden=1
if(slot7)skilluse(slot7)
Key8()
set hidden=1
if(slot8)skilluse(slot8)
Key9()
set hidden=1
if(slot9)skilluse(slot9)
Key10()
set hidden=1
if(slot10)skilluse(slot10)
Key11()
set hidden=1
if(slot11)skilluse(slot11)
Key12()
set hidden=1
if(slot12)skilluse(slot12)




mob
proc
skilluse(var/A)
var/k="[A]"
switch(k)
if("Heal")Heal()


my mob proc skilluse doesnt work for some reason:

This would be a great time for a TL;DR. So tell us, for those of us who do not want to go through all of that nonsense, what exactly is wrong.

And just for future reference - you cannot post a huge snippet like this and say "why doesn't it work?".

In my opinion, if you need all that obnoxious programming just for on-screen HUD objects, then you're doing it wrong. However, since I myself have never personally used on-screen HUDs (I rather use the interface for its purpose), I cannot, for certain, tell you that you are doing it wrong.
In response to Spunky_Girl (#1)
Sorry for my mistake but this is my first time posting here.
The thing that doesnt work is my macros when i go to the interface and type "1" for key then my command is "Hotslot1"
it should activate the skill that is in my hotslot 1 but it doesnt.I really hope i dont waste your time only becouse i cant explain well
Best response
Your skilluse() proc is only accounting for "Heal".
In response to Albro1 (#3)
Yes becouse thats the only skill i have at the moment but that isnt the problem in my game i have hotslots and u can drag and drop skill in them that all works the only thing that doesnt is that when i drop the skill heal and then press the "1" key it doesnt work i am asking how to do this
Do this:
mob
proc
skilluse(A)
src << A
var/k="[A]"
switch(k)
if("Heal")Heal()

And tell me what it outputs to you.
In response to Albro1 (#5)
It didnt have any effect and it doesnt output me anything soo i am starting to think that i maybe do the macro wrong here is what i do for the macro
Key "1"
command Hotslot1
and i make it to repeat
Make sure you hit the "Get Key" button and then hit "1" on your keyboard, don't type it directly in.
In response to Albro1 (#7)
Yes i am using the "Get Key" and then press "1" any other ideas?