ID:2099827
 
So, basically my "say" verb just broke and I have no clue why. It has been working since I made it a few days ago. But now it doesn't let me write a [msg], it makes me pick from a list of stuff/mobs and uses the name of that stuff as the [msg].


This don't work anymore for me:
    verb
say(msg as text)
view() << "[usr] says, [msg]"

After clicking on the verb, the window that pops up says:
-> say "text"|mob <-




While this works fine:(same indentation and everything)
        wsay(msg as text)
world << "[usr] OOC: [msg]"

And the window says:
-> wsay "text" <-



It is literally a copy paste from Page 28 on the DM Guide. It just stopped working...

By The Way: What's a good/recommended site to upload an image so that I can post it here?

(Using BYOND version 510.1345)
Are you sure you don't have another say() defined in your code somewhere? The code you posted doesn't point at any obvious issue.
(Damn, sorry for posting on the wrong place.)

I check it all and don't see anything.
It's just code I have been doing/copying/editing while following the Guide.

Want me to post it all? It's 225 lines of code so far.
I'd imagine your problem stems from copy/pasting code instead of understanding it. Best I can assume is that you've overriding say() somewhere with different arguments.

You could post the whole thing, but I don't recommend it, you're better off searching your source for things like "say" and "as mob".
By copy I mean, looking. I'm using the physical book.

All these work and are the only ones that use "as mob" input type:

        wink(M as mob)
view() << "[usr] winks at [M]."

whisper(M as mob, msg as text)
M << "[usr] whispers to you, [msg]"
usr << "[usr] whispers to [M], [msg]"

killer_gaze(M as mob)
del M

poke(M as mob in view(1))
view() << "[usr] pokes [M]!"

radio_say(M as mob in world, msg as text)
M << "[usr] radios to [M], '[msg]'"


I have only one say verb. And the only verb that I overrode was a "wink" for the master_key.
Notice that "_say" at the end of "radio_say"? I bet you're actually using that verb and not your say verb.
Nadrew is on point. Changing the verb name to "radio" would probably eliminate the issue. Probably the parser is trying to let you use either verb that matches (say or radio-say), and once it gets the mob as feedback it gets confused and thinks it has a good enough match for the say verb.
Noticed the "usage" of the 'say' verb was first, what it should be and second, the usage of the radio_say verb.

Fixed it by changing the name of the radio verb.

Thing is, why did that happen? More ways to override verbs now?

EDIT: Thanks Nadrew and Lummox JR!
The parser was confused. When it received "say" as a command, it saw two matches: say and radio-say. The former takes only text, the latter a mob and text. That's why you saw a usage hint of "text"|mob, because it was trying to match either one. Only problem is, when you gave it a mob it found that acceptable as a match for say instead of realizing it should have gone with radio-say.
You just confused the parser, you probably actually used radio-say and didn't notice, the parser probably completed it to that when you entered 'say' alone because it assumed you were after something else.

Verb-completion in the input controls assumes a lot of things, relying on it isn't always a good idea, but if you plan to do so you need to name your verbs accordingly.

There's nothing wrong with naming things similarly though, as long as said things aren't being exposed directly to the client, for instance if you had interface elements calling verbs you could name them anything you want, as long as the names are valid. Since you wouldn't be relying on the client to input the correct command.

In general, it's best to name things in a way that tells you what they are and doesn't cause conflicts.
I think the parser truly didn't know which verb to use, because of the "text"|mob hint. He wouldn't have seen that hint without the two verbs being in play.
I've seen the input parser do some crazy nonsense over the years, sometimes I swear it has a mind of its own.

I bet that's why you've always had trouble porting it properly to the webclient, you're missing the spark of Danvinity to give it sentience.
Thanks, LummoxJR that sounds right. A nice reminder of how things can change on run-time.



Nadrew, "verb-completion", you mean on the command line?

I tried both verbs and all of them, by clicking on them. Radio_say was working just fine. Say was not.

I'll insert the (bad)code below.

#define MASTER_KEY "2DExtremeProductions"


var//global variables
weather = "Looks like another beautiful day!"



world
fps = 15// 15 frames per second

icon_size = 32// 32x32 icon size by default

view = 6// show up to 6 tiles outward from center (13x13 view)


// Atomic Objects from Lowest to Highest Drawing Layer = area, turf, obj, mob


area
luminosity = 0



turf
floor
icon = 'floor.dmi'

wall
icon = 'wall.dmi'
density = 1
opacity = 1



obj
var
value

lamp
value = 1

torch
value = 50

scroll
value = 100

verb
get()
set src in usr.loc
loc = usr

drop()
set src in usr // This is the default
loc = usr.loc

lamp
icon = 'lamp.dmi'
luminosity = 4
verb
Break()
set src in view(1)
set name = "break"
luminosity = 0

torch
icon = 'torch.dmi'
luminosity = 3
get() // Overriding the verb 'get()' to an Extended range
set src in oview()
loc = usr
verb
extinguish()
set src in view(1)
luminosity = 0
pray()
set src = view(1)// This makes it implicit...no clue how that works...no difference.
luminosity = 3
summon()
set src in oview()
loc = usr

scroll
icon = 'scroll.dmi'
verb
write(msg as message)
set src in view(0)
desc = msg
read()
set src in view(1)
usr << desc

disguise// fishy wear and remove verbs
icon = 'disguise.dmi'
var
old_icon
verb
wear()
set src in view(1)
old_icon = usr.icon
usr.icon = icon
remove()
set src in view()
usr.icon = old_icon

mirror_scroll
icon = 'mirror_scroll.dmi'
verb
cast()
set src in view(1)
var/usr_icon = usr.icon
usr.icon = icon
icon = usr_icon



mob
DM
key = MASTER_KEY

Login()
world << "[usr] the DM enters the world!"
loc = locate(2,2,1)
//..() seems to not be needed here

wink(M as mob)//overriden verb special to the MASTER_KEY
set desc = "This kills people!"
..()
del M

verb//verbs specific to the MASTER_KEY

set_density(d = 1 as num)//default argument example
set name = "set density"
density = d

set_weather(msg as text)
weather = msg

set_value(obj/O as obj in view(), v as num)
O.value = v

see_value(obj/O)//same as above, shorter because it is the default. Long version is better to understand.
usr << "The [O] has a value of [O.value]."

Login()
world << "[usr] enters the world!"
loc = locate(2,2,1)
..()

//step_size = 8 // Move 8 pixels per tick when walking, can apply to "mob" and "obj".

icon = 'player.dmi'

verb
say(msg as text)
view() << "[usr] says, [msg]"

smile()
world << "[usr] grins."

giggle()
world << "[usr] giggles."

cry()
world << "[usr] cries \his heart out."

wsay(msg as text)
world << "[usr] OOC: [msg]"

intangible()
density = 0 //now we can walk thru walls!

make_potato()
set src in view()
set desc = "Mmm. Where's the sour cream?" // "desc" alone does not seem to work
name = "potato"
icon = 'potato.dmi'

set_name(N as text)
set desc = "(\"new name\") Change your name." // backslashes in front of the " is called escaping
name = N

set_icon(i as icon|anything in view())
set name = "set icon"
icon = i

play_sound(snd as sound)
view() << snd

wink(M as mob)// private-personal verb
view() << "[usr] winks at [M]."

/*wink()
set src in view()// makes it a public verb that every player in view of it can use
view() << "[usr] winks at [src]."*/


whisper(M as mob, msg as text)
M << "[usr] whispers to you, [msg]"
usr << "[usr] whispers to [M], [msg]" //view(-1) does not work?

/*wink() // this snippet overrides the verb so that it can do something different on a case by case basis
..()
usr << "[src] whispers, abracadabra!"*/


killer_gaze(M as mob)
del M

poke(M as mob in view(1))// should be 'oview' I think
view() << "[usr] pokes [M]!"

radio_say(M as mob in world, msg as text)
M << "[usr] radios to [M], '[msg]'"

look_up()//checks the global variable "weather"
usr << weather

call_me(name as text)
src.name = name