Hi -- I'm new here and just starting to get my feet wet, and one thing that's stumped me (I'm sure it won't be the last) is how to get my directional doors working.
The experiment game I'm working on runs from an orthogonal p.o.v, and so I have four different doors -- north, south, east, and west (north and east show from the "interior" of a buiding while west and south show from the "exterior".
So far, all my doors are stored in one file, doors.dmi, and doors.dmi has two states, "closed" and "opened". Each of those states is a 4-direction, 1-frame movie containing the door's four facings.
I've started by placing the closed doors for each direction on my map, and then (following Deadron's Step BYOND) I've put an "open()" verb under the closed door state which looks like this:
verb
open()
set src in view(1)
new /turf/door/opened(src)
So far, so good -- as long as the door is south-facing, no problem. But when a door for any other direction is opened, it is replaced by the opened icon for south, rather than north, east, or west as appropriate, so clearly I'm missing something important here :)
How do I tell the open verb to replace the close door icon with the opened door facing the right direction?
Thanks in advance for any help with my silly newbie question :)
ID:170300
Feb 17 2005, 6:32 am
|
|
In response to SSJ2GohanDBGT
|
|
Thanks for your answer :)
Sadly, though it seems like it should work, it still produces a south-facing door no matter the facing of the original door for me. I added some messages to show me what direction it thought the doors were facing like so: verb In this case I get: Closed door is 8. Open door is 2. Color me confused. :| EDIT: I think I was going about this the wrong way; a simple change of the icon_state a la icon_state = "opened" gives me an open door in the right direction. D'oh. I'll be back with more simple questions, I'm sure :) I'm also still curious about how I'd put a new object in the game with a specific direction to it. |
In response to Cruinne
|
|
...I'm also still curious about how I'd put a new object in the game with a specific direction to it. Well if you want a specific direction, just set its dir to that direction at runtime. Example: obj And so on... This would be how I would do it, there might be a better way and if there is someone is sure to reply and let you know of it. |
In response to XxDohxX
|
|
XxDohxX wrote:
Example: > obj And so on... This would be how I would do it, there might be a better way and if there is someone is sure to reply and let you know of it. obj/Doors I'd probably do something more like this. -Angel |
In response to Angel of Flames
|
|
Waste of time. :P
You can set the dir by itself, ex: dir=NORTH. |
In response to Hell Ramen
|
|
Thanks all! The help is much appreciated and is very ... helpful ;)
I just started playing with BYOND and I'm having a great time -- and all I have is a person walking around opening and closing doors. (can you say easily amused?) |
In response to Hell Ramen
|
|
Hell Ramen wrote:
Waste of time. :Pman hell ramen I was gonna say that :-). He's right if you have a bunch of doors and you call this at new youll get some made overhead.So might as wel call it at compile_time instead of run_time. |
Hopefully the verb is off a "closed" door, otherwise I'm not sure how to go about doing this =P
Example with your code: