-1
我正在使用C++和Lua进行MUD,我正在尝试为emotes创建一组函数。添加Lua函数语法
我已经写了:
add_functions
{
['subject-bind-search say'] = 'none',
['player say string-type'] = function(player, msg)
player_text(player, 'You say "' .. msg.string .. '".')
witness_text(player, M('indefinite', player) .. ' says "' .. msg.string .. '".')
end,
['subject-bind-search say-to'] = 'none',
['player say-to string-type thing'] = function(player, msg, thing)
player_text(player, 'You say "' .. msg.string .. '" to ' .. M('definite',thing) .. '.')
witness_text(player, M('indefinite', player) .. ' says "' .. msg.string .. '" to ' .. M('indefinite', thing) .. '.')
end,
['player dance'] = function(player)
player_text(player, 'You burst into dance.')
witness_text(player, M('indefinite', player)..' bursts into dance.')
add_atoms{dance='verb'}
end
}
当我和其他人用Telnet连接到服务器,我可以键入:
说 “HI” - >所有的人都期望看到喜。
我可以输入:
说 “嗨” playerBob - > playerBob看到喜就好
但是,如果我简单地键入:dance
我得到一个错误信息当它无法识别任何动词时发送。 我假设add_atoms{ dance = 'verb' }
固定的,但...
有没有人碰巧知道为什么我无法跳舞发生?
如果你已经知道了你的问题,你可以将自己的答案标记为正确答案。 – Kyle 2012-04-22 20:36:26
是的。 这让我等到明天才会接受我的评价。但我想。 – 2012-04-23 04:27:13