ID:168958
 
var/cardpick is an object.
Then I do:
var/cardname = "[cardpick]"
This will make cardname "/obj/Pieces/(something chosen at random by cardpick)"
How can I remove the "/obj/Pieces/" from cardname?

(I need to know, because I can't do 'usr << "[cardpick.name] (Rare)"')
copytext() should do the trick in your situation.

var/cardname = "[cardpick]"
cardname = copytext(cardname, 12)


copytext() has three arguments, the third one being default as the length of the text, so you don't need to do that unless you want to cut out the back part of the text. That should get rid of the "/obj/Pieces/", since the text is 12 characters long.

~~> Dragon Lord
In response to Unknown Person
THANKS!! I've been trying for over an hour, but I couldn't find any solution....thanks!
In response to Unknown Person
Hmmm...can you also tell me how to search cardname for _ and replace it with a space? I can search for it, but I don't know how to replace it.
In response to VDZ
I d think you can. But the name vars of atoms all replace _ with a space. HOpe that helps you