ID:263376
 
Code:
obj
icon='weapons.dmi'
Weapons
verb
Grab(var/obj/O)
set src in oview(1)
usr.contents.Add(O)

projectile
verb
Fire()
set src in usr.contents
spawn new src.projectile
var
projectile

rocketLauncher
icon_state="rocketlauncher"
projectile=new /obj/Bullets/rocketLauncher


Problem description:
e.e Only programming once a month is not a very good practice with BYOND <<

runtime error: Cannot create objects of type /obj/Bullets/rocketLauncher.
proc name: Fire (/obj/Weapons/projectile/verb/Fire)
usr: Dead_Demon (/mob/Player)
src: the rocketLauncher (/obj/Weapons/projectile/rocketLauncher)
call stack:
the rocketLauncher
(/obj/Weapons/projectile/rocketLauncher): Fire()


Can you run it in debug mode so we can see what line?
In response to Revojake
Sure.
Heres the error in Debug mode -

runtime error: Cannot create objects of type /obj/Bullets/rocketLauncher.
proc name: Fire (/obj/Weapons/projectile/verb/Fire)
source file: weapons.dm,13
usr: Dead_Demon (/mob/Player)
src: the rocketLauncher (/obj/Weapons/projectile/rocketLauncher)
call stack:
the rocketLauncher (/obj/Weapons/projectile/rocketLauncher): Fire()


obj
icon='weapons.dmi'
Weapons
verb
Grab(var/obj/O)
set src in oview(1)
usr.contents.Add(O)

projectile
verb
Fire()
set src in usr.contents
Error lies here spawn new src.projectile
var
projectile

rocketLauncher
icon_state="rocketlauncher"
projectile=new /obj/Bullets/rocketLauncher
handGun
icon_state="handgun"

melee
axe
goldenAxe
icon_state="goldaxe"


Bullets
rocketLauncher
icon_state="rocket"
handGun
icon_state="singlebullet"
Bump <<;
I think I am not using the spawn correctly...any ideas?
In response to Dead_Demon
Uhh...spawn makes something wait to happen without stopping the rest of the proc in the process... You are definately not using spawn correctly. If I weren't so tired I'd fix that up for you...
In response to Pyro_dragons
Should he use New?
Remove that spawn, it's pointless. And remove the "new" from "projectile=new /obj/Bullets/rocketLauncher"

You want that variable to contain the type path to create, not the object itself.
In response to DarkCampainger
Thanks, I got it all fixed now :3