ID:1934342
 
(See the best response by DarkCampainger.)
I've written a simple and working projectile proc that I use for my weapons. I then created an Attack verb for each weapon that only calls the projectile proc (called launch). Each weapon passes its own unique arguments to launch and through this I didn't have to write projectile code for each weapon independently.

Note, all these functions exist under obj/weapon

I then tried to make a variable verb for players which calls on a specific attack verb. They can set what weapon they call based on their inventory.
Yet, when I run this verb I get this run-time error:

runtime error: Cannot execute null.launch().
proc name: attack (/obj/weapon/longSword/verb/attack)
source file: Weapon.dm,70
usr: Fuoco (/mob/player)
src: null
call stack:
attack()
Fuoco (/mob/player): Skill(1)

Below is the simple weapon code for just the longsword and the verb which calls the longsword attack.

obj/weapon/longSword
icon_state = "long"
dice = 1
verb
attack()
launch(1,0,0, "long")
mob/player
Skill(n as num)
var m
switch(n)
if(1) m = KEY1
if(2) m = KEY2
if(3) m = KEY3
if(4) m = KEY4
call(text2path("/obj/weapon/[m]/verb/attack"))()


I can't imagine why launch wouldn't receive it's arguments from longSword's attack.
Best response
You aren't passing a source object to call(). It's calling your verb as if it were a global proc with a null src, so when you go to access 'src.launch()' you get an error.

You need to locate() the actual instance of the weapon in the player's inventory if you want to call its verbs/procs.

Also, once you have a reference to the weapon, you don't really need to use call() at all:
obj/weapon
verb
// Define the attack() verb on the /obj/weapon parent type so it can
// be accessed from variables type-cast as just generic /obj/weapon's
attack()

obj/weapon/longSword
icon_state = "long"
dice = 1
attack()
// The longSword now overrides the parent's attack() verb (which is why it isn't under a /verb node)
launch(1,0,0, "long")

mob/player
Skill(n as num)
var m
switch(n)
if(1) m = KEY1
if(2) m = KEY2
if(3) m = KEY3
if(4) m = KEY4
var/obj/weapon/w = locate(text2path("/obj/weapon/[m]")) in src.contents
if(w)
w.attack()