help trying to go through obj/equips/e in usr.contents in Developer Help
|
|
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
|
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..