ID:2236878
 
(See the best response by Ter13.)
Code:
mob
verb
Cast()
set src in usr
set name=src.name


Problem description: Ok, so, this may just be me, and as usual I only posted here because I have literally hit the cap of what I know to fix this.

The issue here is I really don't want to have to write a bunch of specific Verbs for every single combat-based action, now I know I could just code each spell name into the verb as an if clause, but that's lazy and long, all I want is to know how to set the name of a verb to that of, say an obj somewhere in the usr of that verb

The code provided above is literally it, that is where I run into a snag, it comes up with bad text, no matter what little 'tricks' I pull out of my bag, so once again, I need some help

also writing it as "[src.name]" comes up worse, and trying to define another variable and doing it that way is no help.


I don't really understand what you're trying to do. Nor why you wrote your text inside of the <b>...</b> tags instead of outside where it would be readable. I suggest editing your post to fix the bold text.
if i had to take a guess maybe something like
set name = typesof(/obj/skill)


maybe that would work idk just throwing out something that seems like it'd be close to what your asking
Best response
Interestingly, verbs can be initialized:

new/mob/verb/herpderp(src,"herpyderp")


You can't have dynamic settings though. Settings must be static at compile time. But since they are able to be initialized, they do carry some properties you can change at runtime. The other thing to note is that verbs have no real place in a hierarchy. They only reference src and usr. So where you define a verb doesn't really matter if you are adding the verbs to objects where you didn't define them.

It sounds to me, though, that you are using verbs wrong in the first place, because verb-based input is inherently inflexible, and you should be using a more flexible option in the first place.

And for a better example, this is what I think you are trying to get at:

obj/skill
proc
Use()

verbuse() //this is defined as a proc.
set category = "combat"
set src in usr
Use()

New(atom/loc)
new/obj/skill/proc/verbuse(src,src.name)
..()


This way, you can just define subtypes of /obj/skill with different names and each one will automatically have its own named verb on initialization.

It really doesn't matter, though, because it's really just forcing the body of the verb into the Use() proc anyway.
In response to Ter13
You can shorten it:
// new verb_path(Destination, OptionalNewName, OptionalNewDesc)
new/mob/verb/herpderp(src, "herpyderp")
well, I thought it was working with the mob verb path version, but it still has to be able to call the specific object, which it doesn't.

On the other hand, trying to run it as an obj verb or proc seems to cease all of its functionality, its not appearing in the verbs list, and it may not be even registering the object to have its name.

fixed the issue of it registering its name, but it still wasn't appearing...

This however seems to be more problematic between set src in usr, and a specific list I wanted the objects to go to, instead of just contents.

slight inconvenience, but I can make this work anyway.

thanks all for the help