ID:263456
 
Code:
mob/Member/verb/Custom()
set name = "[usr.CustomName]"


Problem description:
I get:
error:= : bad text
How can i make it so i can give the verb a name according to a var a person has?
So that they could have a custom move, and it would be a name they chose, ect?
You might not be able to, but maybe you can. Normally when you can't do something like that you get a compile error that says something like "constant expected" or something like that, saying a variable isnt accepted.

But the only thing I can think of that might be a problem is the fact that its in "s.

Try:
set name = usr.CustomName


It might be expected an unchanging text value, and if the above gives an error saying that, then you probably cant do it. I know from experience that (at least in older versions) some things don't accept variables as thier definition, and want a constant value, like "Thing" or the number 5.
In response to Polantaris
when i use that it says the same exact thing about bad text
In response to Chibi-Gohan0
make sure usr.CustomName is actually filled with something.

verbs dont accept names of "", I believe.
In response to Polantaris
what it is:
mob/var/CustomName = "Customize Move"
In response to Chibi-Gohan0
Hmm...the only thing I can thing of now is removing the space.

Try making it "Customize". Maybe the space is causing problems.
In response to Polantaris
same error
In response to Chibi-Gohan0
Well, I tried. Sorry I can't think of anything else at the moment that would be the problem, unless of course you can't make it a variable name.

~Polantaris
In response to Polantaris
You can't change the name of a verb at runtime.
In response to Xx Dark Wizard xX
I thought as much. Thanks for confirming.
Verb names must be constant and are set at compile time. There are methods of getting somewhat around this, though. For example, instead of using verbs, you might create an /obj, set its name to something of your liking, add it to some list, and then use a statpanel to display the /obj(s). For example:

obj/verbType    // This type will make up our pseudo-verbs

Say/Click() // Clicking these is like clicking a verb
var/msg = input("What would you like to say?",name) as null|text
if(ckey(msg))
world << "<b>[usr.key]:</b> [html_encode(msg)]"

Rename_Verb/Click()
var/obj/verbType/V = input("Select a verb:",
name) as null|anything in usr.custVerbs

if(V)
var/newName = input("What would you like to rename it?",
"Rename verb \"[V.name]\"") as null|text

if(V && ckey(newName)) // Double check that V still exists
V.name = newName

mob
var/list/custVerbs // This list will contain pseudo-verbs

Login() // Create custVerbs list for client-connected mobs
..()
custVerbs = list(new/obj/verbType/Say, new/obj/verbType/Rename_Verb)

Logout() // Clean up after client leaves
for(var/obj/verbType/V in custVerbs) // Clean up objs
del(V)
del(src) // If we don't need it anymore...

Stat() // Display custVerbs in a statpanel, "Verbs"
if(statpanel("Verbs"))
stat(custVerbs)


Hiead
In response to Hiead
Hiead wrote:
Verb names must be constant and are set at compile time.

No.

mob/verb/rename_verb(t as text)
set desc="set the name of this verb to something else"
if(t)
verbs-=/mob/verb/rename_verb //only works once!
verbs+=new/mob/verb/rename_verb(src,t)