ID:148345
 
Well I was messing around with some coding and decided to make a verb where you can make 1 technique. I get this error durring play(runtime error):

runtime error: type mismatch
proc name: Create Technique (/mob/verb/Create_Technique)
source file: knight.dm,623
usr: Slayer (/mob/player/knight/full)
src: Slayer (/mob/player/knight/full)
call stack:
Slayer (/mob/player/knight/full): Create Technique()

everything works until you type how much power you want to put in. Heres my coding:

mob/var
owner
techname
powerinput
techcreated = 0

mob/verb
Create_Technique()
if(usr.techcreated == 0)
var/prompt_title = "New Technique"
var/help_text = "First step is to name your new technique."
var/default_value = ""
usr.techname = input(usr, help_text, prompt_title, default_value) as null|text
owner = usr.key
var/prompt_title2 = "New Technique"
var/help_text2 = "How much power will you implement in [usr.techname]."
var/default_value2 = usr.maxstr
usr.powerinput = input(usr, help_text2, prompt_title2, default_value2) as null|text
if(powerinput > usr.maxstr)
alert("You can't put more power into it then you have.")
powerinput = usr.maxstr
Creating_Technique()
else
alert("You can only create one.")

mob/proc
Creating_Technique()
alert("You have created the [usr.techname].")
src.verbs += /mob/technique/verb/newtechnique
usr.techcreated = 1


I have the new technique verb and i made the name be "[usr.techname]" and that all(the new technique verb) seems to work but whats the problem ^up^ there.
Notice that it's null|text. maxstr, I assume, is a number. Do the math.
In response to Garthor
EEEERRRRRRRRRRR!!!!! Thanks! I can't believe I didn't catch that. Oh well. Now is there anyway to rename a verb like:
mob/techniques/verb/newtech
name = "[usr.techname]"


Well I tried that and it still says newtech. So is there another way to rename it to [usr.techname].
In response to Cloudiroth
No, but it is possible to use objs for this purpose...
obj
technique
proc
Tech()
//Whatever
Click()
Tech()

Then, place them in a statpanel, and use them like verbs.
In response to Garthor
sorry but you lost me there.



------------------------------------------------------


and maybe an alternative: can you make it where in the name it says [usr.techname]?