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.
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: