However, I only want one of the commands to show at a time when the event is met. Say for instance you walk up to a door and the door is closed. Only the open command should show. Once the door is open, only the close command should show. I tried doing things like using set hidden = 1 based on certain variables being met but it just breaks the entire function all together for some reason.
Here is what I have:
obj/Door
icon = 'Door.dmi'
House_Door
icon_state = "Closed"
density = 1
opacity = 1
get = 0
verb
Open()
if(state == 1)
set src in oview(1)
set category = "Door"
icon_state = "Open"
density = 0
opacity = 0
state = 2
Close()
if(state == 2)
set src in oview(1)
set category = "Door"
icon_state = "Closed"
density = 1
opacity = 1
state = 1
That part I did try was this:
Close()
if(state == 1)
set hidden = 1
else
set src in oview(1)
set category = "Door"
icon_state = "Closed"
density = 1
opacity = 1
state = 1
But all it does is hide the close verb altogether.
What you can do to get what you want is modify the verbs list var. You can add and remove verbs from that list, and it will cause them to either show up or not. An easy way for this to work is to make one of those verbs a proc instead of a verb. (So, it won't be in the verb list.) I'll assume the door starts closed, so the Close() verb should be a proc.
Then, in Open you do:
And vice-versa in the Close proc. (I'm using the . path operator there to avoid typing out the entire path tree.)