mob/var
cursorx=8
cursory=12
client/var
hudid=0
//Cursor and battle menu
obj
layer=MOB_LAYER+16
icon='images/battle/HUD/battleicons.dmi'
Cursor
icon='images/battle/HUD/hudpointer.dmi'
screen_loc="8,12:10"
Attack
icon_state="attack"
maptext="Attack"
screen_loc="8:15,12:5"
maptext_x=16
maptext_width=50
Skills
icon_state="skills"
maptext="Skills"
screen_loc="12:15,12:5"
maptext_x=16
maptext_width=50
Items
icon_state="items"
maptext="Items"
screen_loc="15:15,12:5"
maptext_x=16
maptext_width=50
Defend
icon_state="defend"
maptext="Defend"
screen_loc="18:15,12:5"
maptext_x=16
maptext_width=50
Flee
icon_state="flee"
maptext="Flee"
screen_loc="21:15,12:5"
maptext_x=16
maptext_width=50
// USE BUTTONS INSTEAD, WAY EASIER
var/obj/Cursor
var/obj/Attack
var/obj/Skills
var/obj/Items
var/obj/Defend
var/obj/Flee
mob/var/obj/Cursor/Cursor
mob/var/obj/Attack/Attack
mob/var/obj/Skills/Skills
mob/var/obj/Items/Items
mob/var/obj/Defend/Defend
mob/var/obj/Flee/Flee
mob/var/battleselect=""
mob/proc/battlemenu()
src.Cursor=new(cursorx,cursory)
Cursor.x=cursorx
Cursor.y=cursory
src.Attack=new
src.Skills=new
src.Items=new
src.Defend=new
src.Flee=new
src.client.screen+=Cursor
src.client.screen+=Attack
src.client.screen+=Skills
src.client.screen+=Items
src.client.screen+=Defend
src.client.screen+=Flee
src.Cursor.x=cursorx
src.Cursor.y=cursory
mob/proc/movecursor()
src.Cursor.Move("[cursorx],[cursory]")
mob/proc/battlemenuover()
src.client.screen-=Attack
src.client.screen-=Skills
src.client.screen-=Items
src.client.screen-=Defend
src.client.screen-=Flee
client
West()
if(usr.inbattle==0)
..()
if(usr.inbattle==1)
switch(hudid)
if(0) ..()
//Mainbattlemenu
if(1)
usr.cursorx-=3
usr.movecursor()
East()
if(usr.inbattle==0)
..()
if(usr.inbattle==1)
switch(hudid)
if(0)
//Main battlemenu
if(1)
usr.cursorx+=3
usr.movecursor()
North()
if(usr.inbattle==0)
..()
if(usr.inbattle==1)
src <<"Just seeing if this works. North."
South()
if(usr.inbattle==0)
..()
if(usr.inbattle==1)
src << "Just seeing if this works. South."
Problem description:
I have tried a few things to make my cursors work, but as of now, I've been having trouble with pretty much anything I tried. The cursor shows up just fine on the HUD, but when I try to move it, I get this message:
runtime error: Cannot execute "11,12".Enter().
proc name: movecursor (/mob/proc/movecursor)
usr: (src)
src: Guest-2017257456 (/mob)
src.loc: Grass (5,5,1) (/turf/grass)
call stack:
Guest-2017257456 (/mob): movecursor()
Guest-2017257456 (/client): East()
runtime error: Cannot execute "14,12".Enter().
proc name: movecursor (/mob/proc/movecursor)
usr: (src)
src: Guest-2017257456 (/mob)
src.loc: Grass (5,5,1) (/turf/grass)
call stack:
Guest-2017257456 (/mob): movecursor()
Guest-2017257456 (/client): East()
Also, this is only the excerpt containing the part with the cursor. The rest would probs spam everything full.
However, I doubt that's what you're looking for, as you're probably wanting to change screen_loc and not loc. Move() is for moving an object on the map.