ID:172644
 
I need help again on this topic becuase no1 replied on my last post of this one. Here are more details of what im doing. You see, if youve ever played the Metroid Series, you found out that you have to shoot doors. Well, Im making it so that you have to shoot doors too. You also could tell that they are multi-tiled if you transfer them to BYOND graffix(graphics). Well, instead of wasting my time and making it multi-tiled with 4 .dmi states, I just made the doors with big .bmp icons that are 4 tiles in total size( big square). Well, In the shooting code, I made it so that if the beam you shoot hits something(the location of it) it would open the door. But it only ended up opening that certain tile and leaving the door alone. So, I instead made it so that it checks it in view, and if it is in view, it changes the turf into the other turf. That didnt work either. After that I made it so that if that certain bullet( in the obj/bullet code) bumps ( Bump(mob/M) for example) it would change the icon of the door, etc etc. That still isnt working. I dont really understand what the problem is, but if you help out, I will greatly respect you. I know I know, asking for help gets annoying, but this is a major part of the Metroid series and it would help out in the map making. Thnx for reading :)
Wow! About 1/4 of that made sense. Try re-phrasing.
The code you mentioned where you loop through door pieces in view to open them, what does that which you have allready look like?
In response to Garthor
Yea, whaat Garthor posted. It was supposed to look like the way he showed it. It just isnt working out for some reason. Look, let me rephrase. The doors wont simply open to any command I put. The bullet bumping into the door doesnt work, the proc checking if there is any parts of the door turfs in the view(4) of the bullet, it the bullet Enter(O)s the door and opens it. None of the above work. I know one of the above is the key, its just that I keep messing up in that one. Lets see if I ever get to fix it.
In response to Bloodsport12
Bloodsport12 wrote:
Yea, whaat Garthor posted. It was supposed to look like the way he showed it. It just isnt working out for some reason. Look, let me rephrase. The doors wont simply open to any command I put. The bullet bumping into the door doesnt work, the proc checking if there is any parts of the door turfs in the view(4) of the bullet, it the bullet Enter(O)s the door and opens it. None of the above work. I know one of the above is the key, its just that I keep messing up in that one. Lets see if I ever get to fix it.

Umm Garthor only posted a link to what you have said...I think it would be easyier if you just use four icon states, it would probably save a little bit of size, too. You REALLY need to post what you have actually tryied other wise; either 1# you wont get help or 2# some one will just program it for you (which is "slightly" less likely).
This should get you started:

obj
var
atom
movable
Owner
x_off //define their location offset instead of using pixel_y, pixel_x.
y_off
proc
Bumped()
Door
var
list
Movables=list() //our list of objects used to create a multi-tile door.
New()
..()
spawn(10)
var/obj/O=new //create a new object type.
var/list/states=icon_states(src.icon) //makes a list of all icon states in an dmi type.
for(var/state in states) //searches the list of icon_states
var/pos=findtext(state,",") //parses the icon_state name to find a possible coordinate
if(!pos)
continue // not a coord
var/x_off = text2num(copytext(state,1,pos))
if(x_off==null || x+x_off>world.maxx)
continue // not a coord or out of bounds
var/y_off = text2num(copytext(state,pos+1))
if(y_off==null || y+y_off>world.maxy)
continue // ditto
O=new(locate(x+x_off,y+y_off,src.z)) //sets these objects to the correct x/y positions above the main.
O.density=1 //makes the objects density one.
O.x_off=x_off //save their x_off position for later usage when you open/close the door
O.y_off=y_off //ditto
O.name=src.name //make their name the same so it appears to be the same atom
O.icon_state=state //set the icon_state of the object.
O.icon=src.icon //make the objects icon to the owners.
O.Owner=src //set src as its owner for future reference.
src.Movables.Add(O) //add the object to the owners list so you can easily access them.
Bumped(atom/movable/A)
if(istype(A,/obj/projectiles/))
var/obj/projectiles/O=A
spawn(1)
O.Hit(src)
projectiles
proc
Hit()
Bump(atom/movable/A)
if(isobj(A))
var/obj/O=A
spawn(1)
O.Bumped(src)


If there's anything you don't understand about that, come back here and explain what does not make sense to you, and we'll try to help you to the best of our knowledge.