So I am trying to get back a little of the coding skill I once had but was forgotten. I can still pick up on most things fairly quick, but I still have problems here and there.
My problem is, I have doors in a project. I also have torches and books. All of them were created as Obj's. Now my problem is, the door has a verb to open it and keep it open for abot 4 seconds until it closes again. Now I want to have my torches positioned on the map, and when your next to one and use the Light() verb (Which obviously only pops up while your right beside it). When you use the light verb the torch turns it's icon into the lit torch, and its luminosity turns to a 4. Then I want to be able to have an Put_Out() to change it back to it's original state.
Of course that means the light only appears when its unlit, and put out only appears while its lit.
(I would really appreciate if somebody would also tell me a good way on going about this efficiently).
Now though, my torch has the verb Open(). Which makes it dissapear for 4 seconds, And my doors have the Verbs Light and Get (From books and torches) How do you restrict the obj's from sharing verbs?
ID:175659
![]() Mar 23 2003, 5:41 am
|
|
Yeah thats my problem. I am defining them for each different object, but still they get the same commands.
Edit - obj door icon = 'door.dmi' density = 1 opacity = 1 verb/Open_door() set category = "Actions" set src in oview(1) src.invisibility = 1 src.density = 0 src.opacity = 0 sleep(40) src.invisibility = 0 src.density = 1 obj Torch icon = 'structure2.dmi' icon_state = "Torch" density = 1 verb/Light() set category = "actions" src.icon = 'structure2.dmi' src.icon_state = "Torch_lit" src.luminosity = 4 Thats what I have so far. Now the door doesnt have the light torch verb, but the torch can only be opened, and not lit. The doors are now using the torches icon too, how is this happening? |
JordanUl wrote:
Yeah thats my problem. I am defining them for each different object, but still they get the same commands. I see the problem. You think you're defining them for different objects, but you're not. obj Nothing is indented under door, and you made the same mistake with Torch. Lummox JR |
You're making the mistake of not using the object hierarchy correctly. In this case, clearly what you've done is to give all the verbs to all objs, whether the verb applies or not. A torch shouldn't have the Open() verb defined; only doors should. Doors shouldn't have a Light() verb. Define each verb under the type of item it applies to, not under plain old obj.
Lummox JR