ID:267722
 
In my current project, i made it so that what you typed into the pink box was displayed to the world. It worked, but i wanted to make it so i could type in tings to activate verbs, like in chatters. I made a proc that parsed what was typed in, and i tried to make findtext activate a proc, but it didn't seem to work. I was wodnering if someone could lend me a hand in figuring out what i did wrong, or explain how it works.
Heres my parse proc and what i tried to do for activating a proc. It compiles fine, but i get runtime errors.
proc
parse(command_given as text,mob/M as mob)
if(hascall(M,(command_given)))
return ..()
if(findtext(command_given,"/broadcast"))
M.broadcast()
else
world<<"<[M] says:>[html_encode(command_given)]"
mob/proc
broadcast(M as message)
world<<"[M]"

and here are the runtime errors.
runtime error: Cannot execute null.parse().
proc name: parse (/proc/parse)
source file: Login.dm,12
usr: Magnus VI (/mob)
src: null
call stack:
parse("broadcast", Magnus VI (/mob))
Magnus VI (/client): Command("broadcast")

those errors come from typing /broadcast in the pink box.
thanks in advance
-Magnus
I probably shouldn't do this, but its on teh second page so.... Bump.
I'm pretty sure chatters uses something like:



mob
verb
DoTheCoolThingy()
name = "/CoolTHINGY"
//whatever

mob
verb
SayVerbThng()
client.command_prompt* = "> "
//ergh, I don't remember....I used to......

<-Airjoe->

* possibly command_text

[edit]
heres what I found in the ref.

client
command_text = "say "

verb/say(T as text)
world << "[usr] says, '[T]'"

Could be changed to:
client
command_text = "> "

verb/say(T as text)
name = ">"
world << "[usr] says, '[T]'"
[/edit]
runtime error: Cannot execute null.parse().
proc name: parse (/proc/parse)
source file: Login.dm,12
usr: Magnus VI (/mob)
src: null
call stack:
parse("broadcast", Magnus VI (/mob))
Magnus VI (/client): Command("broadcast")

The problem(or so i believe) is how you are calling the parse proc, can you please show me what you have for calling it? because thats the problem.