本文整理汇总了C++中IScriptTable::GetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ IScriptTable::GetValue方法的具体用法?C++ IScriptTable::GetValue怎么用?C++ IScriptTable::GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScriptTable
的用法示例。
在下文中一共展示了IScriptTable::GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessEvent
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
switch (event)
{
case eFE_Activate:
{
IActor* pActor = GetAIActor(pActInfo);
if (!pActor)
break;
IEntity* pEnt = pActor->GetEntity();
if (!pEnt)
break;
HSCRIPTFUNCTION func = 0;
int ret = 0;
IScriptTable* pTable = pEnt->GetScriptTable();
if (!pTable)
break;
if (IsPortActive(pActInfo, 1) && pTable->GetValue("GrabObject", func))
{
IEntity* pObj = gEnv->pEntitySystem->GetEntity( GetPortEntityId(pActInfo, 0) );
if (pObj)
{
IScriptTable* pObjTable = pObj->GetScriptTable();
Script::CallReturn(gEnv->pScriptSystem, func, pTable, pObjTable, ret);
}
ActivateOutput(pActInfo, 0, ret);
}
else if (IsPortActive(pActInfo, 2) && pTable->GetValue("DropObject", func))
{
bool bThrow = GetPortBool(pActInfo, 3);
Script::CallReturn(gEnv->pScriptSystem, func, pTable, bThrow, ret);
ActivateOutput(pActInfo, 0, ret);
}
if (pTable->GetValue("GetGrabbedObject", func))
{
ScriptHandle sH(0);
Script::CallReturn(gEnv->pScriptSystem, func, pTable, sH);
ActivateOutput(pActInfo, 1, EntityId(sH.n));
}
if(func)
gEnv->pScriptSystem->ReleaseFunc(func);
break;
}
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:51,代码来源:FlowGameNodes.cpp
示例2: GetTeamRadioTable
static bool GetTeamRadioTable(CGameRules *gr, const string &team_name, SmartScriptTable &out_table)
{
if(!gr)
{
return false;
}
IScriptTable *pTable = gr->GetEntity()->GetScriptTable();
if(!pTable)
{
return false;
}
SmartScriptTable pTeamRadio;
if(!pTable->GetValue("teamRadio", pTeamRadio))
{
return false;
}
if(!pTeamRadio->GetValue(team_name, out_table))
{
return false;
}
return true;
}
示例3: GetEntity
const char *CAnimatedCharacterSample::GetCharacterModelNameFromScriptTable() const
{
IEntity *pEntity = GetEntity();
IScriptTable *pScriptTable = pEntity->GetScriptTable();
if(pScriptTable == NULL)
{
return NULL;
}
SmartScriptTable propertiesTable;
const bool hasPropertiesTable = pScriptTable->GetValue("Properties", propertiesTable);
if(! hasPropertiesTable)
{
return NULL;
}
const char *modelName = NULL;
const bool hasModelName = propertiesTable->GetValue("objModel", modelName);
if(! hasModelName)
{
return NULL;
}
return modelName;
}
示例4: SerializeScript
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;
}
示例5: OnSpawn
void CBaseManagerEntitySink::OnSpawn(IEntity *pEntity, SEntitySpawnParams ¶ms)
{
// Check if it has a CNC Table. If it does, manually add it to the controller
IScriptTable *pTable;
if (NULL != pEntity && NULL != (pTable = pEntity->GetScriptTable()))
{
// Get property table
SmartScriptTable props, cncbuilding;
if (true == pTable->GetValue("Properties", props) &&
true == props->GetValue("CNCBuilding", cncbuilding))
{
// Extract and build GUID
char const* szTeam = 0;
char const* szClass = 0;
cncbuilding->GetValue("Team", szTeam);
cncbuilding->GetValue("Class", szClass);
BuildingGUID GUID = m_pManager->GenerateGUID(szTeam, szClass);
if (GUID_INVALID != GUID)
{
// Get controller and manually add it
IBuildingController *pController = m_pManager->FindBuildingController(GUID);
if (NULL != pController)
pController->AddInterface(pEntity);
}
}
}
}
示例6: SpawnParticleEffect
void CBoidFish::SpawnParticleEffect( const Vec3 &pos,SBoidContext &bc,int nEffect )
{
if (!bc.entity)
return;
IScriptTable *pEntityTable = bc.entity->GetScriptTable();
if (!pEntityTable)
return;
if (!m_pOnSpawnBubbleFunc)
{
pEntityTable->GetValue( "OnSpawnBubble",m_pOnSpawnBubbleFunc );
}
if (!m_pOnSpawnSplashFunc)
{
pEntityTable->GetValue( "OnSpawnSplash",m_pOnSpawnSplashFunc );
}
HSCRIPTFUNCTION pScriptFunc = NULL;
switch (nEffect)
{
case SPAWN_BUBBLE:
pScriptFunc = m_pOnSpawnBubbleFunc;
break;
case SPAWN_SPLASH:
pScriptFunc = m_pOnSpawnSplashFunc;
break;
}
if (pScriptFunc)
{
if (!vec_Bubble)
{
vec_Bubble = gEnv->pScriptSystem->CreateTable();
}
{
CScriptSetGetChain bubbleChain(vec_Bubble);
bubbleChain.SetValue( "x",pos.x );
bubbleChain.SetValue( "y",pos.y );
bubbleChain.SetValue( "z",pos.z );
}
Script::Call( gEnv->pScriptSystem,pScriptFunc,pEntityTable,pos );
}
}
示例7: InitialisePoseBlenderAim
void CProceduralContextAim::InitialisePoseBlenderAim()
{
CRY_ASSERT( m_entity );
const int slot = 0;
ICharacterInstance* pCharacterInstance = m_entity->GetCharacter( slot );
if ( pCharacterInstance == NULL )
{
return;
}
ISkeletonPose* pSkeletonPose = pCharacterInstance->GetISkeletonPose();
if ( pSkeletonPose == NULL )
{
return;
}
m_pPoseBlenderAim = pSkeletonPose->GetIPoseBlenderAim();
if ( m_pPoseBlenderAim )
{
m_defaultPolarCoordinatesSmoothTimeSeconds = 0.1f;
float polarCoordinatesMaxYawDegreesPerSecond = 360.f;
float polarCoordinatesMaxPitchDegreesPerSecond = 360.f;
float fadeInSeconds = 0.25f;
float fadeOutSeconds = 0.25f;
float fadeOutMinDistance = 0.f;
IScriptTable* pScriptTable = m_entity->GetScriptTable();
if ( pScriptTable )
{
SmartScriptTable pProceduralContextAimTable;
pScriptTable->GetValue( "ProceduralContextAim", pProceduralContextAimTable );
if ( pProceduralContextAimTable )
{
pProceduralContextAimTable->GetValue( "polarCoordinatesSmoothTimeSeconds", m_defaultPolarCoordinatesSmoothTimeSeconds );
pProceduralContextAimTable->GetValue( "polarCoordinatesMaxYawDegreesPerSecond", polarCoordinatesMaxYawDegreesPerSecond );
pProceduralContextAimTable->GetValue( "polarCoordinatesMaxPitchDegreesPerSecond", polarCoordinatesMaxPitchDegreesPerSecond );
pProceduralContextAimTable->GetValue( "fadeInSeconds", fadeInSeconds );
pProceduralContextAimTable->GetValue( "fadeOutSeconds", fadeOutSeconds );
pProceduralContextAimTable->GetValue( "fadeOutMinDistance", fadeOutMinDistance );
}
}
m_defaultPolarCoordinatesMaxSmoothRateRadiansPerSecond = Vec2( DEG2RAD( polarCoordinatesMaxYawDegreesPerSecond ), DEG2RAD( polarCoordinatesMaxPitchDegreesPerSecond ) );
m_pPoseBlenderAim->SetPolarCoordinatesSmoothTimeSeconds( m_defaultPolarCoordinatesSmoothTimeSeconds );
m_pPoseBlenderAim->SetPolarCoordinatesMaxRadiansPerSecond( m_defaultPolarCoordinatesMaxSmoothRateRadiansPerSecond );
m_pPoseBlenderAim->SetFadeInSpeed( fadeInSeconds );
m_pPoseBlenderAim->SetFadeOutSpeed( fadeOutSeconds );
m_pPoseBlenderAim->SetFadeOutMinDistance( fadeOutMinDistance );
m_pPoseBlenderAim->SetState( false );
}
}
示例8: Reset
bool CTornado::Reset()
{
//Initialize default values before (in case ScriptTable fails)
m_wanderSpeed = 10.0f;
m_cloudHeight = 376.0f;
m_radius = 300.0f;
m_spinImpulse = 9.0f;
m_attractionImpulse = 13.0f;
m_upImpulse = 18.0f;
const char* funnelEffect = 0;
SmartScriptTable props;
IScriptTable* pScriptTable = GetEntity()->GetScriptTable();
if(!pScriptTable || !pScriptTable->GetValue("Properties", props))
return false;
props->GetValue("fWanderSpeed", m_wanderSpeed);
props->GetValue("fCloudHeight", m_cloudHeight);
props->GetValue("Radius", m_radius);
props->GetValue("fSpinImpulse", m_spinImpulse);
props->GetValue("fAttractionImpulse", m_attractionImpulse);
props->GetValue("fUpImpulse", m_upImpulse);
props->GetValue("FunnelEffect", funnelEffect);
if (!UseFunnelEffect(funnelEffect))
return false;
Matrix34 m = GetEntity()->GetWorldTM();
m_wanderDir = m.GetColumn(1)*0.414214f;
m_isOnWater = false;
m_isInAir = false;
m_nextEntitiesCheck = 0;
Vec3 pos = GetEntity()->GetWorldPos();
gEnv->pLog->Log("TORNADO INIT POS: %f %f %f", pos.x, pos.y, pos.z);
m_points[0] = pos;
m_points[1] = pos + Vec3(0,0,m_cloudHeight/8.0f);
m_points[2] = pos + Vec3(0,0,m_cloudHeight/2.0f);
m_points[3] = pos + Vec3(0,0,m_cloudHeight);
for (int i=0; i<4; ++i)
m_oldPoints[i] = m_points[i];
m_currentPos = GetEntity()->GetWorldPos();
CHANGED_NETWORK_STATE(this, POSITION_ASPECT);
UpdateTornadoSpline();
return true;
}
示例9: ShouldStartTrackingEntity
bool CSmartMine::ShouldStartTrackingEntity( const EntityId entityId ) const
{
// Always track player...
if (entityId == g_pGame->GetIGameFramework()->GetClientActorId())
{
return true;
}
// ... or any AI
const SAutoaimTarget* pTargetInfo = g_pGame->GetAutoAimManager().GetTargetInfo( entityId );
if(pTargetInfo != NULL)
{
return (pTargetInfo->pActorWeak.lock() != NULL);
}
// Also track kickable and pickable objects
IEntity* pEntity = gEnv->pEntitySystem->GetEntity( entityId );
IScriptTable* pScriptTable = (pEntity != NULL) ? pEntity->GetScriptTable() : NULL;
if(pScriptTable != NULL)
{
SmartScriptTable propertiesTable;
if(pScriptTable->GetValue("Properties", propertiesTable))
{
int pickable = 0, kickable = 0;
propertiesTable->GetValue("bPickable", pickable);
propertiesTable->GetValue("bInteractLargeObject", kickable);
if(pickable)
{
// Filter out items/weapons
pickable = (g_pGame->GetIGameFramework()->GetIItemSystem()->GetItem(entityId) == NULL);
}
if (pickable || kickable)
{
//Check if object is moving
IPhysicalEntity* pEntityPhysics = pEntity->GetPhysics();
if(pEntityPhysics != NULL)
{
pe_status_dynamics entityDynamics;
if(pEntityPhysics->GetStatus(&entityDynamics))
{
return (entityDynamics.v.len2() > 0.1f);
}
}
}
}
}
return false;
}
示例10: OnVehicleEvent
//------------------------------------------------------------------------
void CVehicleDamageBehaviorBlowTire::OnVehicleEvent(EVehicleEvent event, const SVehicleEventParams& params)
{
assert(event == eVE_Timer);
// notify AI passengers
IScriptTable* pTable = m_pVehicle->GetEntity()->GetScriptTable();
HSCRIPTFUNCTION scriptFunction(NULL);
if (pTable && pTable->GetValue("OnVehicleImmobilized", scriptFunction) && scriptFunction)
{
Script::Call(gEnv->pScriptSystem, scriptFunction, pTable);
gEnv->pScriptSystem->ReleaseFunc(scriptFunction);
}
}
示例11: SetupEntity
void CVicinityDependentObjectMover::SetupEntity()
{
const char* szModelName = VICINITYDEPENDENTOBJECTMOVER_MODEL_NORMAL;
float fMoveToDistance = 10.0f;
float fAreaTriggerRange = 10.0f;
float fBackAreaTriggerRange = 10.0f;
float fForceMoveCompleteDistance = 1.0f;
IEntity* pEntity = GetEntity();
CRY_ASSERT( pEntity != NULL );
IScriptTable* pScriptTable = pEntity->GetScriptTable();
if ( pScriptTable != NULL )
{
SmartScriptTable propertiesTable;
if ( pScriptTable->GetValue( "Properties", propertiesTable) )
{
propertiesTable->GetValue( "objModel", szModelName );
propertiesTable->GetValue( "fMoveToDistance", fMoveToDistance );
propertiesTable->GetValue( "fMoveToSpeed", m_fMoveToSpeed );
propertiesTable->GetValue( "fMoveBackSpeed", m_fMoveBackSpeed );
propertiesTable->GetValue( "fAreaTriggerRange", fAreaTriggerRange );
propertiesTable->GetValue( "fBackAreaTriggerRange", fBackAreaTriggerRange );
propertiesTable->GetValue( "fForceMoveCompleteDistance", fForceMoveCompleteDistance );
propertiesTable->GetValue( "bUseAreaTrigger", m_bUseAreaTrigger );
propertiesTable->GetValue( "bDisableAreaTriggerOnMoveComplete", m_bDisableAreaTriggerOnMoveComplete );
}
}
m_fMoveToDistance = fMoveToDistance;
m_fMoveToDistanceSq = fMoveToDistance*fMoveToDistance;
m_fAreaTriggerRange = fAreaTriggerRange;
m_fAreaTriggerRangeSq = fAreaTriggerRange*fAreaTriggerRange;
m_fBackAreaTriggerRange = fBackAreaTriggerRange;
m_fBackAreaTriggerRangeSq = fBackAreaTriggerRange*fBackAreaTriggerRange;
m_fForceMoveCompleteDistanceSq = fForceMoveCompleteDistance*fForceMoveCompleteDistance;
// Load model
pEntity->LoadGeometry( VICINITYDEPENDENTOBJECTMOVER_MODEL_NORMAL_SLOT, szModelName );
// Draw slot and physicalize it
DrawSlot( VICINITYDEPENDENTOBJECTMOVER_MODEL_NORMAL_SLOT, true );
SEntityPhysicalizeParams physicalizeParams;
physicalizeParams.nSlot = VICINITYDEPENDENTOBJECTMOVER_MODEL_NORMAL_SLOT;
physicalizeParams.type = PE_RIGID;
physicalizeParams.mass = 0;
GetEntity()->Physicalize( physicalizeParams );
}
示例12: Reset
void CDangerousRigidBody::Reset()
{
IScriptTable* pTable = GetEntity()->GetScriptTable();
if (pTable != NULL)
{
SmartScriptTable propertiesTable;
if (pTable->GetValue("Properties", propertiesTable))
{
propertiesTable->GetValue("bCurrentlyDealingDamage", m_dangerous);
propertiesTable->GetValue("bDoesFriendlyFireDamage", m_friendlyFireEnabled);
propertiesTable->GetValue("fDamageToDeal", m_damageDealt);
propertiesTable->GetValue("fTimeBetweenHits", m_timeBetweenHits);
}
}
m_activatorTeam = 0;
m_lastHitTime = 0;
}
示例13: Init
//------------------------------------------------------------------------
bool CShake::Init(IGameObject *pGameObject)
{
SetGameObject(pGameObject);
//Initialize default values before (in case ScriptTable fails)
m_radius = 30.0f;
m_shake = 0.05f;
SmartScriptTable props;
IScriptTable* pScriptTable = GetEntity()->GetScriptTable();
if(!pScriptTable || !pScriptTable->GetValue("Properties", props))
return false;
props->GetValue("Radius", m_radius);
props->GetValue("Shake", m_shake);
return true;
}
示例14: GetDestroyedExplosionType
const char* CDoorPanelBehavior::GetDestroyedExplosionType( IEntity* pEntity )
{
CRY_ASSERT(pEntity != NULL);
const char* szModelDestroyedName = DOOR_PANEL_MODEL_DESTROYED;
IScriptTable* pScriptTable = pEntity->GetScriptTable();
if (pScriptTable != NULL)
{
SmartScriptTable propertiesTable;
if (pScriptTable->GetValue("Properties", propertiesTable))
{
propertiesTable->GetValue("DestroyedExplosionType", szModelDestroyedName);
}
}
return szModelDestroyedName;
}
示例15: RegisterCharacterTargetInfo
void CAutoAimManager::RegisterCharacterTargetInfo(const CActor& targetActor, const SAutoaimTargetRegisterParams& registerParams)
{
SAutoaimTarget aimTarget;
aimTarget.entityId = targetActor.GetEntityId();
aimTarget.pActorWeak = targetActor.GetWeakPtr();
aimTarget.fallbackOffset = registerParams.fallbackOffset;
aimTarget.primaryBoneId = registerParams.primaryBoneId;
aimTarget.physicsBoneId = registerParams.physicsBoneId;
aimTarget.secondaryBoneId = registerParams.secondaryBoneId;
aimTarget.innerRadius = registerParams.innerRadius;
aimTarget.outerRadius = registerParams.outerRadius;
aimTarget.snapRadius = registerParams.snapRadius;
aimTarget.snapRadiusTagged = registerParams.snapRadiusTagged;
if (!gEnv->bMultiplayer)
{
IEntity* pTargetEntity = targetActor.GetEntity();
aimTarget.aiFaction = IFactionMap::InvalidFactionID;
//Instance properties, other stuff could be added here easily (grab enemy, sliding hit, etc)
SmartScriptTable props;
SmartScriptTable propsPlayerInteractions;
IScriptTable* pScriptTable = pTargetEntity->GetScriptTable();
if (pScriptTable && pScriptTable->GetValue("Properties", props))
{
if (props->GetValue("PlayerInteractions", propsPlayerInteractions))
{
int stealhKill = 0;
if (propsPlayerInteractions->GetValue("bStealthKill", stealhKill) && (stealhKill != 0))
{
aimTarget.SetFlag(eAATF_StealthKillable);
}
int canBeGrabbed = 0;
if (propsPlayerInteractions->GetValue("bCanBeGrabbed", canBeGrabbed) && (canBeGrabbed != 0))
{
aimTarget.SetFlag(eAATF_CanBeGrabbed);
}
}
}
}
m_autoaimTargets.push_back(aimTarget);
}