obj
clothes
School
icon='Schoolhat.dmi'
icon='Schoolvest.dmi'
icon='Schoolslacks.dmi'
icon='Schoolshoes.dmi'
What would be the appropriate syntax if I wanted to put on a suit at once rather than equipping each part of the suit one click at a time? For example at the moment I have
|
So, what I have is:
obj This is what I have prior to adding any new codes. It works with individual items, but then after figuring out how to edit your codes to mine, it doesn't seem to fully work. Also, I'm assuming A is atom. mob/verb |
As Konlet mentioned you should ideally use overlays for clothes as this will allow you to add multiple individual parts to the player's icon.
You mention that you want a single item that causes the player to have multiple overlays at the same time. A rough version of that approach would look like this: // clothes.dm I hope this helps. |
Alright. I'm not sure what the difference is atm, but I'll check. There was one problem with your codes, and that was defining worn for 'obj' twice. I don't believe you needed to do it twice since it was mentioned for everything within obj/clothes. I am curious, is there suppose to be a level with overlay? Say I wanted to have a shirt and then a coat or maybe a gun belt on top of that shirt.
|
In response to Ash Abe Add
|
|
Ash Abe Add wrote:
There was one problem with your codes, and that was defining worn for 'obj' twice. Oops! I've edited my post. I don't believe you needed to do it twice since it was mentioned for everything within obj/clothes That's correct. Uh, well, you passed my test. ;P I am curious, is there suppose to be a level with overlay? Say I wanted to have a shirt and then a coat or maybe a gun belt on top of that shirt. By default overlays will be applied in the order that they are given. You can use the layer attribute to decide the way that overlays are ordered but for clarity I recommend adding them in the right order through code. Setting the layer variable might cause you to miss something later, but if you always send it through in the right order you'll immediately be able to fix something that isn't right. |
Then is that what's happening in this code if I added a second suit? Shouldn't there be a way to remove it without removing from the inventory? This is a bit unrelated, but it happened while doing this, but is there a reason why there's sometime a, like an IE symbol next to an icon after creating it? When double clicking it leads to the window box?
|
In response to Ash Abe Add
|
|
Ash Abe Add wrote:
Then is that what's happening in this code if I added a second suit? Yes, if you were to wear two suits at the same time one would be added after the other. Keep in mind that the order between suits is undefined, so they may end up being added in either order. But the individual components of the suit (hat, shirt, pants, etc.) would be added in the order provided. Shouldn't there be a way to remove it without removing from the inventory? In my psuedo-code you can do this by using the "wear" verb again. The UpdateOverlays() proc first removes all overlays and then adds them again. I.e., the player is stripped naked and then their clothes are (re)applied. This is how the clothes are removed. This is a bit unrelated, but it happened while doing this, but is there a reason why there's sometime a, like an IE symbol next to an icon after creating it? When double clicking it leads to the window box? I don't understand what you mean. An Internet Explorer icon? |
I'm thinking now, as I was preparing what to write, that maybe I need to add another line of code, to tell wear() which suit is desired. On the other hand, this picture will show you what I mean. It's in the topleft corner, as you should be able to see.
http://www.picturetrail.com/sfx/album/view/24681214 |
obj This won't work. The sample above is structurally the same as: obj In other words, only the last icon will be defined, the previous lines are ignored. You should try setting it up using my example with the AddOverlays() proc. Bear in mind it's not just something you can copy/paste -- it's intended as an example so you can learn how to do it right, not as a solution to your specific problem. Something else you may want to try is reading the DM Guide. It's intended to explain how BYOND works for beginners and should help you understand how the structure and syntax works. |
No, ignore the code, look at the side window with all of the extensions. There's a testa.dmm and underneath is a Clothes folder. If you look there's an icon that's not, for me, traditionally there.
|
In response to Ash Abe Add
|
|
Ash Abe Add wrote:
No, ignore the code, look at the side window with all of the extensions. There's a testa.dmm and underneath is a Clothes folder. If you look there's an icon that's not, for me, traditionally there. Yeah. As I mentioned in item no. 1, it's probably a BYOND bug. Or an issue with Windows. I'll page Lummox JR to look at that issue, he'll probably be able to explain it. |
If you wanted to be able to equip/unequip different articles of clothing simultaneously, you'll need to make them into diferent objects.
To create an equipping system, you could do something like this:
But, if you wanted to equip all in your person at once, you could do something like this at the simplest: