ID:2101075
 
Code:
mob/stat()
statpanel("Skills")
// stat(src.skills)
for(var/obj/skillcard/X in contents)
stat(X)

sleep(-1)
sleep(2)
..()

obj/skillcard
Attack
icon='cards.dmi'
icon_state="attack"
name="Attack"
Click()
var/mob/M = usr
M.Attack()
Shikai
icon='cards.dmi'
icon_state="shikai"
name="Shikai"
Click()

mob/proc/Learned()
var/obj/skillcard/Attack/A1 = new/obj/skillcard/Attack
A1.loc = usr //this work ok

if(src.race_identity == "Human")
if(src.level==5)
src.contents += /obj/skillcard/Shikai// where the problem lies
//usr.Learnshikai=1
src<<"U learned ?"


Problem description:
how do i make it that i go in skill tab, im not using gribs(columns)
just normal info bar wanna know how to make it that you learn the shikai but with the icon beside word. i wanted to do it like how you have icon of stuff in inventory
mob
Stat()
stat("<b>------------")
statpanel("Inventory")
stat("<b>Inventory - ")
stat("<b>------------")
if(contents.len)
stat(contents)

else
stat("")
stat("<b>You have nothing in your inventory")
stat("<b>------------")


All you do is call a contents list and display icons in it if they are. If the list is empty the text will show up

Zanoroku wrote:
mob/proc/Learned()
var/obj/skillcard/Attack/A1 = new/obj/skillcard/Attack
A1.loc = usr //this work ok

if(src.race_identity == "Human")
if(src.level==5)
src.contents += /obj/skillcard/Shikai// where the problem lies
//usr.Learnshikai=1
src<<"U learned ?"

Two problems.

First, usr has no business in this proc, because it's a proc; that should be src, not usr.

Second, you can't add a type path to src.contents; the contents list only takes actual objects, not their types. What you want there instead is:

new/obj/skillcard/Shikai(src)

That will create the skill card and add it to src's contents for you.