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?
ID:155247
![]() Aug 11 2011, 2:17 pm
|
|
![]() Aug 11 2011, 3:34 pm
|
|
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.
|
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.
|
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?
|
Yes, it is very possible.
Create the object or whatever with a modified pixel_x/pixel_y. obj Create and add the object into X's overlays/underlays.
overlays.Add( new/obj/random_logo )
|
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?
|
-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.
|
Modifying the New() of the bottom part of the door allows you to add the overlay to the door at runtime.
|
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"? |
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. |
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. |
New() is a built-in proc.
New() If you are not familiar with this, please read over the guide. http://www.byond.com/docs/guide/ |