ID:139548
 
Code:
atom/verb/Action() //verb is available on all atoms
set src in oview(-1)

interface
border
BRC2
Action()
set src in usr.client.screen
//...

mob
professormaple
Action()
set src in view(1)


Problem description:
First, a quick overview of what this is.

I am creating a game for a friend, and I want there to be a hidden verb called Action() that is used as a general verb, e.g. talking, continuing speach, etc. With help from a previous post, i managed to get this to work.

The ranges in this work fine. The default setting is oview(-1) so that the user doesnt get a list of turfs and areas and other such atoms that have no use of the Action() verb. The range is then overridden in any atom that requires the Action() verb. This works ok.

My problem is when the interface atoms pop up whilst someone is standing next to another atom that has a use of the Action() command, this appears in the list. I do not want this to happen. I only want the interface atom to be chosen when available. How can i go about doing this?

--Darkoro
Co-Founder of SadKat Gaming.

Try set hidden = 1 in atom/verb/Action(), and set hidden = 0 where verb is needed.
In response to Ripiz
Thats not what i meant.

I dont want it to be visible at all, as it is assigned to a macro (spacebar). Therefore, whenever a player hits spacebar, all the atoms whose ranges include the player will be added to the list of possible actions the player can take.

My problem is that i want it so that whenever the user is talking to an npc, the only possible option in the list is the "continue" option, represented by /interface/BRC2.
In response to Darkoro
Just replying to see if anyone else can help me with this (SadKat and Darkoro = Same person.)

Please read the first post for more information D:
In response to SadKat Gaming
Could you show your "spacebar" verb please?
In response to Ripiz
Here. for the record, the spacebar is just the key i use for the macro. the command is action.

And i cant put too much code because the game is a secret project (original idea, you see) and i dont want to leak anything i shouldnt.

atom/verb/Action() //verb is available on all atoms
set src in oview(-1)
set hidden = 1

mob
//confidential mobname
dir = NORTH
Action()
set src in view(1)
var/turning = get_dir(src, usr)
usr.frozen = 1
if(usr.story == 1)
src.dir = turning
//confidential storyline speech
src.dir = NORTH
if(usr.story == 2)
src.dir = turning
//confidential storyline speech
usr.story += 1
src.dir = NORTH
usr.mchips += 1
usr.frozen = 0
interface
border
BRC2
name = "Continue"
layer=9
icon='Buttons.dmi'
icon_state="1"
screen_loc="14,1"
Action()
set src in usr.client.screen
if(usr.talking == 0)
usr.okay=1
for(var/interface/O in usr.client.screen)usr.client.screen-=O
else
usr.skip = 1


The conflict is between the mob and the "Continue" part. I dont want the mob's Action() verb ((spacebar)) to be visible when the "Continue" button shows on screen, which happens during speech and information messages on the client's screen.
In response to SadKat Gaming
So your spacebar button calls "Action()" verb?
Make new verb, like Spacebar()
mob/verb/Spacebar()
for(var/atom/A in pget_step(src, dir))
A.Action()

It'll basically call Action() verb for every object infront. This way it won't open popup window. But if there's two NPCs in same time - it'll talk to both.
In response to Ripiz
This isnt what i want. When the speech text box thing appears on screen, i dont want the player to be able to talk to another NPC at the same time. During speech, the action() verb represents the button which closes the current text box. I want t so that only the button which closes the current text box is availble when on screen, so that other chats cant be started.