Code:
obj
items
verb
Get()
set src in oview(1,usr)
set category=null
if(src.Move(usr))
usr<<"<b>You picked up [src.name]!</b>"
Drop()
set src in usr.contents
set category=null
if(src.Move(usr.loc))
usr<<"<b>You dropped [src.name]!</b>"
proc
Use()
DblClick()
if((src in usr.inventory))
src.Use()
clothing
Use()
var/mob/User=src.loc
if(User)
if(ismob(User))
if((src in User.equipped))
src.suffix=""
User.overlays-=src.icon
User<<"<b>You remove the [src.name].</b>"
User.equipped.Remove(src,null)
else
src.suffix="<Equipped>"
User.overlays+=src.icon
User<<"<b>You wear the [src.name].</b>"
User.equipped.Add(src)
armor
var
armor=1
fcloak
icon='fcloak.dmi'
Use()
..()
var/mob/User=src.loc
if(User)
if(ismob(User))
if((src in User.equipped))
User.armor+=src.armor
else
User.armor-=src.armor
Problem description:
The problem I am running into is that I have a movement state for all directions for my player sprite, I made a piece of armor that has one frame for all directions. Now when I equip the armor the arms and legs of my player are moving out of its clothes. Do you make a frame for the armor for each frame you have on your sprite and call it a movement state as well? Is there another way around it, sort of like when your player has armor equipped stopping the movement state of your player sprite and having him stay in frame 1 (stand still) and walk that way? I looked around and there are very little to no clothing/hair tutorials/guides. Any help would be appreciated...
-BIGBROYO
So if you have the following states in the player icon:
"still", "moving"
And you have "moving" set as a movement state, you'll want your clothing icon to have the same setup, with both states, the "moving" state will be used and synced to the player's icon when the player moves.
Another trick you'll find handy is the ability to have movement and non-movement states named the same thing.
So if you have a non-movement state named "standing" and a movement state called "standing" the non-movement state will be used when you're not moving and the movement state will be used when you're moving, as long as icon_state is "standing". You can do this with the default un-named state too.