mob/Admin
verb
Give_Jutsu(mob/M in world)
var/list/JutsuList
var/obj/Z = new/obj/SkillCards
Z+=JutsuList
var/A = input("Select a jutsu to give to [M]?") in JutsuList + list("Cancel")
usr<<"You gave [M], [A]"
M.contents+=A
Problem description:
the code works when compiled but when used in game on anything even mobs this is the responce.
runtime error: type mismatch: SkillCards (/obj/SkillCards) += null
proc name: Give Jutsu (/mob/Admin/verb/Give_Jutsu)
source file: Admin.dm,21
usr: Uchiha, Jbreezy (/mob/player)
src: Uchiha, Jbreezy (/mob/player)
call stack:
Uchiha, Jbreezy (/mob/player): Give Jutsu(Uchiha, Jbreezy (/mob/player))
You need to initialize your list, and you want to add the object to the list, not add the list to the object.
If you have a lot of skills you want to list, the typesof() process may be useful to you.
Further, you can give an actual "cancel" button to your input by using input() as null|anything in JutsuList. If the user then presses the cancel button, the input will return null.