本文整理汇总了C++中aurora::nwscript::FunctionContext::getTriggerer方法的典型用法代码示例。如果您正苦于以下问题:C++ FunctionContext::getTriggerer方法的具体用法?C++ FunctionContext::getTriggerer怎么用?C++ FunctionContext::getTriggerer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurora::nwscript::FunctionContext
的用法示例。
在下文中一共展示了FunctionContext::getTriggerer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: actionDoCommand
void Functions::actionDoCommand(Aurora::NWScript::FunctionContext &ctx) {
Common::UString script = ctx.getScriptName();
if (script.empty())
throw Common::Exception("Functions::actionDoCommand(): Script needed");
const Aurora::NWScript::ScriptState &state = ctx.getParams()[0].getScriptState();
_game->getModule().delayScript(script, state, ctx.getCaller(), ctx.getTriggerer(), 0);
}
示例2: beginConversation
void Functions::beginConversation(Aurora::NWScript::FunctionContext &ctx) {
ctx.getReturn() = 0;
// Get the script object parameters
Aurora::NWScript::Object *obj1 = ctx.getCaller();
Aurora::NWScript::Object *obj2 = getParamObject(ctx, 1);
if (!obj2)
obj2 = ctx.getTriggerer();
if (!obj2)
obj2 = _game->getModule().getPC();
// Try to convert them to an NWN Creature and Object
NWN::Creature *pc = NWN::ObjectContainer::toPC(obj2);
NWN::Object *object = NWN::ObjectContainer::toObject(obj1);
// Try the other way round, if necessary
if (!pc || !object) {
pc = NWN::ObjectContainer::toPC(obj1);
object = NWN::ObjectContainer::toObject(obj2);
}
// Fail
if (!pc || !object)
return;
if (object->getPCSpeaker()) {
if (object->getPCSpeaker() != pc) {
Creature *otherPC = NWN::ObjectContainer::toPC(object->getPCSpeaker());
warning("Functions::beginConversation(): "
"Object \"%s\" already in conversation with PC \"%s\"",
object->getTag().c_str(), otherPC ? otherPC->getName().c_str() : "");
return;
}
}
Common::UString conversation = ctx.getParams()[0].getString();
if (conversation.empty())
conversation = object->getConversation();
ctx.getReturn() = _game->getModule().startConversation(conversation, *pc, *object);
}
示例3: getExitingObject
void Functions::getExitingObject(Aurora::NWScript::FunctionContext &ctx) {
// TODO: This should return the *last* exited object, i.e. it should remember past triggerers.
ctx.getReturn() = ctx.getTriggerer();
}
示例4: getClickingObject
void Functions::getClickingObject(Aurora::NWScript::FunctionContext &ctx) {
ctx.getReturn() = ctx.getTriggerer();
}