icon_state question

How, what and why to code in BYOND.
Post Reply
Central Core
Joined: Thu Jan 12, 2017 6:38 am
Byond Username: Central Core
Location: Earth

icon_state question

Post by Central Core » #243200

I can't thing of a good title for this so ya.

So this question is about clothing and where they take there sprite from. I a long while back I learned how to add clothing and add sprites for said clothing but now I have ran into a issue. I wanted to make a file for all my sprites or at least the ones I want to use but it seems that the clothes take there sprite through "icon_state = name" and that only pulls from one file now my question is is it possible to change said file while leaving the other intact? Any help is very appreciated. If its not possible then well then this will be harder then I thought it would be.

Thanks for reading and any help given.
User avatar
Jordie0608
Site Admin
Joined: Tue Apr 15, 2014 1:33 pm
Byond Username: Jordie0608
Github Username: Jordie0608
Location: Spiderland, Australia

Re: icon_state question

Post by Jordie0608 » #243212

The 'icon' variable designates which .dmi file is used, pathed as from the root of the codebase i.e.

Code: Select all

icon = 'icons/obj/clothing/myfile.dmi'
Forum Admin
Send me a PM if you have any issues, concerns or praise of fishfood to express about the forums.
User avatar
Thunder11
In-Game Admin
Joined: Fri Apr 18, 2014 12:55 pm
Byond Username: Thunder12345
Github Username: Thunder12345
Location: Scotland, UK

Re: icon_state question

Post by Thunder11 » #243422

For clothes specifically, what you want to do is varedit the icon var to the DMI file with the new inventory sprite, and also the alternate_worn_icon var to the DMI with the new on-mob sprite.
EDIT: Oh you're talking about in the code. In that case just set both the vars above to the files you want when defining the item
ImageImage
Spoiler:
IcePacks wrote:
MrFoster wrote:Back in my day, we didn't complain about lag! We used it to queue attacks!
That's thinking on your feet, soldier!
Quality Paprika from #coderbus wrote:[11:35.52] <paprika> holy crap so yeah i don't care about your opinion at all
oranges wrote:
Excuse me? Thats for sensible and calm rational debate, not for senseless whining.
Resident Catmin, please direct catposting to: https://tgstation13.org/phpBB/viewtopic.php?f=37&t=5578
Post Reply

Who is online

Users browsing this forum: No registered users