ID:260161
 
I have had some annoyance lately when I want to do some work with icons. I like to keep all my icons organised. I would have all the weapons in one file exc. But I have been getting annoyed because sometimes I want to put icons into subgroups. Like, for example, I may have weapons, and then I may want to put swords, and then have a variety of swords there. Then I came up with a good idea. What if you were able to create folders within icon files.

This would be a brilliant feature to add in and would greatly improve the neatness of a project. Also, if you wanted to refer to something in a folder you would just put something like this:

icon='Weapons.dmi'
icon_state="Swords\Dagger"


Please consider this idea as it would be a great way to organise projects more efficiently.

ADT_CLONE
Seconded, even if I don't really do any icon work. :D
Dantom has already put a feature in BYOND that searches through all subfolders to find the file. So, this new feature you are saying is pointless and too complicated.

Let me explain:

Say i make a folder in my game, Happy World, called Weapons and then a folder in that called Swords. The path to it would be: C:\happyworld\weapons\swords

Now, i wanted to put the icon 'greatsword.dmi' in there, so the path would be C:\happyworld\weapons\swords\greatsword.dmi

Now in byond, to get to that file all i need to do is:
icon
greatsword
icon='greatsword.dmi'

Then, BYOND will search all subfolders in the folder where your game is created (C:\happyworld\) untill it finds greatsword.dmi

NOTE: this feature is already in BYOND (just incase you misread)

So, you can see its already easy to sort out and tidy up your files with out the hassle of extra coding.

Yalabor.
In response to Yalabor
Yes, though I wanted it for a slightly different reason. I'll use a different example this time. Lets say you were creating a person. Now, firstly I will do it your way, Yalabor.

First I would want to create a NPC folder. Then I need to create a human folder. Now I need to add in all the body parts. So off I go. Head.dmi, hand.dmi. Now what if I wanted to create another different type of animal in the NPC folder. I would also name it head.dmi as well. Now that wouldn't work, and my first suggestion was to stop this. When I'm coding in icons, it gets annoying when I have multiple icons that are essentially the same thing but different. So then I have to try and remember all the names. By the way, you would need the human folder incase I wanted to have different faces for the humans.

Now for my example.

This would be easy with this new feature implemented. You would just create a icon file called NPC.dmi. Then inside that you would insert a folder named Human. Then, inside that if you wanted to add some heads you would just create another folder and put the heads in there. It would make it a whole lot more easier for the coder. Also, it would save a lot of space, since you wouldn't need to go to the need of creating extra icon files.

Hopefully this has got my point across.

ADT_CLONE
In response to ADT_CLONE
I really would like this idea.
It would save on the space used for thousands of different icons, example of a base icon.

Using thsi idea;
BASE ICON
/clothes
cloth_shirt
chainmail/
basicchainmail
/weapons
big_sword

That way we wouldn't have to have thousands of icons...
'base icon.dmi'
cloth_shirt.dmi
basicchainmail.dmi
big_sword.dmi

That's alot of icons that all take up alot of space.
ONE icon is alot less size than 4 icons.

I really like this idea, because then we could just have ONE dmi file for the resources, I also like the idea of having subpaths for the icon states, so that way we could do some pretty interesting functions..
Example..
//some kind of overlay
src.icon='Icons.dmi'
var/iconstate
iconstate="/armor/[ARMOR.type]/[ARMOR]"

we would no longer have to use new image() right?

I really, really, REALLY like this idea.
but one flaw, how would DM tell between a regular / and a folder? I admit, there are some flaws, but I would really like this added.

In 4.0, you guys have a totally new icon maker anyway, so why not add a few of the users bells and whistles anyway!!

In response to ADT_CLONE
You can turn off the searching-in-subfolders behaviour (Build->Preferences or something like that). Then the problem of having multiple head.dmi files goes away; you just refer to npc/human/head.dmi and npc/animal/head.dmi. There's no more potential for confusion.
In response to Crispy
He means subdirectories in icons, for those who like to classify, then subclassify them. His example (sort of):

[Weapons.dmi]
/ - Blades
/ - - Knife
/ - - Katana
/ - - Dagger
/ - Guns
/ - - Shotgun
/ - - 9mm Pistol
/ - - 9mm Pistol Silenced
[/Weapons.dmi]

In response to Audeuro
Yes, I know what he means. I'm pointing out an alternative solution.
I second this. I have never been able to find a way to organise my icons, this would definetly do it. I hope this gets added.

O-matic
You already can do that. Just name your icon states in that manner, then reference them that way, and it accomplishes the same thing.
In response to Yalabor
Yalabor wrote:
Dantom has already put a feature in BYOND that searches through all subfolders to find the file. So, this new feature you are saying is pointless and too complicated.

By "Dantom" you mean "Dan", right? I heard he's the one majorly responsible for said feature.
Anyway, that feature lags like hell and is annoying. I always have FILE_DIR off.
ADT_CLONE wrote:
I have had some annoyance lately when I want to do some work with icons. I like to keep all my icons organised. I would have all the weapons in one file exc. But I have been getting annoyed because sometimes I want to put icons into subgroups. Like, for example, I may have weapons, and then I may want to put swords, and then have a variety of swords there. Then I came up with a good idea. What if you were able to create folders within icon files.

This would be a brilliant feature to add in and would greatly improve the neatness of a project. Also, if you wanted to refer to something in a folder you would just put something like this:

> icon='Weapons.dmi'
> icon_state="Swords\Dagger"
>

Please consider this idea as it would be a great way to organise projects more efficiently.

ADT_CLONE

I wanted to so something like that a long time ago and ended up making a library for it. This was years ago, mind you. I'm not sure if it's exactly what you have in mind, but it allows you to change your state relative to a folder tree.

http://developer.byond.com/hub/Ebonshadow/cd_state
In response to Android Data
The only time you can notice any slowdown with the feature is in games with heavy references to files outside of the main directory, it's caused by the overhead generated by looking through all of the folders to find the files. The more files you have the slower it gets, as anything else that looped in that way would.