GameMode是定义在游戏中的状态,即可以定义在游戏过程中会发生什么变化,或者造成什么影响。在脚本中以begin GameMode开头,以end结尾。GameMode脚本的运行次数可以定义一个浮点数fQuestDelayTime,然后在GameMode中设定该数的值,单位为秒,它即定义了GameMode脚本每多长时间运行一次,例如在GameMode脚本中给出 set fQuestDelayTime to 60,则表示每60秒GameMode脚本运行一次。若不定义fQuestDelayTime,则默认GameMode脚本每帧运行一次。
再次,对于fQuestDelayTime,Wiki上的原句是“fQuestDelayTime is a special float variable used by quest scripts to determine how often the script should run.”“fQuestDelayTime 是一个特殊的浮点变量,用于Quest脚本中以决定脚本多久运行一次。”也就是说,fQuestDelayTime是用在(而且貌似也是只能用在)Quest脚本的,而用在其他脚本效果未知(如Object脚本中貌似是没用的,貌似而已,当初用过,但是脚本不理想,很快就删掉了,于是也没有确定在Object脚本中是否有用)。
MessageBox "The Amulet of Kings slips off as you try to fasten it around your neck."
set tempRef to GetContainer
tempRef.unequipitem AmuletofKings 1
end
即是用了OnEquip区块,针对的角色是玩家角色(player),在玩家佩戴帝王项链时,会出现信息:“The Amulet of Kings slips off as you try to fasten it around your neck.”“当你试图将帝王项链戴在脖子上时,项链滑了下来。”同时,强制卸下该物品(unequipitem命令)。