mob/player
proc
invchoice()
itemsnumber=0
for(var/obj/items/i in src.contents)
if(i.itemtype==inventorytype)
itemsnumber++
if(itemsnumber==28-src.cursory+itemscrolled)
callitemchoice(i)
if(itemsnumber < src.cursory+itemscrolled && menuid==3) closeitemsmenu()
callitemchoice(i as obj)
if(menuid!=9)
menuid=9
src << "Item called: [i]"
playsound('sfx/sounds/accept.wav')
src.chooseitemHUD=new
chooseitemHUD.icon+=rgb(redhud,greenhud,bluehud,alphahud)
chooseitemHUD.maptext_y+=90
for(var/itemverb in i.itemverblist)
chooseitemHUD.maptext+=itemverb
chooseitemHUD.maptext_y-=30
chooseitemHUD.maptext+="Return"
src.chooseitemFRAME=new
src.client.screen+=chooseitemHUD
src.client.screen+=chooseitemFRAME
oldcursor=list(cursorx,cursorxsmall,cursory,cursorysmall)
Setcursor(23,0,19,30)
Problem description:
I am trying to make a menu using only buttons and so, I have this inventory script running. Long story short, the real problem lies with trying to pass down an item from one proc to another via callitemchoice(item), as somehow, all that gets passed over is only the name. The list in which I store what can be done with the item itemverblist isn't loaded and I get this error message:
code\outsidemenu.dm:531:error: i.itemverblist: undefined var
Dunglas.dmb - 1 error, 0 warnings (2/19/17 10:24 pm)
code\outsidemenu.dm:531:error: i.itemverblist: undefined var
You are getting this error because the variable i doesn't have a proper type assigned to it. Using i as obj does not mean i is an obj the way you are using it. That format is mainly for verb arguments when searching a container, e.g.:
Instead, what you want is this:
callitemchoice(var/obj/i)