本文整理汇总了C++中IScriptSystem类的典型用法代码示例。如果您正苦于以下问题:C++ IScriptSystem类的具体用法?C++ IScriptSystem怎么用?C++ IScriptSystem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IScriptSystem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Register_IPipelineSystem
//-------------------------------------------------------------------------------------------------------
static void Register_IPipelineSystem( IScriptSystem& sys )
{
{
ClassRegister sc;
sc.ClassType( &IPipelineSystem::RTTI() );
sys.RegisterClass(sc);
}
ClassRegister sc;
sc.ClassType( &PipelineProperty::RTTI() );
sc.ClassConstant( PipelineProperty::PT_LIGHTING_AMBIENT, "PT_LIGHTING_AMBIENT" );
sc.ClassConstant( PipelineProperty::PT_LIGHTING_DIRECTION, "PT_LIGHTING_DIRECTION" );
sc.ClassConstant( PipelineProperty::PT_LIGHTING_POINT, "PT_LIGHTING_POINT" );
sc.ClassConstant( PipelineProperty::PT_LIGHTING_SPOT, "PT_LIGHTING_SPOT" );
sc.ClassConstant( PipelineProperty::PT_UNIVERSAL_DEPTH, "PT_UNIVERSAL_DEPTH" );
sc.ClassConstant( PipelineProperty::PT_UNIVERSAL_NORMAL, "PT_UNIVERSAL_NORMAL" );
sc.ClassConstant( PipelineProperty::PT_UNIVERSAL_DECAL, "PT_UNIVERSAL_DECAL" );
sc.ClassConstant( PipelineProperty::PT_UNIVERSAL_MULTI_RENDER_TARGET, "PT_UNIVERSAL_MULTI_RENDER_TARGET" );
sc.ClassConstant( PipelineProperty::PT_UNIVERSAL_POST_EFFECT, "PT_UNIVERSAL_POST_EFFECT" );
sc.ClassConstant( PipelineProperty::LT_AMBIENT, "LT_AMBIENT" );
sc.ClassConstant( PipelineProperty::LT_DIRECTIONAL, "LT_DIRECTIONAL" );
sc.ClassConstant( PipelineProperty::LT_POINT, "LT_POINT" );
sc.ClassConstant( PipelineProperty::LT_SPOT, "LT_SPOT" );
sys.RegisterClass(sc);
}
示例2: CRY_ASSERT
bool CCustomReactionFunctions::CallCustomExecutionFunction(ScriptTablePtr hitDeathReactionsTable, CActor& actor, const SReactionParams& reactionParams, const HitInfo& hitInfo) const
{
CRY_ASSERT(!reactionParams.sCustomExecutionFunc.empty());
bool bSuccess = false;
// try LUA first. This is so overriding C++ functions can be easily done on LUA, without the need to recompile or to change
// the name of the LUA methods in both reactionParams and script code
HSCRIPTFUNCTION executionFunc = NULL;
if (hitDeathReactionsTable->GetValue(reactionParams.sCustomExecutionFunc.c_str(), executionFunc))
{
IScriptSystem* pScriptSystem = hitDeathReactionsTable->GetScriptSystem();
bSuccess = Script::Call(pScriptSystem, executionFunc, hitDeathReactionsTable, reactionParams.reactionScriptTable);
pScriptSystem->ReleaseFunc(executionFunc);
}
// Try C++ now
if (!bSuccess)
{
// C++ custom execution
ExecutionFncContainer::const_iterator itFind = m_executionFunctors.find(reactionParams.sCustomExecutionFunc);
if (itFind != m_executionFunctors.end())
{
// [*DavidR | 21/Oct/2010] C++ custom functions have the advantage of receiving a reference to the hitinfo, LUA methods can get the "lastHit" so we
// avoid the expensive construction of the hitInfo table
itFind->second(actor, reactionParams, hitInfo);
bSuccess = true;
}
else
CHitDeathReactionsSystem::Warning("Couldn't find custom execution function (%s)", reactionParams.sCustomExecutionFunc.c_str());
}
return bSuccess;
}
示例3: p
bool CScriptRMI::SerializeScript( TSerialize ser, IEntity * pEntity )
{
SSerializeFunctionParams p( ser, pEntity );
ScriptHandle hdl( &p );
IScriptTable * pTable = pEntity->GetScriptTable();
if (pTable)
{
SmartScriptTable serTable;
SmartScriptTable synchedTable;
pTable->GetValue( "synched", synchedTable );
if (synchedTable.GetPtr())
{
synchedTable->GetValue( HIDDEN_FIELD, serTable );
if (serTable.GetPtr())
{
IScriptSystem * pScriptSystem = pTable->GetScriptSystem();
pScriptSystem->BeginCall( serTable.GetPtr(), SERIALIZE_FUNCTION );
pScriptSystem->PushFuncParam( serTable );
pScriptSystem->PushFuncParam( hdl );
return pScriptSystem->EndCall();
}
}
}
return true;
}
示例4: Result
//-------------------------------------------------------------------------------------------------------
void FunctionRegister::Result( const IScriptSystem& sys, const Rtti* rtti )
{
ASSERT(NULL==m_pResult);
m_pResult = rtti;
m_pResultGetter = sys.GetScriptResultValueFunction( rtti );
m_pResultPusher = sys.GetScriptResultPushFunction( rtti );
_CaculateID();
}
示例5: Arguments
//-------------------------------------------------------------------------------------------------------
void FunctionRegister::Arguments( const IScriptSystem& sys, const Rtti* rtti1, const Rtti* rtti2, const Rtti* rtti3 )
{
ASSERT( 0 == m_ArgumentRttis.size() );
m_ArgumentRttis.push_back(rtti1);
m_ArgumentRttis.push_back(rtti2);
m_ArgumentRttis.push_back(rtti3);
m_ArgumentGetter.push_back( sys.GetScriptArgumentFunction( rtti1 ) );
m_ArgumentGetter.push_back( sys.GetScriptArgumentFunction( rtti2 ) );
m_ArgumentGetter.push_back( sys.GetScriptArgumentFunction( rtti3 ) );
_CaculateID();
}
示例6: ClearCutSceneScriptVariables
void CCinematicInput::ClearCutSceneScriptVariables()
{
IScriptSystem* pScriptSystem = gEnv->pScriptSystem;
if (pScriptSystem)
{
pScriptSystem->SetGlobalValue("Cinematic_RumbleA", 0.0f);
pScriptSystem->SetGlobalValue("Cinematic_RumbleB", 0.0f);
pScriptSystem->SetGlobalValue("Cinematic_CameraLookUp", 0.0f);
pScriptSystem->SetGlobalValue("Cinematic_CameraLookDown", 0.0f);
pScriptSystem->SetGlobalValue("Cinematic_CameraLookLeft", 0.0f);
pScriptSystem->SetGlobalValue("Cinematic_CameraLookRight", 0.0f);
}
}
示例7: CCCPOINT
//------------------------------------------------------------------------
void CGameRulesHoldObjectiveBase::CleanUpEntity(SHoldEntityDetails *pDetails)
{
CCCPOINT(HoldObjective_CleanUpActiveCaptureEntity);
if (pDetails->m_localPlayerIsWithinRange)
{
CHUDEventDispatcher::CallEvent(SHUDEvent(eHUDEvent_OnSiteAboutToExplode));
}
OnRemoveHoldEntity(pDetails);
gEnv->pEntitySystem->RemoveEntityEventListener(pDetails->m_id, ENTITY_EVENT_ENTERAREA, this);
gEnv->pEntitySystem->RemoveEntityEventListener(pDetails->m_id, ENTITY_EVENT_LEAVEAREA, this);
if (m_spawnPOIType == eSPT_Avoid)
{
IGameRulesSpawningModule *pSpawningModule = g_pGame->GetGameRules()->GetSpawningModule();
if (pSpawningModule)
{
pSpawningModule->RemovePOI(pDetails->m_id);
}
}
IEntity *pEntity = gEnv->pEntitySystem->GetEntity(pDetails->m_id);
if (pEntity)
{
IScriptTable *pScript = pEntity->GetScriptTable();
if (pScript != NULL && pScript->GetValueType("DeactivateCapturePoint") == svtFunction)
{
IScriptSystem *pScriptSystem = gEnv->pScriptSystem;
pScriptSystem->BeginCall(pScript, "DeactivateCapturePoint");
pScriptSystem->PushFuncParam(pScript);
pScriptSystem->PushFuncParam(true);
pScriptSystem->EndCall();
}
CGameRules *pGameRules = g_pGame->GetGameRules();
EGameMode gamemode = pGameRules->GetGameMode();
if (gamemode == eGM_CrashSite)
{
Announce("Destruct", k_announceType_CS_Destruct);
}
}
pDetails->Reset();
// Fade out effect
m_effectData.alphaLerp.Set(1.0f,0.0f,0.0f);
}
示例8: GetLuaValue
ScriptAnyValue CTweakMetadataLUA::GetLuaValue(void) const {
IScriptSystem *scripts = gEnv->pScriptSystem;
//ScriptAnyValue failed("Value unrecognised");
ScriptAnyValue result;
// Fetch as a variable
if (GetLuaVarRecursive(m_sVariable.c_str(), result)) {
// Is this actually a function? If so call it
if (result.type == ANY_TFUNCTION) {
scripts->BeginCall(result.function);
scripts->EndCallAny(result);
}
}
return result;
}
示例9: Register_IResourceSystem
//-------------------------------------------------------------------------------------------------------
static void Register_IResourceSystem( IScriptSystem& sys )
{
ClassRegister sc;
sc.ClassType( &IResourceSystem::RTTI() );
sys.RegisterClass(sc);
}
示例10: if
bool CTweakMetadataLUA::ChangeValue(bool bIncrement) const {
IScriptSystem *scripts = gEnv->pScriptSystem;
if (!bIncrement && m_decrementer) {
// A decrement function has been provided
scripts->BeginCall(m_decrementer);
//m_pSystem->GetIScriptSystem()->PushFuncParam(maxAlertness); // Give it state
scripts->EndCall();
} else if (bIncrement && m_incrementer) {
// An increment function has been provided
scripts->BeginCall(m_incrementer);
//m_pSystem->GetIScriptSystem()->PushFuncParam(maxAlertness); // Give it state
scripts->EndCall();
} else {
// Simple variable - get, (in|de)crement and set
// Decide delta
double fDelta = m_fDelta;
if (!bIncrement) fDelta *= -1.0;
// Change variable based on type
ScriptAnyValue value = GetLuaValue();
ScriptAnyType type = value.type;
switch (type) {
case ANY_TNUMBER:
value.number += fDelta;
break;
case ANY_TBOOLEAN:
value.b ^= true;
break;
default:
// Type not handled
return false;
}
// Set the variable
SetLuaVarRecursive(m_sVariable.c_str(), value);
}
return true;
}
示例11: CRY_ASSERT
//------------------------------------------------------------------------
void CGameRulesKingOfTheHillObjective::OnChangedTeam( EntityId entityId, int oldTeamId, int newTeamId )
{
BaseType::OnChangedTeam(entityId, oldTeamId, newTeamId);
if ((g_pGame->GetIGameFramework()->GetClientActorId() == entityId) && newTeamId)
{
// Local player has changed teams, reset icons
int currActiveIndex = -1;
for (int i = 0; i < HOLD_OBJECTIVE_MAX_ENTITIES; ++ i)
{
SHoldEntityDetails *pDetails = &m_entities[i];
if (pDetails->m_id)
{
SKotHEntity *pKotHEntity = static_cast<SKotHEntity *>(pDetails->m_pAdditionalData);
CRY_ASSERT(pKotHEntity);
pKotHEntity->m_needsIconUpdate = true;
++currActiveIndex;
if (pDetails->m_controllingTeamId == 1 || pDetails->m_controllingTeamId == 2)
{
CRY_TODO( 23,03,2010, "HUD: OnSiteCaptured events are being sent multiple times from multiple places. /FH");
SHUDEvent siteIsCaptured(eHUDEvent_OnSiteCaptured);
siteIsCaptured.eventIntData = currActiveIndex;
siteIsCaptured.eventIntData2 = pDetails->m_controllingTeamId;
CHUDEventDispatcher::CallEvent(siteIsCaptured);
}
IEntity *pEntity = gEnv->pEntitySystem->GetEntity(pDetails->m_id);
if (pEntity)
{
IScriptTable *pScript = pEntity->GetScriptTable();
if (pScript && pScript->GetValueType("LocalPlayerChangedTeam") == svtFunction)
{
IScriptSystem *pScriptSystem = gEnv->pScriptSystem;
pScriptSystem->BeginCall(pScript, "LocalPlayerChangedTeam");
pScriptSystem->PushFuncParam(pScript);
pScriptSystem->EndCall();
}
}
}
}
}
}
示例12: OnPostInitClient
void CScriptRMI::OnPostInitClient( uint16 channelId, IEntity * pEntity )
{
SmartScriptTable server;
SmartScriptTable entity = pEntity->GetScriptTable();
if (!entity.GetPtr())
return;
if (!entity->GetValue( "Server", server ) || !server.GetPtr())
return;
IScriptSystem * pSystem = entity->GetScriptSystem();
if ((server->GetValueType( "OnPostInitClient" ) == svtFunction) &&
pSystem->BeginCall( server, "OnPostInitClient" ))
{
pSystem->PushFuncParam( entity );
pSystem->PushFuncParam( channelId );
pSystem->EndCall();
}
}
示例13: hScriptFunc
void CCheckpointSystem::OnCheckpointLoaded(SCheckpointData metaData)
{
IEntity *pCheckpoint = gEnv->pEntitySystem->GetEntity(metaData.m_checkPointId);
if(pCheckpoint)
{
//Trigger OnLoad
IScriptTable *pScript = pCheckpoint->GetScriptTable();
if (pScript)
{
HSCRIPTFUNCTION hScriptFunc(NULL);
pScript->GetValue("Event_OnLoadCheckpoint", hScriptFunc);
if (hScriptFunc) //this will trigger the flowgraph output
{
IScriptSystem *pIScriptSystem = gEnv->pScriptSystem;
Script::Call(pIScriptSystem,hScriptFunc,pScript);
pIScriptSystem->ReleaseFunc(hScriptFunc);
}
}
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:21,代码来源:CheckPointSystem.cpp
示例14: ProcessEvent
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
switch (event)
{
case eFE_Activate:
if (IsPortActive(pActInfo, INP_TRIGGER))
{
IEntity* pEntity = pActInfo->pEntity;
if (pEntity)
{
int damage = GetPortInt(pActInfo, INP_DAMAGE);
if (damage==0)
{
int damageRelative = GetPortInt( pActInfo, INP_RELATIVEDAMAGE );
if (IScriptTable* pScriptTable = pEntity->GetScriptTable())
{
IScriptSystem* pSS = pScriptTable->GetScriptSystem();
if (pScriptTable->GetValueType("GetMaxHealth") == svtFunction && pSS->BeginCall(pScriptTable, "GetMaxHealth"))
{
pSS->PushFuncParam(pScriptTable);
ScriptAnyValue result;
if (pSS->EndCallAny( result ))
{
int maxHealth = 0;
if (result.CopyTo( maxHealth ))
{
damage = ( damageRelative * maxHealth ) / 100;
}
}
}
}
}
SendFlowHitToEntity( pEntity->GetId(), pEntity->GetId(), damage, GetPortVec3(pActInfo, INP_POSITION) );
}
}
break;
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:39,代码来源:FlowGameNodes.cpp
示例15: Register_IPostHandle
//-------------------------------------------------------------------------------------------------------
static void Register_IPostHandle( IScriptSystem& sys )
{
ClassRegister sc;
sc.ClassType( &IPostHandle::RTTI(), &IBaseHandle::RTTI() );
{
FunctionRegister sf;
sf.Result( sys, &String::RTTI() );
sf.Function( &BohgeEngine::IPostHandle_GetResult, "GetResult" );
sc.ClassFunction( sf );
}
{
FunctionRegister sf;
sf.Arguments( sys, &String::RTTI(), &String::RTTI() );
sf.Function( &BohgeEngine::IPostHandle_SetPostContent, "SetPostContent" );
sc.ClassFunction( sf );
}
sys.RegisterClass(sc);
}