ID:155247
 
So I've got a door icon. It's two tiles high and one time wide, but I cannot code it in so that it opens as only one icon.

I need to figure out how to code in an overlay that is 32 pixels above the bottom of the door so that it opens as two icons, but opens together. Can anybody help with that?
Are you trying to make an double door? Just curious.
Just make a 32x64 Icon of the Door. One opened, and one closed. There's no need to make extra overlays or icons.
In response to PCGeek
Not a double door. It's just a single door. The problem with making it a 32x64 icon is that the opacity of the room gets messed up real easy.
In response to ZaibTrain
This should be fixed in the upcoming update if I understood it right.

In response to Lugia319
There's still a few other things I'm interested in doing with overlays. Is it even possible to change their pixel_x and y values?
In response to ZaibTrain
Yes, it is very possible.

Create the object or whatever with a modified pixel_x/pixel_y.

obj

random_logo

pixel_y = 32 /* self explanatory? */


Create and add the object into X's overlays/underlays.

overlays.Add( new/obj/random_logo )
In response to Neimo
Okay, so... If I have two objs, doorc1 (the top part of the door) and doorc2 (the bottom part of the door), how would I go about making the top part the overlay and the bottom part with the open/close verb?
In response to ZaibTrain
-I'm not big on coding or anything, just trying to learn a bit more and enhance some of the games I play. Sorry if it seems like I'm asking you to hold my hand through everything.
In response to ZaibTrain
Modifying the New() of the bottom part of the door allows you to add the overlay to the door at runtime.
In response to Neimo
Every time I try to stick the overlay string of code it creates an error in a completely different file. It says the error is:

"Turf Codes\Factory.dm:1:error: bad argument definition"
And when I highlight it, the error is "obj"?
In response to ZaibTrain
Paste the code here, use the DM tags.
In response to Neimo
obj
door
icon = 'doortest.dmi'
icon_state = "doorc1"
density = 1
layer = 5
opacity = 1
pixel_y = 32

Here's the base code that I'm trying to get to work with the overlays. no idea what i'm doin tho.
In response to ZaibTrain
Indent everything that's under "door" over another tab.
In response to Neimo
Alright then, done. Where do I stick the overlay code from there?
In response to ZaibTrain
[link]

Look up New() in the built in reference.
In response to Neimo
Well, I tried that, but I couldn't figure it out. No matter where I put it on the section of code I get a bad argument definition error.

I put it here-

obj
door
overlays.Add(new/obj/doorc2)
icon = 'doortest.dmi'
icon_state = "doorc1"
density = 1
layer = 5
opacity = 1
pixel_y = 32

and the icon = 'doortest.dmi' had the error. I really don't know how to do this.
In response to ZaibTrain
New() is a built-in proc.

New()

overlays.Add( x )


If you are not familiar with this, please read over the guide.

http://www.byond.com/docs/guide/
In response to Neimo
Now it says Add is an undefined proc?
In response to ZaibTrain
Overlays is not defined as var/list/overlays so you cannot use the .Add proc with it. Use += instead.

overlays += whateveryouwantasanoverlay
Page: 1 2