i'm trying to make this proc go through only obj/Equips/E in usr.contents instead of every obj the player mob has in his usr.contents. the code is below. you can see that this is part of a lib that is found on to display inventory on screen. i tried using var/obj/Equips/E and replacing usr.E in place of usr.contents but it doesn't work.
Previous
icon_state = "Previous"
screen_loc = "6,3"
Click()
usr.client.screen -= usr.curitem //remove the currently displayed item
usr.curitemnum-- //find the index of the item "below" the current one
if(usr.curitemnum <= 0) //if it's invalid
usr.curitemnum = usr.contents.len //set it to the "top" item
usr.curitem = usr.contents[usr.curitemnum] //set the curitem var for future clicks
usr.client.screen += usr.curitem //display the new one
ID:147813
Nov 13 2003, 10:02 am
|
|
In response to jobe
|
|
so i put this?
mob var EquipE = /obj/Equips/E i tried that and doesn't work. you didn't define the var so i assumed you meant that. i also tried putting for(var/obj/Equips/E in usr.contents) instead |
In response to ZDarkGoku
|
|
I think it would help if you said what you're actually trying to do. I've read both your posts on this thread through about 5 times and I'm still confused. =P
|
In response to Crispy
|
|
the lib to this code is here --->>> http://developer.byond.com/hub/Destroy/On-ScreenItemListDemo
it goes through everything in usr.contents. but i want it to go through obj/Equips/E in usr.contents this is what i have so far and it doesn't work Click() usr.client.screen -= usr.curitem //remove the currently displayed item usr.curitemnum-- //find the index of the item "below" the current one if(usr.curitemnum <= 0) //if it's invalid for(var/obj/Equips/E in usr.contents) usr.curitemnum = E.len //set it to the "top" item for(var/obj/Equips/E in usr.contents) usr.curitem = E[usr.curitemnum] //set the curitem var for future clicks usr.client.screen += usr.curitem //display the new one |
You tried makeing var/OBJ/equip/e... this means that this is a variable for an OBJECT.. you want a variable for the MOB
Try this..(type it in.. dont copy past..) look under Mob.. then user under that and where the users variables are declared add in the variable EquipE
mob
var
Hp
mana
otherVariables
EquipE
Then when your calling it up itll be usr.EquipE ...
well i hope this helps..