ID:264864
 
Code:
mob
{
verb
{
Say(msg as text)
{
set hidden = 1;
var
{
default = "view(usr)";
format = usr.runFormat(default);
}
format << "[usr] says: [msg]";
}
}
function
{
runFormat(var/test)
{
if(winget(src, "mainwindow.sayb", "is-checked")=="true")
{
test = "view(usr)";
}else if(winget(src, "mainwindow.worldb", "is-checked")=="true"){
test = "world";
}
return test;
}
}
}


Problem description:

I'm not even sure it's possible to do, but as you can see I have made a proc (Yes I am well aware it says function, I defined it as I prefer to write function) called runFormat. Now when I put usr << "[test]"; just before the return test; part, it outputs fine, so I am assuming in the Say verb there is something wrong with the format << bit.
In your case 'format' is string, it cannot output anything into string. You have to return list:
mob
{
verb
{
Say(msg as text)
{
set hidden = 1;
var
{
default = "view(usr)";
format = usr.runFormat(default);
}
format << "[usr] says: [msg]";
}
}
function
{
runFormat(var/test)
{
if(winget(src, "mainwindow.sayb", "is-checked")=="true")
{
return view(usr);
}else if(winget(src, "mainwindow.worldb", "is-checked")=="true"){
return world;
}
return test;
}
}
}