本文整理汇总了C++中GetOuter函数的典型用法代码示例。如果您正苦于以下问题:C++ GetOuter函数的具体用法?C++ GetOuter怎么用?C++ GetOuter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetOuter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: UpdateAsset
void UEnvironmentQueryGraph::UpdateAsset(int32 UpdateFlags)
{
if (IsLocked())
{
return;
}
// let's find root node
UEnvironmentQueryGraphNode_Root* RootNode = NULL;
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
{
RootNode = Cast<UEnvironmentQueryGraphNode_Root>(Nodes[Idx]);
if (RootNode != NULL)
{
break;
}
}
UEnvQuery* Query = Cast<UEnvQuery>(GetOuter());
Query->GetOptionsMutable().Reset();
if (RootNode && RootNode->Pins.Num() > 0 && RootNode->Pins[0]->LinkedTo.Num() > 0)
{
UEdGraphPin* MyPin = RootNode->Pins[0];
// sort connections so that they're organized the same as user can see in the editor
MyPin->LinkedTo.Sort(FCompareNodeXLocation());
for (int32 Idx = 0; Idx < MyPin->LinkedTo.Num(); Idx++)
{
UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(MyPin->LinkedTo[Idx]->GetOwningNode());
if (OptionNode)
{
OptionNode->UpdateNodeData();
UEnvQueryOption* OptionInstance = Cast<UEnvQueryOption>(OptionNode->NodeInstance);
if (OptionInstance && OptionInstance->Generator)
{
OptionInstance->Tests.Reset();
for (int32 TestIdx = 0; TestIdx < OptionNode->SubNodes.Num(); TestIdx++)
{
UAIGraphNode* SubNode = OptionNode->SubNodes[TestIdx];
if (SubNode == nullptr)
{
continue;
}
SubNode->ParentNode = OptionNode;
UEnvironmentQueryGraphNode_Test* TestNode = Cast<UEnvironmentQueryGraphNode_Test>(SubNode);
if (TestNode && TestNode->bTestEnabled)
{
UEnvQueryTest* TestInstance = Cast<UEnvQueryTest>(TestNode->NodeInstance);
if (TestInstance)
{
OptionInstance->Tests.Add(TestInstance);
}
}
}
Query->GetOptionsMutable().Add(OptionInstance);
}
// FORT-16508 tracking BEGIN: log invalid option
if (OptionInstance && OptionInstance->Generator == nullptr)
{
FString DebugMessage = FString::Printf(TEXT("[%s] UpdateAsset found option instance [pin:%d] without a generator! tests:%d"),
FPlatformTime::StrTimestamp(), Idx, OptionNode->SubNodes.Num());
RootNode->LogDebugMessage(DebugMessage);
}
else if (OptionInstance == nullptr)
{
FString DebugMessage = FString::Printf(TEXT("[%s] UpdateAsset found option node [pin:%d] without an instance! tests:%d"),
FPlatformTime::StrTimestamp(), Idx, OptionNode->SubNodes.Num());
RootNode->LogDebugMessage(DebugMessage);
}
// FORT-16508 tracking END
}
}
}
RemoveOrphanedNodes();
// FORT-16508 tracking BEGIN: find corrupted options
if (RootNode)
{
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
{
UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(Nodes[Idx]);
if (OptionNode)
{
UEnvQueryOption* OptionInstance = Cast<UEnvQueryOption>(OptionNode->NodeInstance);
if (OptionNode->NodeInstance == nullptr || OptionInstance == nullptr || OptionInstance->HasAnyFlags(RF_Transient))
{
FString DebugMessage = FString::Printf(TEXT("[%s] found corrupted node after RemoveOrphanedNodes! type:instance option:%s instance:%d transient:%d tests:%d"),
FPlatformTime::StrTimestamp(),
*GetNameSafe(OptionNode),
OptionNode->NodeInstance ? (OptionInstance ? 1 : -1) : 0,
//.........这里部分代码省略.........
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:101,代码来源:EnvironmentQueryGraph.cpp
示例2: if
void UK2Node_Composite::PostPasteNode()
{
Super::PostPasteNode();
//@TODO: Should verify that each node in the composite can be pasted into this new graph successfully (CanPasteHere)
if (BoundGraph != NULL)
{
UEdGraph* ParentGraph = CastChecked<UEdGraph>(GetOuter());
ensure(BoundGraph != ParentGraph);
// Update the InputSinkNode / OutputSourceNode pointers to point to the new graph
TSet<UEdGraphNode*> BoundaryNodes;
for (int32 NodeIndex = 0; NodeIndex < BoundGraph->Nodes.Num(); ++NodeIndex)
{
UEdGraphNode* Node = BoundGraph->Nodes[NodeIndex];
//Remove this node if it should not exist more then one in blueprint
if(UK2Node_Event* Event = Cast<UK2Node_Event>(Node))
{
UBlueprint* BP = FBlueprintEditorUtils::FindBlueprintForGraphChecked(BoundGraph);
if(FBlueprintEditorUtils::FindOverrideForFunction(BP, Event->EventReference.GetMemberParentClass(Event), Event->EventReference.GetMemberName()))
{
FBlueprintEditorUtils::RemoveNode(BP, Node, true);
NodeIndex--;
continue;
}
}
BoundaryNodes.Add(Node);
if (Node->GetClass() == UK2Node_Tunnel::StaticClass())
{
// Exactly a tunnel node, should be the entrance or exit node
UK2Node_Tunnel* Tunnel = CastChecked<UK2Node_Tunnel>(Node);
if (Tunnel->bCanHaveInputs && !Tunnel->bCanHaveOutputs)
{
OutputSourceNode = Tunnel;
Tunnel->InputSinkNode = this;
}
else if (Tunnel->bCanHaveOutputs && !Tunnel->bCanHaveInputs)
{
InputSinkNode = Tunnel;
Tunnel->OutputSourceNode = this;
}
else
{
ensureMsgf(false, *LOCTEXT("UnexpectedTunnelNode", "Unexpected tunnel node '%s' in cloned graph '%s' (both I/O or neither)").ToString(), *Tunnel->GetName(), *GetName());
}
}
}
RenameBoundGraphCloseToName(BoundGraph->GetName());
ensure(BoundGraph->SubGraphs.Find(ParentGraph) == INDEX_NONE);
//Nested composites will already be in the SubGraph array
if(ParentGraph->SubGraphs.Find(BoundGraph) == INDEX_NONE)
{
ParentGraph->SubGraphs.Add(BoundGraph);
}
FEdGraphUtilities::PostProcessPastedNodes(BoundaryNodes);
}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:65,代码来源:K2Node_Composite.cpp
示例3: Msg
bool CAI_BlendedMotor::AddTurnGesture( float flYD )
{
// some funky bug with human turn gestures, disable for now
return false;
// try using a turn gesture
Activity activity = ACT_INVALID;
float weight = 1.0;
float turnCompletion = 1.0;
if (m_flNextTurnGesture > gpGlobals->curtime)
{
/*
if ( GetOuter()->m_debugOverlays & OVERLAY_NPC_SELECTED_BIT )
{
Msg( "%.1f : [ %.2f ]\n", flYD, m_flNextTurnAct - gpGlobals->curtime );
}
*/
return false;
}
if ( GetOuter()->IsMoving() || GetOuter()->IsCrouching() )
{
return false;
}
if (fabs( flYD ) < 15)
{
return false;
}
else if (flYD < -45)
{
activity = ACT_GESTURE_TURN_RIGHT90;
weight = flYD / -90;
turnCompletion = 0.36;
}
else if (flYD < 0)
{
activity = ACT_GESTURE_TURN_RIGHT45;
weight = flYD / -45;
turnCompletion = 0.4;
}
else if (flYD <= 45)
{
activity = ACT_GESTURE_TURN_LEFT45;
weight = flYD / 45;
turnCompletion = 0.4;
}
else
{
activity = ACT_GESTURE_TURN_LEFT90;
weight = flYD / 90;
turnCompletion = 0.36;
}
int seq = SelectWeightedSequence( activity );
if (scene_flatturn->GetBool() && GetOuter()->IsCurSchedule( SCHED_SCENE_GENERIC ))
{
Activity flatactivity = activity;
if (activity == ACT_GESTURE_TURN_RIGHT90)
{
flatactivity = ACT_GESTURE_TURN_RIGHT90_FLAT;
}
else if (activity == ACT_GESTURE_TURN_RIGHT45)
{
flatactivity = ACT_GESTURE_TURN_RIGHT45_FLAT;
}
else if (activity == ACT_GESTURE_TURN_LEFT90)
{
flatactivity = ACT_GESTURE_TURN_LEFT90_FLAT;
}
else if (activity == ACT_GESTURE_TURN_LEFT45)
{
flatactivity = ACT_GESTURE_TURN_LEFT45_FLAT;
}
if (flatactivity != activity)
{
int newseq = SelectWeightedSequence( flatactivity );
if (newseq != ACTIVITY_NOT_AVAILABLE)
{
seq = newseq;
}
}
}
if (seq != ACTIVITY_NOT_AVAILABLE)
{
int iLayer = GetOuter()->AddGestureSequence( seq );
if (iLayer != -1)
{
GetOuter()->SetLayerPriority( iLayer, 100 );
// vary the playback a bit
SetLayerPlaybackRate( iLayer, 1.0 );
float actualDuration = GetOuter()->GetLayerDuration( iLayer );
float rate = enginerandom->RandomFloat( 0.5, 1.1 );
//.........这里部分代码省略.........
开发者ID:KissLick,项目名称:sourcemod-npc-in-css,代码行数:101,代码来源:CAI_Blended_Movement.cpp
示例4: GetOuter
//-----------------------------------------------------------------------------
// Purpose: Suppress melee attacks against enemies for the given duration
// Input : flDuration - Amount of time to suppress the attacks
//-----------------------------------------------------------------------------
void CAI_PassengerBehaviorZombie::SuppressAttack( float flDuration )
{
GetOuter()->SetNextAttack( gpGlobals->curtime + flDuration );
}
开发者ID:Muini,项目名称:Nag-asw,代码行数:8,代码来源:ai_behavior_passenger_zombie.cpp
示例5: IsAMasterTrack
bool UMovieSceneAudioTrack::IsAMasterTrack() const
{
return Cast<UMovieScene>(GetOuter())->IsAMasterTrack(this);
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:4,代码来源:MovieSceneAudioTrack.cpp
示例6: switch
void CAI_LeadBehavior::RunTask( const Task_t *pTask )
{
switch ( pTask->iTask )
{
case TASK_LEAD_SUCCEED:
{
if ( !IsSpeaking() )
{
TaskComplete();
NotifyEvent( LBE_DONE );
}
break;
}
case TASK_LEAD_ARRIVE:
{
if ( !IsSpeaking() )
{
TaskComplete();
NotifyEvent( LBE_ARRIVAL_DONE );
}
break;
}
case TASK_LEAD_MOVE_TO_RANGE:
{
// If we haven't spoken our start speech, move closer
if ( !m_hasspokenstart)
{
ChainRunTask( TASK_MOVE_TO_GOAL_RANGE, m_leaddistance - 24 );
}
else
{
ChainRunTask( TASK_MOVE_TO_GOAL_RANGE, m_retrievedistance );
if ( !TaskIsComplete() )
{
// Transition to a walk when we get near the player
// Check Z first, and only check 2d if we're within that
Vector vecGoalPos = GetNavigator()->GetGoalPos();
float distance = fabs(vecGoalPos.z - GetLocalOrigin().z);
bool bWithinZ = false;
if ( distance < m_retrievedistance )
{
distance = ( vecGoalPos - GetLocalOrigin() ).Length2D();
bWithinZ = true;
}
if ( distance > m_retrievedistance )
{
Activity followActivity = ACT_WALK;
if ( GetOuter()->GetState() == NPC_STATE_COMBAT || (!bWithinZ || distance < (m_retrievedistance*4)) && GetOuter()->GetState() != NPC_STATE_COMBAT )
{
followActivity = ACT_RUN;
}
// Don't confuse move and shoot by resetting the activity every think
Activity curActivity = GetNavigator()->GetMovementActivity();
switch( curActivity )
{
case ACT_WALK_AIM: curActivity = ACT_WALK; break;
case ACT_RUN_AIM: curActivity = ACT_RUN; break;
}
if ( curActivity != followActivity )
{
GetNavigator()->SetMovementActivity(followActivity);
}
GetNavigator()->SetArrivalDirection( GetOuter()->GetTarget() );
}
}
}
break;
}
case TASK_LEAD_RETRIEVE_WAIT:
{
ChainRunTask( TASK_WAIT_INDEFINITE );
break;
}
case TASK_LEAD_WALK_PATH:
{
// If we're leading, and we're supposed to run, run instead of walking
if ( m_run &&
( IsCurSchedule( SCHED_LEAD_WAITFORPLAYER, false ) || IsCurSchedule( SCHED_LEAD_PLAYER, false ) || IsCurSchedule( SCHED_LEAD_SPEAK_THEN_LEAD_PLAYER, false )|| IsCurSchedule( SCHED_LEAD_RETRIEVE, false ) ) )
{
ChainRunTask( TASK_RUN_PATH );
}
else
{
ChainRunTask( TASK_WALK_PATH );
}
// While we're walking
if ( TaskIsRunning() && IsCurSchedule( SCHED_LEAD_PLAYER, false ) )
{
// If we're not speaking, and we haven't tried for a while, try to speak lead idle
if ( m_flNextLeadIdle < gpGlobals->curtime && !IsSpeaking() )
{
m_flNextLeadIdle = gpGlobals->curtime + RandomFloat( 10,15 );
//.........这里部分代码省略.........
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:101,代码来源:ai_behavior_lead.cpp
示例7: GetOuter
void CAI_MoveAndShootOverlay::RunShootWhileMove()
{
if ( m_bNoShootWhileMove )
return;
if ( gpGlobals->curtime < m_flSuspendUntilTime )
return;
m_flSuspendUntilTime = MOVESHOOT_DO_NOT_SUSPEND;
CAI_BaseNPC *pOuter = GetOuter();
// keep enemy if dead but try to look for a new one
if (!pOuter->GetEnemy() || !pOuter->GetEnemy()->IsAlive())
{
CBaseEntity *pNewEnemy = pOuter->BestEnemy();
if( pNewEnemy != NULL )
{
//New enemy! Clear the timers and set conditions.
pOuter->SetEnemy( pNewEnemy );
pOuter->SetState( NPC_STATE_COMBAT );
}
else
{
pOuter->ClearAttackConditions();
}
// SetEnemy( NULL );
}
/*if( !pOuter->GetNavigator()->IsGoalActive() )
return;*/
if ( GetEnemy() == NULL )
{
if ( pOuter->GetAlternateMoveShootTarget() )
{
// Aim at this other thing if I can't aim at my enemy.
pOuter->AddFacingTarget( pOuter->GetAlternateMoveShootTarget(), pOuter->GetAlternateMoveShootTarget()->GetAbsOrigin(), 1.0, 0.2 );
}
return;
}
bool bMoveAimAtEnemy = CanAimAtEnemy();
UpdateMoveShootActivity( bMoveAimAtEnemy );
if ( !bMoveAimAtEnemy )
{
EndShootWhileMove();
return;
}
Assert( HasAvailableRangeAttack() ); // This should have been caught at task start
Activity activity;
bool bIsReloading = false;
if ( ( activity = pOuter->TranslateActivity( ACT_GESTURE_RELOAD ) ) != ACT_INVALID )
{
bIsReloading = pOuter->IsPlayingGesture( activity );
}
if ( !bIsReloading && HasAvailableRangeAttack() )
{
// time to fire?
if ( pOuter->HasCondition( COND_CAN_RANGE_ATTACK1, false ) )
{
if ( pOuter->GetShotRegulator()->IsInRestInterval() )
{
EndShootWhileMove();
}
else if ( pOuter->GetShotRegulator()->ShouldShoot() )
{
if ( m_bMovingAndShooting || pOuter->OnBeginMoveAndShoot() )
{
m_bMovingAndShooting = true;
pOuter->OnRangeAttack1();
activity = pOuter->TranslateActivity( ACT_GESTURE_RANGE_ATTACK1 );
Assert( activity != ACT_INVALID );
pOuter->RestartGesture( activity );
// FIXME: this seems a bit wacked
pOuter->Weapon_SetActivity( pOuter->Weapon_TranslateActivity( ACT_RANGE_ATTACK1 ), 0 );
}
}
}
}
// try to keep facing towards the last known position of the enemy
Vector vecEnemyLKP = pOuter->GetEnemyLKP();
pOuter->AddFacingTarget( pOuter->GetEnemy(), vecEnemyLKP, 1.0, 0.8 );
}
开发者ID:BG2-Dev-Team,项目名称:BG2-Code,代码行数:94,代码来源:ai_moveshoot.cpp
示例8: GetOuter
bool UObjectBaseUtility::IsDefaultSubobject() const
{
const bool bIsInstanced = GetOuter() && (GetOuter()->HasAnyFlags(RF_ClassDefaultObject) || ((UObject*)this)->GetArchetype() != GetClass()->GetDefaultObject());
return bIsInstanced;
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:5,代码来源:UObjectBaseUtility.cpp
示例9: AI_PROFILE_SCOPE
bool CAI_TacticalServices::FindLateralLos( const Vector &vecThreat, Vector *pResult )
{
AI_PROFILE_SCOPE( CAI_TacticalServices_FindLateralLos );
if( !m_bAllowFindLateralLos )
{
return false;
}
MARK_TASK_EXPENSIVE();
Vector vecLeftTest;
Vector vecRightTest;
Vector vecStepRight;
Vector vecCheckStart;
bool bLookingForEnemy = GetEnemy() && VectorsAreEqual(vecThreat, GetEnemy()->EyePosition(), 0.1f);
int i;
if( !bLookingForEnemy || GetOuter()->HasCondition(COND_SEE_ENEMY) || GetOuter()->HasCondition(COND_HAVE_ENEMY_LOS) ||
GetOuter()->GetTimeScheduleStarted() == gpGlobals->curtime ) // Conditions get nuked before tasks run, assume should try
{
// My current position might already be valid.
if ( TestLateralLos(vecThreat, GetLocalOrigin()) )
{
*pResult = GetLocalOrigin();
return true;
}
}
if( !ai_find_lateral_los.GetBool() )
{
// Allows us to turn off lateral LOS at the console. Allow the above code to run
// just in case the NPC has line of sight to begin with.
return false;
}
int iChecks = COVER_CHECKS;
int iDelta = COVER_DELTA;
// If we're limited in how far we're allowed to move laterally, don't bother checking past it
int iMaxLateralDelta = (int)GetOuter()->GetMaxTacticalLateralMovement();
if ( iMaxLateralDelta != MAXTACLAT_IGNORE && iMaxLateralDelta < iDelta )
{
iChecks = 1;
iDelta = iMaxLateralDelta;
}
Vector right;
AngleVectors( GetLocalAngles(), NULL, &right, NULL );
vecStepRight = right * iDelta;
vecStepRight.z = 0;
vecLeftTest = vecRightTest = GetLocalOrigin();
vecCheckStart = vecThreat;
for ( i = 0 ; i < iChecks; i++ )
{
vecLeftTest = vecLeftTest - vecStepRight;
vecRightTest = vecRightTest + vecStepRight;
if (TestLateralLos( vecCheckStart, vecLeftTest ))
{
*pResult = vecLeftTest;
return true;
}
if (TestLateralLos( vecCheckStart, vecRightTest ))
{
*pResult = vecRightTest;
return true;
}
}
return false;
}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:75,代码来源:ai_tacticalservices.cpp
示例10: check
bool UActorComponent::NeedsLoadForServer() const
{
check(GetOuter());
return (GetOuter()->NeedsLoadForServer() && Super::NeedsLoadForServer());
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:5,代码来源:ActorComponent.cpp
示例11: SpawnMissingNodes
void UEnvironmentQueryGraph::SpawnMissingNodes()
{
UEnvQuery* QueryOwner = Cast<UEnvQuery>(GetOuter());
if (QueryOwner == nullptr)
{
return;
}
TSet<UEnvQueryTest*> ExistingTests;
TSet<UEnvQueryOption*> ExistingNodes;
TArray<UEnvQueryOption*> OptionsCopy = QueryOwner->GetOptions();
UAIGraphNode* MyRootNode = nullptr;
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
{
UEnvironmentQueryGraphNode* MyNode = Cast<UEnvironmentQueryGraphNode>(Nodes[Idx]);
UEnvQueryOption* OptionInstance = MyNode ? Cast<UEnvQueryOption>(MyNode->NodeInstance) : nullptr;
if (OptionInstance && OptionInstance->Generator)
{
ExistingNodes.Add(OptionInstance);
ExistingTests.Empty(ExistingTests.Num());
for (int32 SubIdx = 0; SubIdx < MyNode->SubNodes.Num(); SubIdx++)
{
UEnvironmentQueryGraphNode* MySubNode = Cast<UEnvironmentQueryGraphNode>(MyNode->SubNodes[SubIdx]);
UEnvQueryTest* TestInstance = MySubNode ? Cast<UEnvQueryTest>(MySubNode->NodeInstance) : nullptr;
if (TestInstance)
{
ExistingTests.Add(TestInstance);
}
else
{
MyNode->RemoveSubNode(MySubNode);
SubIdx--;
}
}
SpawnMissingSubNodes(OptionInstance, ExistingTests, MyNode);
}
UEnvironmentQueryGraphNode_Root* RootNode = Cast<UEnvironmentQueryGraphNode_Root>(Nodes[Idx]);
if (RootNode)
{
MyRootNode = RootNode;
}
}
UEdGraphPin* RootOutPin = MyRootNode ? FindGraphNodePin(MyRootNode, EGPD_Output) : nullptr;
ExistingTests.Empty(0);
for (int32 Idx = 0; Idx < OptionsCopy.Num(); Idx++)
{
UEnvQueryOption* OptionInstance = OptionsCopy[Idx];
if (ExistingNodes.Contains(OptionInstance) || OptionInstance == nullptr || OptionInstance->Generator == nullptr)
{
continue;
}
FGraphNodeCreator<UEnvironmentQueryGraphNode_Option> NodeBuilder(*this);
UEnvironmentQueryGraphNode_Option* MyNode = NodeBuilder.CreateNode();
UAIGraphNode::UpdateNodeClassDataFrom(OptionInstance->Generator->GetClass(), MyNode->ClassData);
MyNode->ErrorMessage = MyNode->ClassData.GetDeprecatedMessage();
NodeBuilder.Finalize();
if (MyRootNode)
{
MyNode->NodePosX = MyRootNode->NodePosX + (Idx * 300);
MyNode->NodePosY = MyRootNode->NodePosY + 100;
}
MyNode->NodeInstance = OptionInstance;
SpawnMissingSubNodes(OptionInstance, ExistingTests, MyNode);
UEdGraphPin* SpawnedInPin = FindGraphNodePin(MyNode, EGPD_Input);
if (RootOutPin && SpawnedInPin)
{
RootOutPin->MakeLinkTo(SpawnedInPin);
}
}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:80,代码来源:EnvironmentQueryGraph.cpp
示例12: AI_GetSinglePlayer
int CAI_LeadBehavior::SelectSchedule()
{
if ( HasGoal() )
{
if( HasCondition(COND_LEAD_SUCCESS) )
{
return SCHED_LEAD_SUCCEED;
}
// Player's here, but does he have the weapon we want him to have?
if ( m_weaponname != NULL_STRING )
{
CBasePlayer *pFollower = AI_GetSinglePlayer();
if ( pFollower && !pFollower->Weapon_OwnsThisType( STRING(m_weaponname) ) )
{
// If the safety timeout has run out, just give the player the weapon
if ( !m_flWeaponSafetyTimeOut || (m_flWeaponSafetyTimeOut > gpGlobals->curtime) )
return SCHED_LEAD_PLAYERNEEDSWEAPON;
string_t iszItem = AllocPooledString( "weapon_bugbait" );
pFollower->GiveNamedItem( STRING(iszItem) );
}
}
// If we have a waitpoint, we want to wait at it for the player.
if( HasWaitPoint() && !PlayerIsAheadOfMe( true ) )
{
bool bKeepWaiting = true;
// If we have no wait distance, trigger as soon as the player comes in view
if ( !m_waitdistance )
{
if ( HasCondition( COND_SEE_PLAYER ) )
{
// We've spotted the player, so stop waiting
bKeepWaiting = false;
}
}
else
{
// We have to collect data about the person we're leading around.
CBaseEntity *pFollower = AI_GetSinglePlayer();
if( pFollower )
{
float flFollowerDist = ( WorldSpaceCenter() - pFollower->WorldSpaceCenter() ).Length();
if ( flFollowerDist < m_waitdistance )
{
bKeepWaiting = false;
}
}
}
// Player still not here?
if ( bKeepWaiting )
return SCHED_LEAD_WAITFORPLAYER;
// We're finished waiting
m_waitpoint = vec3_origin;
Speak( TLK_LEAD_WAITOVER );
// Don't speak the start line, because we've said
m_hasspokenstart = true;
return SCHED_WAIT_FOR_SPEAK_FINISH;
}
// If we haven't spoken our start speech, do that first
if ( !m_hasspokenstart )
{
if ( HasCondition(COND_LEAD_HAVE_FOLLOWER_LOS) && HasCondition(COND_LEAD_FOLLOWER_VERY_CLOSE) )
return SCHED_LEAD_SPEAK_START;
// We haven't spoken to him, and we still need to. Go get him.
return SCHED_LEAD_RETRIEVE;
}
if( HasCondition( COND_LEAD_FOLLOWER_LOST ) )
{
if( m_args.iRetrievePlayer )
{
// If not, we want to go get the player.
DevMsg( GetOuter(), "Follower lost. Spoke COMING_BACK.\n");
Speak( TLK_LEAD_COMINGBACK );
m_MoveMonitor.ClearMark();
// If we spoke something, wait for it to finish
if ( m_args.iComingBackWaitForSpeak && IsSpeaking() )
return SCHED_LEAD_SPEAK_THEN_RETRIEVE_PLAYER;
return SCHED_LEAD_RETRIEVE;
}
else
{
// Just stay right here and wait.
return SCHED_LEAD_WAITFORPLAYERIDLE;
}
}
if( HasCondition( COND_LEAD_FOLLOWER_LAGGING ) )
{
//.........这里部分代码省略.........
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:101,代码来源:ai_behavior_lead.cpp
示例13: GetGraph
UWALandscapeGraph* UWALandscapeNode::GetGraph()
{
return Cast<UWALandscapeGraph>(GetOuter());
}
开发者ID:iniside,项目名称:ActionRPGGame,代码行数:4,代码来源:WALandscapeNode.cpp
示例14: GetOwningAbilitySystemComponent
UAbilitySystemComponent* UAttributeSet::GetOwningAbilitySystemComponent() const
{
return UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(CastChecked<AActor>(GetOuter()));
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:4,代码来源:AttributeSet.cpp
示例15: Modify
void AActor::SetActorLabelInternal( const FString& NewActorLabelDirty, bool bMakeGloballyUniqueFName, bool bMarkDirty )
{
// Clean up the incoming string a bit
FString NewActorLabel = NewActorLabelDirty;
NewActorLabel.Trim();
NewActorLabel.TrimTrailing();
// First, update the actor label
{
// Has anything changed?
if( FCString::Strcmp( *NewActorLabel, *GetActorLabel() ) != 0 )
{
// Store new label
Modify( bMarkDirty );
ActorLabel = NewActorLabel;
}
}
// Next, update the actor's name
{
// Generate an object name for the actor's label
const FName OldActorName = GetFName();
FName NewActorName = MakeObjectNameFromActorLabel( GetActorLabel(), OldActorName );
// Has anything changed?
if( OldActorName != NewActorName )
{
// Try to rename the object
UObject* NewOuter = NULL; // Outer won't be changing
ERenameFlags RenFlags = bMakeGloballyUniqueFName ? (REN_DontCreateRedirectors | REN_ForceGlobalUnique) : REN_DontCreateRedirectors;
bool bCanRename = Rename( *NewActorName.ToString(), NewOuter, REN_Test | REN_DoNotDirty | REN_NonTransactional | RenFlags );
if( bCanRename )
{
// NOTE: Will assert internally if rename fails
const bool bWasRenamed = Rename( *NewActorName.ToString(), NewOuter, RenFlags );
}
else
{
// Unable to rename the object. Use a unique object name variant.
NewActorName = MakeUniqueObjectName( bMakeGloballyUniqueFName ? ANY_PACKAGE : GetOuter(), GetClass(), NewActorName );
bCanRename = Rename( *NewActorName.ToString(), NewOuter, REN_Test | REN_DoNotDirty | REN_NonTransactional | RenFlags );
if( bCanRename )
{
// NOTE: Will assert internally if rename fails
const bool bWasRenamed = Rename( *NewActorName.ToString(), NewOuter, RenFlags );
}
else
{
// Unable to rename the object. Oh well, not a big deal.
}
}
}
}
FPropertyChangedEvent PropertyEvent( FindField<UProperty>( AActor::StaticClass(), "ActorLabel" ) );
PostEditChangeProperty(PropertyEvent);
FCoreDelegates::OnActorLabelChanged.Broadcast(this);
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:62,代码来源:ActorEditor.cpp
示例16: GetOuter
//-----------------------------------------------------------------------------
// Purpose: Searches for a possible response
// Input : concept -
// NULL -
// Output : AI_Response
//-----------------------------------------------------------------------------
AI_Response *CAI_Expresser::SpeakFindResponse( AIConcept_t concept, const char *modifiers /*= NULL*/ )
{
IResponseSystem *rs = GetOuter()->GetResponseSystem();
if ( !rs )
{
Assert( !"No response system installed for CAI_Expresser::GetOuter()!!!" );
return NULL;
}
AI_CriteriaSet set;
// Always include the concept name
set.AppendCriteria( "concept", concept, CONCEPT_WEIGHT );
// Always include any optional modifiers
if ( modifiers != NULL )
{
char copy_modifiers[ 255 ];
const char *pCopy;
char key[ 128 ] = { 0 };
char value[ 128 ] = { 0 };
Q_strncpy( copy_modifiers, modifiers, sizeof( copy_modifiers ) );
pCopy = copy_modifiers;
while( pCopy )
{
pCopy = SplitContext( pCopy, key, sizeof( key ), value, sizeof( value ), NULL );
if( *key && *value )
{
set.AppendCriteria( key, value, CONCEPT_WEIGHT );
}
}
}
// Let our outer fill in most match criteria
GetOuter()->ModifyOrAppendCriteria( set );
// Append local player criteria to set, but not if this is a player doing the talking
if ( !GetOuter()->IsPlayer() )
{
CBasePlayer *pPlayer = UTIL_PlayerByIndex( 1 );
if( pPlayer )
pPlayer->ModifyOrAppendPlayerCriteria( set );
}
// Now that we have a criteria set, ask for a suitable response
AI_Response *result = new AI_Response;
Assert( result && "new AI_Response: Returned a NULL AI_Response!" );
bool found = rs->FindBestResponse( set, *result, this );
if ( rr_debugresponses.GetInt() == 3 )
{
if ( ( GetOuter()->MyNPCPointer() && GetOuter()->m_debugOverlays & OVERLAY_NPC_SELECTED_BIT ) || GetOuter()->IsPlayer() )
{
const char *pszName;
if ( GetOuter()->IsPlayer() )
{
pszName = ((CBasePlayer*)GetOuter())->GetPlayerName();
}
else
{
pszName = GetOuter()->GetDebugName();
}
if ( found )
{
char response[ 256 ];
result->GetResponse( response, sizeof( response ) );
Warning( "RESPONSERULES: %s spoke '%s'. Found response '%s'.\n", pszName, concept, response );
}
else
{
Warning( "RESPONSERULES: %s spoke '%s'. Found no matching response.\n", pszName, concept );
}
}
}
if ( !found )
{
//Assert( !"rs->FindBestResponse: Returned a NULL AI_Response!" );
delete result;
return NULL;
}
char response[ 256 ];
result->GetResponse( response, sizeof( response ) );
if ( !response[0] )
{
delete result;
return NULL;
}
//.........这里部分代码省略.........
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:101,代码来源:ai_speech.cpp
示例17: return
bool CAI_MoveAndShootOverlay::HasAvailableRangeAttack()
{
return ( ( GetOuter()->GetActiveWeapon() != NULL ) ||
( GetOuter()->CapabilitiesGet() & bits_CAP_INNATE_RANGE_ATTACK1 ) ||
( GetOuter()->CapabilitiesGet() & bits_CAP_INNATE_RANGE_ATTACK2 ) );
}
开发者ID:BG2-Dev-Team,项目名称:BG2-Code,代码行数:6,代码来源:ai_moveshoot.cpp
示例18: sizeof
//-----------------------------------------------------------------------------
// Purpose: Dispatches the result
// Input : *response -
//-----------------------------------------------------------------------------
bool CAI_Expresser::SpeakDispatchResponse( AIConcept_t concept, AI_Response *result, IRecipientFilter *filter /* = NULL */ )
{
char response[ 256 ];
result->GetResponse( response, sizeof( response ) );
float delay = result->GetDelay();
bool spoke = false;
soundlevel_t soundlevel = result->GetSoundLevel();
if ( IsSpeaking() && concept[0] != 0 )
{
DevMsg( "SpeakDispatchResponse: Entity ( %i/%s ) already speaking, forcing '%s'\n", GetOuter()->entindex(), STRING( GetOuter()->GetEntityName() ), concept );
// Tracker 15911: Can break the game if we stop an imported map placed lcs here, so only
// cancel actor out of instanced scripted scenes. ywb
RemoveActorFromScriptedScenes( GetOuter(), true /*instanced scenes only*/ );
GetOuter()->SentenceStop();
if ( IsRunningScriptedScene( GetOuter() ) )
{
DevMsg( "SpeakDispatchResponse: Entity ( %i/%s ) refusing to speak due to scene entity, tossing '%s'\n", GetOuter()->entindex(), STRING( GetOuter()->GetEntityName() ), concept );
delete result;
return false;
}
}
switch ( result->GetType() )
{
default:
case RESPONSE_NONE:
break;
case RESPONSE_SPEAK:
{
if ( !result->ShouldntUseScene() )
{
// This generates a fake CChoreoScene wrapping the sound.txt name
spoke = SpeakAutoGeneratedScene( response, delay );
}
else
{
float speakTime = GetResponseDuration( result );
GetOuter()->EmitSound( response );
DevMsg( "SpeakDispatchResponse: Entity ( %i/%s ) playing sound '%s'\n", GetOuter()->entindex(), STRING( GetOuter()->GetEntityName() ), response );
NoteSpeaking( speakTime, delay );
spoke = true;
}
}
break;
case RESPONSE_SENTENCE:
{
spoke = ( -1 != SpeakRawSentence( response, delay, VOL_NORM, soundlevel ) ) ? true : false;
}
break;
case RESPONSE_SCENE:
{
spoke = SpeakRawScene( response, delay, result, filter );
}
break;
case RESPONSE_RESPONSE:
{
// This should have been recursively resolved already
Assert( 0 );
}
break;
case RESPONSE_PRINT:
{
if ( g_pDeveloper->GetInt() > 0 )
{
Vector vPrintPos;
GetOuter()->CollisionProp()->NormalizedToWorldSpace( Vector(0.5,0.5,1.0f), &vPrintPos );
NDebugOverlay::Text( vPrintPos, response, true, 1.5 );
spoke = true;
}
}
break;
}
if ( spoke )
{
m_flLastTimeAcceptedSpeak = gpGlobals->curtime;
if ( DebuggingSpeech() && g_pDeveloper->GetInt() > 0 && response && result->GetType() != RESPONSE_PRINT )
{
Vector vPrintPos;
GetOuter()->CollisionProp()->NormalizedToWorldSpace( Vector(0.5,0.5,1.0f), &vPrintPos );
NDebugOverlay::Text( vPrintPos, CFmtStr( "%s: %s", concept, response ), true, 1.5 );
}
if ( result->IsApplyContextToWorld() )
{
//.........这里部分代码省略.........
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:101,代码来源:ai_speech.cpp
示例19: switch
//-----------------------------------------------------------------------------
// Computes the surrounding collision bounds based on whatever algorithm we want...
//-----------------------------------------------------------------------------
void CCollisionProperty::ComputeSurroundingBox( Vector *pVecWorldMins, Vector *pVecWorldMaxs )
{
if (( GetSolid() == SOLID_CUSTOM ) && (m_nSurroundType != USE_GAME_CODE ))
{
// NOTE: This can only happen in transition periods, say during network
// reception on the client. We expect USE_GAME_CODE to be used with SOLID_CUSTOM
*pVecWorldMins = GetCollisionOrigin();
*pVecWorldMaxs = *pVecWorldMins;
return;
}
switch( m_nSurroundType )
{
case USE_OBB_COLLISION_BOUNDS:
{
Assert( GetSolid() != SOLID_CUSTOM );
bool bUseVPhysics = false;
if ( ( GetSolid() == SOLID_VPHYSICS ) && ( GetOuter()->GetMoveType() == MOVETYPE_VPHYSICS ) )
{
// UNDONE: This may not be necessary any more.
IPhysicsObject *pPhysics = GetOuter()->VPhysicsGetObject();
bUseVPhysics = pPhysics && pPhysics->IsAsleep();
}
ComputeCollisionSurroundingBox( bUseVPhysics, pVecWorldMins, pVecWorldMaxs );
}
break;
case USE_BEST_COLLISION_BOUNDS:
Assert( GetSolid() != SOLID_CUSTOM );
ComputeCollisionSurroundingBox( (GetSolid() == SOLID_VPHYSICS), pVecWorldMins, pVecWorldMaxs );
break;
case USE_COLLISION_BOUNDS_NEVER_VPHYSICS:
Assert( GetSolid() != SOLID_CUSTOM );
ComputeCollisionSurroundingBox( false, pVecWorldMins, pVecWorldMaxs );
break;
case USE_HITBOXES:
ComputeHitboxSurroundingBox( pVecWorldMins, pVecWorldMaxs );
break;
case USE_ROTATION_EXPANDED_BOUNDS:
ComputeRotationExpandedBounds( pVecWorldMins, pVecWorldMaxs );
break;
case USE_SPECIFIED_BOUNDS:
VectorAdd( GetCollisionOrigin(), m_vecSpecifiedSurroundingMins, *pVecWorldMins );
VectorAdd( GetCollisionOrigin(), m_vecSpecifiedSurroundingMaxs, *pVecWorldMaxs );
break;
case USE_GAME_CODE:
GetOuter()->ComputeWorldSpaceSurroundingBox( pVecWorldMins, pVecWorldMaxs );
Assert( pVecWorldMins->x <= pVecWorldMaxs->x );
Assert( pVecWorldMins->y <= pVecWorldMaxs->y );
Assert( pVecWorldMins->z <= pVecWorldMaxs->z );
return;
}
#ifdef DEBUG
/*
// For debugging purposes, make sure the bounds actually does surround the thing.
// Otherwise the optimization we were using isn't really all that great, is it?
Vector vecTestMins, vecTestMaxs;
ComputeCollisionSurroundingBox( (GetSolid() == SOLID_VPHYSICS), &vecTestMins, &vecTestMaxs );
// Now that we have the basics, let's expand for hitboxes if appropriate
Vector vecWorldHitboxMins, vecWorldHitboxMaxs;
if ( ComputeHitboxSurroundingBox( &vecWorldHitboxMins, &vecWorldHitboxMaxs ) )
{
VectorMin( vecWorldHitboxMaxs, vecTestMins, vecTestMins );
VectorMax( vecWorldHitboxMaxs, vecTestMaxs, vecTestMaxs );
}
Assert( vecTestMins.x >= pVecWorldMins->x && vecTestMins.y >= pVecWorldMins->y && vecTestMins.z >= pVecWorldMins->z );
Assert( vecTestMaxs.x <= pVecWorldMaxs->x && vecTestMaxs.y <= pVecWorldMaxs->y && vecTestMaxs.z <= pVecWorldMaxs->z );
*/
#endif
}
开发者ID:newroob,项目名称:bg2-2007,代码行数:81,代码来源:collisionproperty.cpp
示例20: SpeechMsg
void CAI_Expresser::BlockSpeechUntil( float time )
{
SpeechMsg( GetOuter(), "BlockSpeechUntil(%f) %f\n", time, time - gpGlobals->curtime );
m_flBlockedTalkTime = time;
}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:5,代码来源:ai_speech.cpp
注:本文中的GetOuter函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论