@Polk said in What is a MUSH?:
@Pavel I don’t think I agree with that. The most natural way softcode is useful is to
[run code()]
in a desc.But we’ll see. All of this is last on my list of features anyway.
That is what I do with my Evennia game core, I process descs through the funcparser. This allows me to pull in data and do formatting just like you would do with softcode on MUSH, only without the overhead and security issues.
Ex:
def get_desc(self, looker=None):
desc = self.db.desc or ''
if not desc:
return ''
parser = FuncParser(dict(FUNCPARSER_CALLABLES, **LOCAL_FUNCPARSER_CALLABLES))
parsed_string = parser.parse(desc,
raise_errors=False,
escape=False,
strip=False,
return_str=True
)
return parsed_string