upload
This commit is contained in:
commit
dd42f84140
21
AkAudio/Classes/ActorFactoryAKAmbientSound.uc
Normal file
21
AkAudio/Classes/ActorFactoryAKAmbientSound.uc
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
class ActorFactoryAkAmbientSound extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor(const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData);
|
||||||
|
virtual UBOOL CanCreateActor(FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE);
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
|
||||||
|
var() AKEvent AmbientEvent;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add AkAmbientSound"
|
||||||
|
NewActorClass=class'AKAudio.AKAmbientSound'
|
||||||
|
}
|
51
AkAudio/Classes/AkAmbientSound.uc
Normal file
51
AkAudio/Classes/AkAmbientSound.uc
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// Ambient sound, sits there and emits its sound.
|
||||||
|
// Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
|
||||||
|
//=============================================================================
|
||||||
|
class AkAmbientSound extends Keypoint native;
|
||||||
|
|
||||||
|
/** Should the audio component automatically play on load? */
|
||||||
|
//var() bool bAutoPlay; Not showing this parameter to user since it is not working properly yet.
|
||||||
|
var bool bAutoPlay;
|
||||||
|
|
||||||
|
/** Audio component to play */
|
||||||
|
var() AkEvent PlayEvent;
|
||||||
|
|
||||||
|
var() bool StopWhenOwnerIsDestroyed;
|
||||||
|
|
||||||
|
/** Is the audio component currently playing? */
|
||||||
|
var transient private bool bIsPlaying;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Start and stop the ambience playback
|
||||||
|
*/
|
||||||
|
virtual void StartPlayback();
|
||||||
|
virtual void StopPlayback();
|
||||||
|
|
||||||
|
/** Used by the component to flag the ambient sound as not playing */
|
||||||
|
void Playing( UBOOL in_IsPlaying );
|
||||||
|
|
||||||
|
virtual void FinishDestroy();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Starts audio playback if wanted.
|
||||||
|
*/
|
||||||
|
virtual void UpdateComponentsInternal(UBOOL bCollisionUpdate = FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
Begin Object NAME=Sprite
|
||||||
|
Sprite=Texture2D'AkResources.Wwise'
|
||||||
|
End Object
|
||||||
|
|
||||||
|
bAutoPlay=TRUE
|
||||||
|
StopWhenOwnerIsDestroyed=TRUE
|
||||||
|
bIsPlaying=FALSE
|
||||||
|
|
||||||
|
RemoteRole=ROLE_None
|
||||||
|
}
|
96
AkAudio/Classes/AkComponent.uc
Normal file
96
AkAudio/Classes/AkComponent.uc
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
class AkComponent extends ActorComponent
|
||||||
|
native
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
hidecategories(ActorComponent)
|
||||||
|
editinlinenew;
|
||||||
|
|
||||||
|
var() Name BoneName;
|
||||||
|
var AkEvent AutoPlayEvent;
|
||||||
|
|
||||||
|
/** Stop sound when owner is destroyed */
|
||||||
|
var bool bStopWhenOwnerDestroyed;
|
||||||
|
|
||||||
|
`if(`__TW_WWISE_)
|
||||||
|
/** Whether this component is part of the audio device component pool (set to true in UAkAudioDevice::GetPooledAkComponent) */
|
||||||
|
var transient const bool bPooled;
|
||||||
|
/** Whether this component is ready to be returned to pool. Gets set on the audio thread, while component actually gets returned on the main thread. */
|
||||||
|
var transient const bool bWaitingToReturnToPool;
|
||||||
|
/** Whether sound should follow owner position */
|
||||||
|
var transient const bool bFollowOwnerPosition;
|
||||||
|
/** Whether events being played are modified based on listener distance */
|
||||||
|
var transient bool bUpdateDistanceToListener;
|
||||||
|
/** Whether events being played are modified based on relative velocity to listener (e.g. for Doppler) */
|
||||||
|
var transient bool bUpdateRelativeVelocityToListener;
|
||||||
|
|
||||||
|
/** Whether this component is forced to use its own OcclusionUpdateInterval (set in defaultproperties) or can adopt a posted event's interval */
|
||||||
|
var bool bForceOcclusionUpdateInterval; // JDR: can't be transient because we set this in default properties
|
||||||
|
/** How often to update occlusion or obstruction. Zero means never update. Is set per posted event unless bForceOcclusionUpdateInterval is true. */
|
||||||
|
var float OcclusionUpdateInterval; // JDR: can't be transient because we set this in default properties
|
||||||
|
/** last time we updated occlusion */
|
||||||
|
var transient float LastOcclusionUpdateTime;
|
||||||
|
/** whether we were occluded the last time we checked */
|
||||||
|
var transient bool bWasOccluded;
|
||||||
|
|
||||||
|
/** Maximum attenuation value of all events played on this component (gets reset when/if component is returned to component pool)*/
|
||||||
|
var transient float MaxAttenuationValue;
|
||||||
|
|
||||||
|
/** The specific location to play this sound. Bone locations specified in BoneName will override this. If not specified plays from the attached actor's location */
|
||||||
|
var transient vector Location;
|
||||||
|
/** The relative location to play this sound on based on the location of the actor this component is attached to. Directly setting the location will override this */
|
||||||
|
var transient vector RelativeLocation;
|
||||||
|
|
||||||
|
/** AK::SoundEngine::Query calls (such as GetPosition (of game object)) can take milliseconds (bad).
|
||||||
|
* Instead, just cache each game object's (AkComponent) position at the same time that it's passed off to the SoundEngine (in SetObjectPosition).
|
||||||
|
*/
|
||||||
|
var transient vector CachedObjectPosition;
|
||||||
|
|
||||||
|
/** AkEvent to play when this AKComponent stops playing */
|
||||||
|
var transient AkEvent StopPlayEvent;
|
||||||
|
|
||||||
|
/** Filled by AkEvents when they're posted. Reset when/if component is returned to pool */
|
||||||
|
var transient array<name> CustomRTPCNames;
|
||||||
|
|
||||||
|
/** Stops all events being played on this component */
|
||||||
|
native function StopEvents();
|
||||||
|
|
||||||
|
/** Play the given event directly on this component (doesn't go through PlaySoundBase, requires custom replication if desired) */
|
||||||
|
native function PlayEvent( AkEvent in_Event, optional bool bIsSpatialized, optional bool bIsOccluded, optional bool bDoNotCheckOcclusion );
|
||||||
|
|
||||||
|
/** Sets a real-time parameter control on this component */
|
||||||
|
native function SetRTPCValue( string RTPCString, float RTPCValue );
|
||||||
|
|
||||||
|
/** Checks if this component is playing any event, or a specific event if one is provided */
|
||||||
|
native function bool IsPlaying( optional AkEvent Event );
|
||||||
|
|
||||||
|
`endif // __TW_WWISE_
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
// Object interface.
|
||||||
|
virtual void Serialize(FArchive& Ar);
|
||||||
|
virtual void Attach();
|
||||||
|
virtual void Detach( UBOOL bWillReattach = FALSE );
|
||||||
|
virtual void FinishDestroy();
|
||||||
|
virtual void ShutdownAfterError();
|
||||||
|
|
||||||
|
// Methods
|
||||||
|
void UnregisterGameObject();
|
||||||
|
void Stop();
|
||||||
|
|
||||||
|
#if __TW_WWISE_
|
||||||
|
// determines if this component should check occlusion
|
||||||
|
virtual bool ShouldUpdateOcclusion();
|
||||||
|
// determines if the listener is witin the max attenuation range of the component
|
||||||
|
virtual bool ListenerWithinMaxRange( INT ListenerIndex = 0 );
|
||||||
|
// checks occlusion (AudioComponent::CheckOcclusion)
|
||||||
|
virtual void UpdateOcclusion( INT ListenerIndex = 0);
|
||||||
|
#endif // __TW_WWISE_
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
`if(`__TW_WWISE_)
|
||||||
|
bFollowOwnerPosition=True
|
||||||
|
`endif
|
||||||
|
}
|
44
AkAudio/Classes/InterpTrackAkEvent.uc
Normal file
44
AkAudio/Classes/InterpTrackAkEvent.uc
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
class InterpTrackAkEvent extends InterpTrack
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
// InterpTrack interface
|
||||||
|
virtual INT GetNumKeyframes() const;
|
||||||
|
virtual void GetTimeRange(FLOAT& StartTime, FLOAT& EndTime) const;
|
||||||
|
virtual FLOAT GetKeyframeTime(INT KeyIndex) const;
|
||||||
|
virtual INT AddKeyframe(FLOAT Time, UInterpTrackInst* TrInst, EInterpCurveMode InitInterpMode);
|
||||||
|
virtual INT SetKeyframeTime(INT KeyIndex, FLOAT NewKeyTime, UBOOL bUpdateOrder=true);
|
||||||
|
virtual void RemoveKeyframe(INT KeyIndex);
|
||||||
|
virtual INT DuplicateKeyframe(INT KeyIndex, FLOAT NewKeyTime);
|
||||||
|
virtual UBOOL GetClosestSnapPosition(FLOAT InPosition, TArray<INT> &IgnoreKeys, FLOAT& OutPosition);
|
||||||
|
|
||||||
|
virtual void PreviewUpdateTrack(FLOAT NewPosition, UInterpTrackInst* TrInst);
|
||||||
|
virtual void UpdateTrack(FLOAT NewPosition, UInterpTrackInst* TrInst, UBOOL bJump);
|
||||||
|
|
||||||
|
/** Get the name of the class used to help out when adding tracks, keys, etc. in UnrealEd.
|
||||||
|
* @return String name of the helper class.*/
|
||||||
|
virtual const FString GetEdHelperClassName() const;
|
||||||
|
|
||||||
|
virtual class UMaterial* GetTrackIcon() const;
|
||||||
|
virtual void DrawTrack( FCanvas* Canvas, UInterpGroup* Group, const FInterpTrackDrawParams& Params );
|
||||||
|
|
||||||
|
// InterpTrackAkEvent interface
|
||||||
|
UAkEvent* GetAkEventAtPosition(FLOAT InPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Information for one sound in the track. */
|
||||||
|
struct native AkEventTrackKey
|
||||||
|
{
|
||||||
|
var float Time;
|
||||||
|
var() AkEvent Event;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Array of sounds to play at specific times. */
|
||||||
|
var array<AkEventTrackKey> AkEvents;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
TrackInstClass=class'AkAudio.InterpTrackInstAkEvent'
|
||||||
|
TrackTitle="AkEvent"
|
||||||
|
}
|
26
AkAudio/Classes/InterpTrackAkRTPC.uc
Normal file
26
AkAudio/Classes/InterpTrackAkRTPC.uc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
class InterpTrackAkRTPC extends InterpTrackFloatBase
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
// InterpTrack interface
|
||||||
|
virtual INT AddKeyframe(FLOAT Time, UInterpTrackInst* TrInst, EInterpCurveMode InitInterpMode);
|
||||||
|
virtual void UpdateKeyframe(INT KeyIndex, UInterpTrackInst* TrInst);
|
||||||
|
virtual void PreviewUpdateTrack(FLOAT NewPosition, UInterpTrackInst* TrInst);
|
||||||
|
virtual void UpdateTrack(FLOAT NewPosition, UInterpTrackInst* TrInst, UBOOL bJump);
|
||||||
|
|
||||||
|
/** Get the name of the class used to help out when adding tracks, keys, etc. in UnrealEd.
|
||||||
|
* @return String name of the helper class.*/
|
||||||
|
virtual const FString GetEdHelperClassName() const;
|
||||||
|
|
||||||
|
virtual class UMaterial* GetTrackIcon() const;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Name of game parameter */
|
||||||
|
var() string Param;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
TrackInstClass=class'AkAudio.InterpTrackInstAkRTPC'
|
||||||
|
TrackTitle="AkRTPC"
|
||||||
|
}
|
14
AkAudio/Classes/InterpTrackInstAkEvent.uc
Normal file
14
AkAudio/Classes/InterpTrackInstAkEvent.uc
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
class InterpTrackInstAkEvent extends InterpTrackInst
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void InitTrackInst(UInterpTrack* Track);
|
||||||
|
virtual void TermTrackInst(UInterpTrack* Track);
|
||||||
|
}
|
||||||
|
|
||||||
|
var float LastUpdatePosition;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
}
|
12
AkAudio/Classes/InterpTrackInstAkRTPC.uc
Normal file
12
AkAudio/Classes/InterpTrackInstAkRTPC.uc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
class InterpTrackInstAkRTPC extends InterpTrackInst
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void InitTrackInst(UInterpTrack* Track);
|
||||||
|
virtual void TermTrackInst(UInterpTrack* Track);
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
}
|
17
AkAudio/Classes/SeqAct_AkClearBanks.uc
Normal file
17
AkAudio/Classes/SeqAct_AkClearBanks.uc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
class SeqAct_AkClearBanks extends SequenceAction
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void Activated();
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ObjName="AkClearBanks"
|
||||||
|
ObjCategory="AkAudio"
|
||||||
|
|
||||||
|
VariableLinks.Empty
|
||||||
|
|
||||||
|
InputLinks(0)=(LinkDesc="ClearBanks")
|
||||||
|
}
|
33
AkAudio/Classes/SeqAct_AkLoadBank.uc
Normal file
33
AkAudio/Classes/SeqAct_AkLoadBank.uc
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
class SeqAct_AkLoadBank extends SeqAct_Latent
|
||||||
|
native;
|
||||||
|
|
||||||
|
var() bool Async; // Asynchronous loading
|
||||||
|
var() AkBank Bank; // Bank to be loaded / unloaded
|
||||||
|
var transient int Signal; // signal (event) used during async load
|
||||||
|
|
||||||
|
var transient bool bWaitingCallback;// true if the ojbect must cancel a cookie on destroy.
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void Activated();
|
||||||
|
UBOOL UpdateOp(FLOAT deltaTime);
|
||||||
|
|
||||||
|
virtual void BeginDestroy();
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ObjName="AkLoadBank"
|
||||||
|
ObjCategory="AkAudio"
|
||||||
|
|
||||||
|
VariableLinks.Empty
|
||||||
|
OutputLinks.Empty
|
||||||
|
|
||||||
|
Async = TRUE
|
||||||
|
bWaitingCallback = FALSE
|
||||||
|
|
||||||
|
InputLinks(0)=(LinkDesc="Load")
|
||||||
|
InputLinks(1)=(LinkDesc="Unload")
|
||||||
|
|
||||||
|
OutputLinks(0)=(LinkDesc="Finished")
|
||||||
|
}
|
32
AkAudio/Classes/SeqAct_AkPostEvent.uc
Normal file
32
AkAudio/Classes/SeqAct_AkPostEvent.uc
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
class SeqAct_AkPostEvent extends SeqAct_Latent
|
||||||
|
native;
|
||||||
|
|
||||||
|
var transient int Signal; // signal (event) used for EndOfEvent
|
||||||
|
`if(`__TW_WWISE_)
|
||||||
|
/** If TRUE, will use PlayAkEvent() instead of the audio device to trigger the AkEvent on clients */
|
||||||
|
var() bool bReplicateToClients;
|
||||||
|
`endif
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void FinishDestroy();
|
||||||
|
|
||||||
|
void Activated();
|
||||||
|
UBOOL UpdateOp(FLOAT deltaTime);
|
||||||
|
private:
|
||||||
|
void PlayEventOnTargets();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Event to post on the targeted actor(s) */
|
||||||
|
var() AkEvent Event;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ObjName="AkPostEvent"
|
||||||
|
ObjCategory="AkAudio"
|
||||||
|
|
||||||
|
OutputLinks.Empty
|
||||||
|
|
||||||
|
InputLinks(0)=(LinkDesc="Post")
|
||||||
|
|
||||||
|
OutputLinks(0)=(LinkDesc="Finished")
|
||||||
|
}
|
17
AkAudio/Classes/SeqAct_AkPostTrigger.uc
Normal file
17
AkAudio/Classes/SeqAct_AkPostTrigger.uc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
class SeqAct_AkPostTrigger extends SequenceAction
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void Activated();
|
||||||
|
};
|
||||||
|
|
||||||
|
var() string Trigger;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ObjName="AkPostTrigger"
|
||||||
|
ObjCategory="AkAudio"
|
||||||
|
|
||||||
|
InputLinks(0)=(LinkDesc="Post")
|
||||||
|
}
|
33
AkAudio/Classes/SeqAct_AkSetRTPCValue.uc
Normal file
33
AkAudio/Classes/SeqAct_AkSetRTPCValue.uc
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
class SeqAct_AkSetRTPCValue extends SeqAct_Latent
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void Activated();
|
||||||
|
UBOOL UpdateOp(FLOAT deltaTime);
|
||||||
|
private:
|
||||||
|
void SetRTPCValue();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Name of game parameter */
|
||||||
|
var() string Param;
|
||||||
|
|
||||||
|
/** Value of game parameter, default value used if no variable linked */
|
||||||
|
var() float Value;
|
||||||
|
|
||||||
|
/** True when sending RTPC signal */
|
||||||
|
var transient bool Running;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ObjName="AkSetRTPCValue"
|
||||||
|
ObjCategory="AkAudio"
|
||||||
|
|
||||||
|
OutputLinks.Empty
|
||||||
|
|
||||||
|
InputLinks(0)=(LinkDesc="Start")
|
||||||
|
InputLinks(1)=(LinkDesc="Stop")
|
||||||
|
VariableLinks(1)=(ExpectedType=class'SeqVar_Float',LinkDesc="Value",PropertyName=Value)
|
||||||
|
|
||||||
|
OutputLinks(0)=(LinkDesc="Finished")
|
||||||
|
}
|
20
AkAudio/Classes/SeqAct_AkSetState.uc
Normal file
20
AkAudio/Classes/SeqAct_AkSetState.uc
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
class SeqAct_AkSetState extends SequenceAction
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void Activated();
|
||||||
|
};
|
||||||
|
|
||||||
|
var() string StateGroup;
|
||||||
|
var() string State;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ObjName="AkSetState"
|
||||||
|
ObjCategory="AkAudio"
|
||||||
|
|
||||||
|
VariableLinks.Empty
|
||||||
|
|
||||||
|
InputLinks(0)=(LinkDesc="Set")
|
||||||
|
}
|
18
AkAudio/Classes/SeqAct_AkSetSwitch.uc
Normal file
18
AkAudio/Classes/SeqAct_AkSetSwitch.uc
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
class SeqAct_AkSetSwitch extends SequenceAction
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void Activated();
|
||||||
|
};
|
||||||
|
|
||||||
|
var() string SwitchGroup;
|
||||||
|
var() string Switch;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ObjName="AkSetSwitch"
|
||||||
|
ObjCategory="AkAudio"
|
||||||
|
|
||||||
|
InputLinks(0)=(LinkDesc="Set")
|
||||||
|
}
|
18
AkAudio/Classes/SeqAct_AkStartAmbientSound.uc
Normal file
18
AkAudio/Classes/SeqAct_AkStartAmbientSound.uc
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
class SeqAct_AkStartAmbientSound extends SequenceAction
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void Activated();
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ObjName="AkStartAmbientSound"
|
||||||
|
ObjCategory="AkAudio"
|
||||||
|
|
||||||
|
InputLinks(0)=(LinkDesc="Start All")
|
||||||
|
InputLinks(1)=(LinkDesc="Stop All")
|
||||||
|
InputLinks(2)=(LinkDesc="Start Target(s)")
|
||||||
|
InputLinks(3)=(LinkDesc="Stop Targets(s)")
|
||||||
|
}
|
17
AkAudio/Classes/SeqAct_AkStopAll.uc
Normal file
17
AkAudio/Classes/SeqAct_AkStopAll.uc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
class SeqAct_AkStopAll extends SequenceAction
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void Activated();
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ObjName="AkStopAll"
|
||||||
|
ObjCategory="AkAudio"
|
||||||
|
|
||||||
|
VariableLinks.Empty
|
||||||
|
|
||||||
|
InputLinks(0)=(LinkDesc="StopAll")
|
||||||
|
}
|
244
BaseAI/Classes/AIDebugTool.uc
Normal file
244
BaseAI/Classes/AIDebugTool.uc
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AIDebugTool
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class AIDebugTool extends Object
|
||||||
|
dependson(BaseAIController)
|
||||||
|
config(AI)
|
||||||
|
native(Debug);
|
||||||
|
|
||||||
|
var transient float GameFrameTime;
|
||||||
|
|
||||||
|
var int BTPersonalLogSize;
|
||||||
|
var array<string> BTPersonalLog;
|
||||||
|
|
||||||
|
var BaseAIController DebugTarget;
|
||||||
|
var int EntryToDisplay;
|
||||||
|
|
||||||
|
var transient init array<name> Filters;
|
||||||
|
var array<name> ColorCategories;
|
||||||
|
|
||||||
|
var array<Actor> UnreachableActors;
|
||||||
|
|
||||||
|
enum ELogDrawingMode
|
||||||
|
{
|
||||||
|
AIDH_DrawAll,
|
||||||
|
AIDH_EntryDetails,
|
||||||
|
AIDH_BlackBoard,
|
||||||
|
AIDH_Preconditions,
|
||||||
|
AIDH_SquadEnemy,
|
||||||
|
AIDH_Animation,
|
||||||
|
AIDH_Weapon
|
||||||
|
};
|
||||||
|
var int DrawingFlags;
|
||||||
|
|
||||||
|
struct String_Mirror
|
||||||
|
{
|
||||||
|
var string Value;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct native AIDebugLogLine
|
||||||
|
{
|
||||||
|
var native String_Mirror Line{FString};
|
||||||
|
var native Name LineCategory;
|
||||||
|
//@todo Add additional data, like position, hit info, etc
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
FAIDebugLogLine(const TCHAR* PtrLine, FName inCategory = NAME_None)
|
||||||
|
{
|
||||||
|
Line = PtrLine;
|
||||||
|
LineCategory = inCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
FAIDebugLogLine(const FString& LineIn, FName inCategory = NAME_None)
|
||||||
|
{
|
||||||
|
Line = LineIn;
|
||||||
|
LineCategory = inCategory;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct native AIDebugLogEntry
|
||||||
|
{
|
||||||
|
var float TimeStamp;
|
||||||
|
var vector WorldPosition;
|
||||||
|
var vector EnemyPosition;
|
||||||
|
var vector Facing;
|
||||||
|
var native String_Mirror BTStatus{FString};
|
||||||
|
var native array<String_Mirror> BlackBoardEntries{FString};
|
||||||
|
var native array<String_Mirror> BehaviorTrace{FString};
|
||||||
|
var native array<String_Mirror> Preconditions{FString};
|
||||||
|
var native array<String_Mirror> CommandStack{FString};
|
||||||
|
var native array<String_Mirror> SquadEnemyList{FString};
|
||||||
|
var native array<String_Mirror> LocalEnemyList{FString};
|
||||||
|
var native array<String_Mirror> InnerState{FString};
|
||||||
|
var native array<String_Mirror> AnimationProxy{FString};
|
||||||
|
var native array<vector> Route;
|
||||||
|
var native init array<SpaceLineInfo> DebugLines;
|
||||||
|
var native array<String_Mirror> WeaponInfo{FString};
|
||||||
|
var array<AIDebugLogLine> Lines;
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
FAIDebugLogEntry()
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FAIDebugLogEntry));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct native AIDebugActorsLog
|
||||||
|
{
|
||||||
|
var int Tail;
|
||||||
|
var array<AIDebugLogEntry> Entries;
|
||||||
|
var int NotEmptyElements;
|
||||||
|
|
||||||
|
/** this variable is used for pooling. DO NOT CHANGE! */
|
||||||
|
var private const int nIndex;
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
|
||||||
|
enum { LogSize = 500 };
|
||||||
|
|
||||||
|
FAIDebugActorsLog(UBOOL bInit = TRUE)
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FAIDebugLogEntry));
|
||||||
|
if(bInit)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCEINLINE void Init()
|
||||||
|
{
|
||||||
|
Entries.Reserve(LogSize);
|
||||||
|
Entries.AddZeroed(LogSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCEINLINE void Reset()
|
||||||
|
{
|
||||||
|
Entries.Empty(LogSize);
|
||||||
|
Entries.AddZeroed(LogSize);
|
||||||
|
NotEmptyElements = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Pooling interface Get*/
|
||||||
|
FORCEINLINE INT GetIndex() const
|
||||||
|
{
|
||||||
|
return nIndex;
|
||||||
|
}
|
||||||
|
/** Pooling interface Set*/
|
||||||
|
FORCEINLINE void SetIndex(INT index)
|
||||||
|
{
|
||||||
|
nIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SaveToFile(FArchive* File);
|
||||||
|
void LoadFile(FArchive* File, UBOOL bLoadOldLogs = FALSE);
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct native ETQDebugEntry
|
||||||
|
{
|
||||||
|
var float TimeStamp;
|
||||||
|
var native init array<String_Mirror> ExecutedQueries{FString};
|
||||||
|
};
|
||||||
|
var transient ETQDebugEntry CurrentETQLog;
|
||||||
|
var init array<ETQDebugEntry> ETQLogHistory;
|
||||||
|
|
||||||
|
var bool bLoadOldLogs;
|
||||||
|
|
||||||
|
var transient Actor LoggingContext;
|
||||||
|
|
||||||
|
var native const Map_Mirror Logs{TMap<const AActor*, FAIDebugActorsLog*>};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draws stored log for given Actor. If Actor == None than contents of loaded
|
||||||
|
* ailogex file are displayed
|
||||||
|
*/
|
||||||
|
final native function DrawLog(Canvas Canvas, Actor Actor);
|
||||||
|
final native function bool LoadLogFile(string FileName, optional bool bAppendMapName = true);
|
||||||
|
final native function FlushLogs(optional string DirName, optional BaseAIController AI);
|
||||||
|
|
||||||
|
final native function SetDebugTarget(BaseAIController NewDebugTarget);
|
||||||
|
|
||||||
|
final native noexport function Log(Actor Actor, string LogText, optional Name LogCategory);
|
||||||
|
final native noexport function LogSpaceLine(Actor Actor, vector Start, vector End, EDebugLineType Type, optional string Comment, optional Name Category);
|
||||||
|
|
||||||
|
final native function SetContext(Actor Actor);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To get previous entries send a negative number as a parameter
|
||||||
|
*/
|
||||||
|
final native function DisplayNextEntry(optional int Count = 1, optional int Direction = 1);
|
||||||
|
|
||||||
|
final native function ToggleLogDrawingMode(ELogDrawingMode Mode);
|
||||||
|
|
||||||
|
final native function SetHistoryFilter(Name Filter, bool bVal);
|
||||||
|
final native function ClearHistoryFilter();
|
||||||
|
|
||||||
|
final native function ColorHistory(Name Filter);
|
||||||
|
final native function ClearHistoryColor();
|
||||||
|
|
||||||
|
final native function LogUnreachableActor(Actor inActor);
|
||||||
|
final native function FlushUnreachableActors();
|
||||||
|
|
||||||
|
final native function AddETQLog(string QueryName, string TestName, Actor Querier);
|
||||||
|
final native function FlushETQHistory();
|
||||||
|
|
||||||
|
final native function AddBTLogEntry(string Entry);
|
||||||
|
|
||||||
|
final native function Vector GetActorEntryLocation(optional Actor inActor, optional int Index=-1);
|
||||||
|
|
||||||
|
final native function DumpNativeCallStack(Actor Actor, optional Name LogCategory = 'CallStack');
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void Init();
|
||||||
|
void Tick(FLOAT DeltaTime);
|
||||||
|
void CleanUp(UBOOL bShutDown);
|
||||||
|
|
||||||
|
void FlushAILog(class AActor* Actor, UBOOL bRemoveLog = FALSE);
|
||||||
|
|
||||||
|
enum EAILogElement
|
||||||
|
{
|
||||||
|
AILE_PrevChannel,
|
||||||
|
AILE_Command,
|
||||||
|
AILE_Timestamp,
|
||||||
|
AILE_BlackBoard,
|
||||||
|
AILE_BehaviorStack,
|
||||||
|
AILE_Preconditions,
|
||||||
|
AILE_CommandStack,
|
||||||
|
AILE_SquadEnemies,
|
||||||
|
AILE_LocalEnemies,
|
||||||
|
AILE_Route,
|
||||||
|
AILE_InnerState,
|
||||||
|
AILE_WeaponInfo
|
||||||
|
};
|
||||||
|
|
||||||
|
void Log(const class AActor* Actor,const FString& LogText,FName LogCategory=NAME_None);
|
||||||
|
void LogSpaceLine(const class AActor* Actor,const FVector& Start,const FVector& End,BYTE Type,const FString& Comment=TEXT(""),FName Category=NAME_None);
|
||||||
|
void ContextLog(const FString& LogText,FName LogCategory=NAME_None);
|
||||||
|
void ContextLogSpaceLine(const FVector& Start,const FVector& End,BYTE Type,const FString& Comment=TEXT(""),FName Category=NAME_None);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void ChannelEntryHeader(const class AActor* Actor, FAIDebugLogEntry* ptrEntry);
|
||||||
|
UBOOL HasAnyLines(struct FAIDebugActorsLog* Log, INT EntryIdx, TArray<FName>& inFilters) const;
|
||||||
|
FAIDebugLogEntry* GetLogEntry(const class AActor* Actor);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static TDataBank<FAIDebugActorsLog> sm_Logs;
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
BTPersonalLogSize=23
|
||||||
|
bLoadOldLogs=false
|
||||||
|
}
|
90
BaseAI/Classes/AIPlugin.uc
Normal file
90
BaseAI/Classes/AIPlugin.uc
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AIPlugin
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class AIPlugin extends PluginBase within BaseAIController
|
||||||
|
native(Plugin)
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
var const protected{protected} BaseAIController MyBaseAIController;
|
||||||
|
var const protected{private} bool bCustomSetupController;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual UBOOL SetupController(class ABaseAIController* Owner);
|
||||||
|
// Called if bCustomSetupController == true
|
||||||
|
virtual UBOOL SetupControllerImpl(class ABaseAIController* Owner) PURE_VIRTUAL(UPluginBase::SetupConrollerImpl, return TRUE;);
|
||||||
|
|
||||||
|
UBOOL HasCustomControllerSetup() const
|
||||||
|
{
|
||||||
|
return bCustomSetupController;
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCEINLINE const ABaseAIController* GetController() const
|
||||||
|
{
|
||||||
|
return MyBaseAIController;
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCEINLINE ABaseAIController* GetController()
|
||||||
|
{
|
||||||
|
return MyBaseAIController;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
event ScriptSetUp()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ===========
|
||||||
|
* DEBUG STATES
|
||||||
|
* ===========
|
||||||
|
*/
|
||||||
|
state DEBUGSTATE
|
||||||
|
{
|
||||||
|
function BeginState( Name PreviousStateName )
|
||||||
|
{
|
||||||
|
//debug
|
||||||
|
`AILog( "BEGINSTATE"@PreviousStateName, 'State' );
|
||||||
|
}
|
||||||
|
|
||||||
|
function EndState( Name NextStateName )
|
||||||
|
{
|
||||||
|
//debug
|
||||||
|
`AILog( "ENDSTATE"@NextStateName, 'State' );
|
||||||
|
}
|
||||||
|
|
||||||
|
function PushedState()
|
||||||
|
{
|
||||||
|
//debug
|
||||||
|
`AILog( "PUSHED", 'State' );
|
||||||
|
}
|
||||||
|
|
||||||
|
function PoppedState()
|
||||||
|
{
|
||||||
|
//debug
|
||||||
|
`AILog( "POPPED", 'State' );
|
||||||
|
}
|
||||||
|
|
||||||
|
function ContinuedState()
|
||||||
|
{
|
||||||
|
//debug
|
||||||
|
`AILog( "CONTINUED", 'State' );
|
||||||
|
}
|
||||||
|
|
||||||
|
function PausedState()
|
||||||
|
{
|
||||||
|
//debug
|
||||||
|
`AILog( "PAUSED", 'State' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bCustomSetupController=false
|
||||||
|
}
|
413
BaseAI/Classes/AIPluginLeap.uc
Normal file
413
BaseAI/Classes/AIPluginLeap.uc
Normal file
@ -0,0 +1,413 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AIPluginLeap
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class AIPluginLeap extends AITickablePlugin within BaseAIController
|
||||||
|
native(Plugin)
|
||||||
|
dependson(NavigationPath)
|
||||||
|
abstract
|
||||||
|
config(AI);
|
||||||
|
|
||||||
|
|
||||||
|
//var KFJumpDownNavPoint TheJumpDownNavPointPathObject;
|
||||||
|
|
||||||
|
//var Actor BaseForLeaping;
|
||||||
|
|
||||||
|
//var KFJumpDownNavPoint TheJumpDownNavPointPathObject;
|
||||||
|
//var int LandSpotIndex;
|
||||||
|
|
||||||
|
var Actor BaseForLanding;
|
||||||
|
//var KFJumpDownLandNavPoint LandNavPoint;
|
||||||
|
|
||||||
|
/** Start and End for the leap */
|
||||||
|
var Vector LeapDirection;
|
||||||
|
var transient Vector LocationAtStartOfLeap;
|
||||||
|
var transient Vector ClosestLocOnEdge;
|
||||||
|
|
||||||
|
var transient Vector ExpectedLandingLoc;
|
||||||
|
|
||||||
|
var const public{protected} EActionPriority ActionPriority;
|
||||||
|
|
||||||
|
var const transient bool bObserverNotified;
|
||||||
|
var const transient bool bDontNotifyObserver;
|
||||||
|
var transient bool bDontRestartByKismet;
|
||||||
|
|
||||||
|
|
||||||
|
var float ConfigFactorToIncreaseCalcedLeapVolBy;
|
||||||
|
var float ConfigFactorToIncreasePlottedLeapVolBy;
|
||||||
|
var float ConfigFactorToReduceLeapProjectionSizeBy;
|
||||||
|
|
||||||
|
var float ConfigDistanceOutFromDropEdgeToCalcDropLoc;
|
||||||
|
|
||||||
|
//var transient float DropHeight;
|
||||||
|
|
||||||
|
var float PercentageOfLeapImmuneFromCollision;
|
||||||
|
var float ConfigPercentageOfLeapImmuneFromCollision;
|
||||||
|
|
||||||
|
var bool bCollisionOffPhase;
|
||||||
|
|
||||||
|
var float ConfigDesiredLeapSpeed;
|
||||||
|
var float ConfigMinSpeedAllowed;
|
||||||
|
var float ConfigMaxSpeedAllowed;
|
||||||
|
var float ConfigBaseLeapZ;
|
||||||
|
var float ConfigDesiredZPct;
|
||||||
|
var bool bConfigOnlyTraceUp;
|
||||||
|
|
||||||
|
struct native LeapRequest
|
||||||
|
{
|
||||||
|
//var native MoveParameters MoveParams;
|
||||||
|
var Actor TheJumpDownNavPointPathObject;
|
||||||
|
var int LandSpotIndex;
|
||||||
|
var float EdgesDropHeight;
|
||||||
|
|
||||||
|
var EActionPriority Priority;
|
||||||
|
var const object Observer;
|
||||||
|
|
||||||
|
var int QueryID;
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
FLeapRequest()
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FLeapRequest));
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
FLeapRequest(FLeapRequest* pOther)
|
||||||
|
{
|
||||||
|
if(pOther != NULL)
|
||||||
|
{
|
||||||
|
appMemCopy(*this, *pOther);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FLeapRequest));
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FString GetDescription() const;
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
Priority = AP_Invalid;
|
||||||
|
TheJumpDownNavPointPathObject = NULL;
|
||||||
|
Observer = NULL;
|
||||||
|
LandSpotIndex = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var LeapRequest MyLeapRequest;
|
||||||
|
|
||||||
|
var bool bWantTotalMovementControl;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void ClearMoveInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Simple constructor that pushes a new instance of the command for the AI */
|
||||||
|
function bool Leap( const out LeapRequest InLeapRequest ) // AIController AI, Actor InTheJumpDownNavPointPathObject, int InLandSpotIndex, float InDropHeight )
|
||||||
|
{
|
||||||
|
//DropHeight = InDropHeight;
|
||||||
|
//LandSpotIndex = InLandSpotIndex;
|
||||||
|
//BaseForLeaping = InTheJumpDownNavPointPathObject;
|
||||||
|
|
||||||
|
MyLeapRequest = InLeapRequest;
|
||||||
|
|
||||||
|
ScriptCommonMovePreparation( AP_Logic );
|
||||||
|
|
||||||
|
GotoState( 'Command_SpecialMove' );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Build debug string */
|
||||||
|
event String GetDumpString()
|
||||||
|
{
|
||||||
|
return "LeapDirection:"@LeapDirection;
|
||||||
|
}
|
||||||
|
|
||||||
|
//function Pushed()
|
||||||
|
event bool ScriptCommonMovePreparation(EActionPriority Priority)
|
||||||
|
{
|
||||||
|
bCollisionOffPhase = false;
|
||||||
|
|
||||||
|
//Super.Pushed();
|
||||||
|
|
||||||
|
//GotoState( 'Command_SpecialMove' );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//function Popped()
|
||||||
|
event ScriptCleanUp()
|
||||||
|
{
|
||||||
|
//Super.Popped();
|
||||||
|
Outer.MyBaseAIPawn.bLeaping = false;
|
||||||
|
//bReevaluatePath = TRUE;
|
||||||
|
`AILog( GetFuncName() @ " Turning me on because ScriptCleanUp: " );
|
||||||
|
TurnMeOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
native function protected Success();
|
||||||
|
native function protected Failure();
|
||||||
|
|
||||||
|
native function bool AbortMove(bool bNewRequest);
|
||||||
|
|
||||||
|
state Succeeding `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Leaping - END:"@GetStateName(), 'Leap');
|
||||||
|
Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
state Failing `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Leaping - END:"@GetStateName(), 'Leap');
|
||||||
|
Failure();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this state does nothing. It's here to leave other states when move is aborted,
|
||||||
|
* and to indicate that it happened */
|
||||||
|
state Aborting `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Leaping - Aborted", 'Leap');
|
||||||
|
//AbortMove(false);
|
||||||
|
StopMovement();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this state does nothing. It's here to leave other states when move is aborted,
|
||||||
|
* and to indicate that it happened */
|
||||||
|
state Idling `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Leaping - Idling so doing nothing", 'Leap');
|
||||||
|
//StopMovement();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function TestForTimeToTurnCollisionBackOn()
|
||||||
|
{
|
||||||
|
local float timeDelta;
|
||||||
|
|
||||||
|
if( bCollisionOffPhase )
|
||||||
|
{
|
||||||
|
if( HasPercentOfZDiffBeenCovered() )
|
||||||
|
{
|
||||||
|
`AILog( GetFuncName() @ " Turning me on because HasPercentOfZDiffBeenCovered: " );
|
||||||
|
TurnMeOn();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
timeDelta = WorldInfo.TimeSeconds - Outer.MyBaseAIPawn.TimeStartedLeap;
|
||||||
|
|
||||||
|
if( timeDelta > Outer.MyBaseAIPawn.TimeImmuneWhileLeaping )
|
||||||
|
{
|
||||||
|
`AILog( GetFuncName() @ " Turning me on because of time in leap of: " @ timeDelta );
|
||||||
|
|
||||||
|
TurnMeOn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function bool HasPercentOfZDiffBeenCovered();
|
||||||
|
|
||||||
|
|
||||||
|
function TurnMeOn()
|
||||||
|
{
|
||||||
|
Outer.MyBaseAIPawn.SetCollision( true, true );
|
||||||
|
|
||||||
|
Outer.MyBaseAIPawn.bCollideWorld = true;
|
||||||
|
|
||||||
|
Outer.MyBaseAIPawn.SetPushesRigidBodies(true);
|
||||||
|
|
||||||
|
bCollisionOffPhase = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function vector GetJumpVelForDropEdge( out float TimeToReachLandLoc );
|
||||||
|
|
||||||
|
function vector GetJumpVelForUsingJumpDownNavPointPathObject( out float TimeToReachLandLoc );
|
||||||
|
|
||||||
|
|
||||||
|
state Command_SpecialMove
|
||||||
|
{
|
||||||
|
function BeginState( Name PreviousStateName )
|
||||||
|
{
|
||||||
|
Super.BeginState( PreviousStateName );
|
||||||
|
|
||||||
|
if( MyLeapRequest.TheJumpDownNavPointPathObject != none )
|
||||||
|
{
|
||||||
|
SetDesiredDirectionForJumpDoenNavPointEdge();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetDesiredDirectionForDropEdge();
|
||||||
|
}
|
||||||
|
|
||||||
|
bWantTotalMovementControl = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Bool IfShowLeapDownDebugArtifacts()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function vector GetCurrentJumpEdgeDirectionOfLeap()
|
||||||
|
{
|
||||||
|
return Vector(MyLeapRequest.TheJumpDownNavPointPathObject.Rotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
function float GetDistanceDownRangeToFocusForDropEdgeLeap()
|
||||||
|
{
|
||||||
|
return 500.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//function SetDesiredDirectionForDropEdge()
|
||||||
|
//{
|
||||||
|
// local Vector newFocalPoint;
|
||||||
|
// local float edgesDropHeight;
|
||||||
|
|
||||||
|
// LeapDirection = MyKFNavigationHandle.GetCurrentJumpEdgeDirectionOfLeap( Outer, edgesDropHeight, ClosestLocOnEdge );
|
||||||
|
|
||||||
|
// Focus = none;
|
||||||
|
|
||||||
|
// newFocalPoint = Outer.Pawn.Location + LeapDirection * Outer.DistanceDownRangeToFocusForDropEdgeLeap;
|
||||||
|
|
||||||
|
// SetFocalPoint( newFocalPoint );
|
||||||
|
|
||||||
|
// if( Outer.bShowLeapDownDebugArtifacts )
|
||||||
|
// {
|
||||||
|
// DrawDebugStar( newFocalPoint, 30, 255, 165, 0, true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// SetDesiredRotation(rotator(LeapDirection));
|
||||||
|
//}
|
||||||
|
|
||||||
|
function SetDesiredDirectionForDropEdge()
|
||||||
|
{
|
||||||
|
local Vector newFocalPoint;
|
||||||
|
//local float edgesDropHeight;
|
||||||
|
|
||||||
|
LeapDirection = GetCurrentJumpEdgeDirectionOfLeap();
|
||||||
|
|
||||||
|
Focus = none;
|
||||||
|
|
||||||
|
newFocalPoint = Outer.Pawn.Location + LeapDirection * GetDistanceDownRangeToFocusForDropEdgeLeap();
|
||||||
|
|
||||||
|
SetFocalPoint( newFocalPoint );
|
||||||
|
|
||||||
|
if( IfShowLeapDownDebugArtifacts() ) // Outer.bShowLeapDownDebugArtifacts )
|
||||||
|
{
|
||||||
|
DrawDebugStar( newFocalPoint, 300, 255, 165, 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetDesiredRotation(rotator(LeapDirection));
|
||||||
|
}
|
||||||
|
|
||||||
|
//function SetDesiredDirectionForJumpDoenNavPointEdge()
|
||||||
|
//{
|
||||||
|
// local Vector newFocalPoint;
|
||||||
|
|
||||||
|
// LeapDirection = BaseForLanding.Location - Outer.Pawn.Location;
|
||||||
|
|
||||||
|
// Focus = none;
|
||||||
|
|
||||||
|
// newFocalPoint = BaseForLanding.Location;// Outer.Pawn.Location + LeapDirection * Outer.DistanceDownRangeToFocusForDropEdgeLeap;
|
||||||
|
|
||||||
|
// SetFocalPoint( newFocalPoint );
|
||||||
|
|
||||||
|
// if( Outer.bShowLeapDownDebugArtifacts )
|
||||||
|
// {
|
||||||
|
// DrawDebugStar( newFocalPoint, 30, 255, 165, 0, true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// SetDesiredRotation(rotator(LeapDirection));
|
||||||
|
//}
|
||||||
|
|
||||||
|
function SetDesiredDirectionForJumpDoenNavPointEdge()
|
||||||
|
{
|
||||||
|
local Vector newFocalPoint;
|
||||||
|
|
||||||
|
if( BaseForLanding == none )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LeapDirection = BaseForLanding.Location - Outer.Pawn.Location;
|
||||||
|
|
||||||
|
Focus = none;
|
||||||
|
|
||||||
|
newFocalPoint = BaseForLanding.Location;// Outer.Pawn.Location + LeapDirection * Outer.DistanceDownRangeToFocusForDropEdgeLeap;
|
||||||
|
|
||||||
|
SetFocalPoint( newFocalPoint );
|
||||||
|
|
||||||
|
if( IfShowLeapDownDebugArtifacts() )
|
||||||
|
{
|
||||||
|
DrawDebugStar( newFocalPoint, 300, 255, 165, 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetDesiredRotation(rotator(LeapDirection));
|
||||||
|
}
|
||||||
|
|
||||||
|
function bool DoLeap()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function LeapLoopPreSleepDataUpdate()
|
||||||
|
{
|
||||||
|
//Outer.LeapBehavior.ProjMeshLocations.AddItem(MyKfPawn.Location);
|
||||||
|
}
|
||||||
|
|
||||||
|
Begin:
|
||||||
|
|
||||||
|
while( !Pawn.ReachedDesiredRotation() )
|
||||||
|
{
|
||||||
|
Sleep(0.03);
|
||||||
|
}
|
||||||
|
|
||||||
|
if( DoLeap() )
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
LeapLoopPreSleepDataUpdate();
|
||||||
|
Sleep( 0.0f );
|
||||||
|
TestForTimeToTurnCollisionBackOn();
|
||||||
|
|
||||||
|
} until( Pawn.Physics != PHYS_Falling );
|
||||||
|
|
||||||
|
`AILog( GetFuncName() @ " Pawn.Physics != PHYS_Falling, so landed" );
|
||||||
|
|
||||||
|
// CGH this is where i am an trying to get the pawn told about the leap.
|
||||||
|
Outer.MyBaseAIPawn.bLeaping = false;
|
||||||
|
Outer.MyBaseAIPawn.SetCollision( true, true, true );
|
||||||
|
|
||||||
|
// Status = 'Success';
|
||||||
|
Focus = Enemy;
|
||||||
|
//PopCommand( self );
|
||||||
|
//Stop;
|
||||||
|
|
||||||
|
NotifyLanded();
|
||||||
|
}
|
||||||
|
bWantTotalMovementControl = false;
|
||||||
|
|
||||||
|
GotoState( 'Succeeding' );
|
||||||
|
}
|
||||||
|
|
||||||
|
function NotifyLanded();
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
}
|
367
BaseAI/Classes/AIPluginMovement.uc
Normal file
367
BaseAI/Classes/AIPluginMovement.uc
Normal file
@ -0,0 +1,367 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AIPluginMovement
|
||||||
|
//=============================================================================
|
||||||
|
// A proxy/parent class for all specific movement implementations
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class AIPluginMovement extends AITickablePlugin within BaseAIController
|
||||||
|
native(Plugin)
|
||||||
|
dependson(NavigationPath)
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
struct native MoveParameters
|
||||||
|
{
|
||||||
|
var EBaseMoveMood MoveMood;
|
||||||
|
var EBaseMoveType MoveType;
|
||||||
|
// var EStridePose EndStridePose;
|
||||||
|
var Actor RotateAtEndToMatch;
|
||||||
|
/** When path is actually for following actor. */
|
||||||
|
var Actor FollowingActor;
|
||||||
|
|
||||||
|
/** Movement can be inaccurate. Useful when character ends up around < 2m away and it is not needed for it cover distance. */
|
||||||
|
var bool bMovementCanBeInaccurate;
|
||||||
|
/** Don't stop at the end of path. Useful for charge attacks etc. when character is not expected to stop at the end of path. Doesn't apply for entering cover. */
|
||||||
|
var bool bMoveThroughLastPoint;
|
||||||
|
/** Indicates whether movement needs to start/end with shooting animation. */
|
||||||
|
var bool bStartPathFollowingShooting;
|
||||||
|
var bool bEndPathFollowingShooting;
|
||||||
|
/** makes sure AI will do any move even if destination is close enough */
|
||||||
|
var bool bForceAnyMove;
|
||||||
|
var bool bAllowedToFire;
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
FMoveParameters()
|
||||||
|
{
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FMoveParameters));
|
||||||
|
// copied from structdefaultproperties
|
||||||
|
MoveMood = BMM_Fast;
|
||||||
|
MoveType = BMT_Normal;
|
||||||
|
bStartPathFollowingShooting = TRUE;
|
||||||
|
bEndPathFollowingShooting = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
structdefaultproperties
|
||||||
|
{
|
||||||
|
// BodyStance=NBS_Stand
|
||||||
|
MoveMood=BMM_Fast
|
||||||
|
MoveType=BMT_Normal
|
||||||
|
bStartPathFollowingShooting=true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EMoveRequestDestinationType
|
||||||
|
{
|
||||||
|
MRDT_Invalid,
|
||||||
|
MRDT_Vector,
|
||||||
|
MRDT_Actor,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct native MoveRequestDestination
|
||||||
|
{
|
||||||
|
var vector VectorDest;
|
||||||
|
var Actor ActorDest;
|
||||||
|
var EMoveRequestDestinationType Type;
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
FMoveRequestDestination()
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FMoveRequestDestination));
|
||||||
|
}
|
||||||
|
|
||||||
|
FMoveRequestDestination(const class FVector& vDestination)
|
||||||
|
{
|
||||||
|
VectorDest = vDestination;
|
||||||
|
Type = MRDT_Vector;
|
||||||
|
}
|
||||||
|
|
||||||
|
FMoveRequestDestination(class AActor* Actor) : Type(MRDT_Invalid)
|
||||||
|
{
|
||||||
|
if(Actor != NULL)
|
||||||
|
{
|
||||||
|
ActorDest = Actor;
|
||||||
|
Type = MRDT_Actor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
Type = MRDT_Invalid;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Set(const class FVector& vDestination)
|
||||||
|
{
|
||||||
|
VectorDest = vDestination;
|
||||||
|
Type = MRDT_Vector;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Set(class AActor* Actor)
|
||||||
|
{
|
||||||
|
if(Actor != NULL)
|
||||||
|
{
|
||||||
|
ActorDest = Actor;
|
||||||
|
Type = MRDT_Actor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Type = MRDT_Invalid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//void Set(struct FCoverInfo& inCoverInfo)
|
||||||
|
//{
|
||||||
|
// if(inCoverInfo.IsSet() == TRUE)
|
||||||
|
// {
|
||||||
|
// CoverInfoDest = inCoverInfo;
|
||||||
|
// Type = MRDT_Cover;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// Type = MRDT_Invalid;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
UBOOL IsActor() const
|
||||||
|
{
|
||||||
|
return Type == MRDT_Actor;
|
||||||
|
}
|
||||||
|
|
||||||
|
UBOOL IsVector() const
|
||||||
|
{
|
||||||
|
return Type == MRDT_Vector;
|
||||||
|
}
|
||||||
|
|
||||||
|
//UBOOL IsCover() const
|
||||||
|
//{
|
||||||
|
// return Type == MRDT_Cover;
|
||||||
|
//}
|
||||||
|
|
||||||
|
class AActor* GetAsActor()
|
||||||
|
{
|
||||||
|
return Type == MRDT_Actor ? ActorDest : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
const class AActor* GetAsActor() const
|
||||||
|
{
|
||||||
|
return Type == MRDT_Actor ? ActorDest : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
//struct FCoverInfo GetAsCoverInfo() const
|
||||||
|
//{
|
||||||
|
// return Type == MRDT_Cover ? CoverInfoDest : FCoverInfo();
|
||||||
|
//}
|
||||||
|
|
||||||
|
FVector GetPosition() const
|
||||||
|
{
|
||||||
|
switch(Type)
|
||||||
|
{
|
||||||
|
case MRDT_Vector:
|
||||||
|
return VectorDest;
|
||||||
|
break;
|
||||||
|
//case MRDT_Cover:
|
||||||
|
// return CoverInfoDest.Link ? CoverInfoDest.Link->GetSlotLocation(CoverInfoDest.SlotIdx) : FVector(0.f);
|
||||||
|
// break;
|
||||||
|
case MRDT_Actor:
|
||||||
|
return ActorDest ? ActorDest->Location : FVector(0.f);
|
||||||
|
break;
|
||||||
|
default: // MRDT_Invalid
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return FVector(0.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct native MovementRequest
|
||||||
|
{
|
||||||
|
var native MoveParameters MoveParams;
|
||||||
|
var float AcceptableDistance;
|
||||||
|
var vector DestOffset;
|
||||||
|
var vector MidPointOffset;
|
||||||
|
/** a struct type with union inside representing move destination. It seems
|
||||||
|
* ok to have a native only access to it - script will only be able to modify means
|
||||||
|
* of execution, but not destination itself.
|
||||||
|
*/
|
||||||
|
var native MoveRequestDestination Destination;
|
||||||
|
var native NavigationPath PreComputedPath;
|
||||||
|
var EActionPriority Priority;
|
||||||
|
var const object Observer;
|
||||||
|
var bool bStickToNavmesh;
|
||||||
|
var bool bStickToActionArea;
|
||||||
|
var bool bDynamicDestOffset; // not used at the moment. Added for consistence
|
||||||
|
var bool bDynamicMidPoint;
|
||||||
|
var bool bPostProcessPath;
|
||||||
|
var int QueryID;
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
FMovementRequest()
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FMovementRequest));
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
FMovementRequest(FMovementRequest* pOther)
|
||||||
|
{
|
||||||
|
if(pOther != NULL)
|
||||||
|
{
|
||||||
|
appMemCopy(*this, *pOther);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FMovementRequest));
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FString GetDescription() const;
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
MoveParams.Reset();
|
||||||
|
AcceptableDistance=0.0f;
|
||||||
|
Destination.Reset();
|
||||||
|
PreComputedPath = NULL;
|
||||||
|
Priority = AP_Invalid;
|
||||||
|
bStickToNavmesh = TRUE;
|
||||||
|
bStickToActionArea = FALSE;
|
||||||
|
bPostProcessPath = FALSE;
|
||||||
|
Observer = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var MovementRequest MoveRequest;
|
||||||
|
var transient float GoalDistanceSq;
|
||||||
|
|
||||||
|
var const public{protected} EActionPriority ActionPriority;
|
||||||
|
|
||||||
|
var const public{private} EActionPriority MovementLock;
|
||||||
|
|
||||||
|
var const transient bool bObserverNotified;
|
||||||
|
var const transient bool bDontNotifyObserver;
|
||||||
|
var transient bool bDontRestartByKismet;
|
||||||
|
|
||||||
|
var float MinimumSuccessDistance;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
UBOOL IsMovementLocked(const EActionPriority Priority = AP_Logic) const // AP_Locic, i.e. AP_Invalid + 1.
|
||||||
|
{
|
||||||
|
return MovementLock >= Priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
EActionPriority GetMovementLock() const
|
||||||
|
{
|
||||||
|
return (EActionPriority)MovementLock;
|
||||||
|
}
|
||||||
|
|
||||||
|
UBOOL CanAcceptNewMoveRequest(EActionPriority NewRequestPriority) const
|
||||||
|
{
|
||||||
|
return NewRequestPriority >= ActionPriority;
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCEINLINE EActionPriority GetActionPriority() const
|
||||||
|
{
|
||||||
|
return (EActionPriority)ActionPriority;
|
||||||
|
}
|
||||||
|
|
||||||
|
FVector GetDestination(struct FMovementRequest& Request) const
|
||||||
|
{
|
||||||
|
return Request.Destination.GetPosition();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** overrideable only in native code (no-exported as virtual) */
|
||||||
|
native function bool MoveToRequest(out MovementRequest Request);
|
||||||
|
native function bool MoveToPointRequest(vector InDestLocation, EActionPriority CommandPriority, optional object ActionObserver, optional bool bStopAtEnd=true, optional bool bStickToNavmesh = true, optional float AcceptableDistance, optional Actor RotateAtEndToMatch);
|
||||||
|
native function bool MoveToActorRequest(Actor inPawnGoal, EActionPriority CommandPriority, optional object ActionObserver, optional bool bInAllowedToFire=true, optional float AcceptableDistance, optional vector DestOffset, optional vector MidPointOffset, optional bool bDynamicMidPoint, optional bool bStopAtEnd=true, optional bool bStickToNavmesh=true);
|
||||||
|
native function bool FollowPlugInsPath(NavigationPath InPath, EActionPriority CommandPriority, optional object ActionObserver, optional bool bStopAtEnd=true, optional Actor RotateAtEndToMatch, optional Float AcceptableDistance);
|
||||||
|
|
||||||
|
native function bool AbortMove(bool bNewRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param bNewRequest if set to false (default) then if there was a move
|
||||||
|
* task paused while lock was being set, then this task will be resumed.
|
||||||
|
* If true, it will not. This param makes sense only for bLock == true
|
||||||
|
*/
|
||||||
|
native function SetMovementLock(bool bLock, optional EActionPriority Priority = AP_Logic, optional bool bNewRequest);
|
||||||
|
|
||||||
|
native function protected Success();
|
||||||
|
native function protected Failure();
|
||||||
|
|
||||||
|
native function bool RePath();
|
||||||
|
|
||||||
|
/** Script interface to get location of destination point from given MovementRequest.
|
||||||
|
* no-exported to make inline. */
|
||||||
|
final native noexport function vector GetDestination(out MovementRequest Request) const;
|
||||||
|
|
||||||
|
final function EMoveRequestDestinationType GetDestinationType()
|
||||||
|
{
|
||||||
|
return MoveRequest.Destination.Type;
|
||||||
|
}
|
||||||
|
|
||||||
|
function StopMovement()
|
||||||
|
{
|
||||||
|
//@todo fill it!
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called from native code during latent movement when current move is considered unreachable */
|
||||||
|
function bool MoveUnreachable( Vector AttemptedDest, Actor AttemptedTarget )
|
||||||
|
{
|
||||||
|
if( AttemptedTarget != none )
|
||||||
|
{
|
||||||
|
`AILog( GetFuncName()$" AttemptedTarget: "$AttemptedTarget, 'PathWarning' );
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
state Succeeding `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Moving - END:"@GetStateName(), 'Move');
|
||||||
|
Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
state Failing `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Moving - END:"@GetStateName(), 'Move');
|
||||||
|
Failure();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this state does nothing. It's here to leave other states when move is aborted,
|
||||||
|
* and to indicate that it happened */
|
||||||
|
state Aborting `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Moving - Aborted", 'Move');
|
||||||
|
//AbortMove(false);
|
||||||
|
StopMovement();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this state does nothing. It's here to leave other states when move is aborted,
|
||||||
|
* and to indicate that it happened */
|
||||||
|
state Idling `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Idling", 'Move');
|
||||||
|
StopMovement();
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
// mz> this change is a little bit hacky and will need further changes. AnimSys accepts path success if destination to cover < 150.0f;
|
||||||
|
//MinimumSuccessDistance=8100.0f //90 units
|
||||||
|
MinimumSuccessDistance=160.0f //90 units
|
||||||
|
}
|
190
BaseAI/Classes/AIPluginStuckFix.uc
Normal file
190
BaseAI/Classes/AIPluginStuckFix.uc
Normal file
@ -0,0 +1,190 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AIPluginStuckFix
|
||||||
|
//=============================================================================
|
||||||
|
// A proxy/parent class for all specific Stuck implementations
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class AIPluginStuckFix extends AITickablePlugin within BaseAIController
|
||||||
|
native(Plugin)
|
||||||
|
dependson(NavigationPath, AIPluginMovement)
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
struct native FixStuckRequest
|
||||||
|
{
|
||||||
|
var native MoveParameters MoveParams;
|
||||||
|
var float AcceptableDistance;
|
||||||
|
var vector DestOffset;
|
||||||
|
//var vector MidPointOffset;
|
||||||
|
/** a struct type with union inside representing move destination. It seems
|
||||||
|
* ok to have a native only access to it - script will only be able to modify means
|
||||||
|
* of execution, but not destination itself.
|
||||||
|
*/
|
||||||
|
var native MoveRequestDestination Destination;
|
||||||
|
//var native NavigationPath PreComputedPath;
|
||||||
|
var EActionPriority Priority;
|
||||||
|
var const object Observer;
|
||||||
|
var bool bFinalApproach;
|
||||||
|
var int QueryID;
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
FFixStuckRequest()
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FFixStuckRequest));
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
FFixStuckRequest(FFixStuckRequest* pOther)
|
||||||
|
{
|
||||||
|
if(pOther != NULL)
|
||||||
|
{
|
||||||
|
appMemCopy(*this, *pOther);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FFixStuckRequest));
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FString GetDescription() const;
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
MoveParams.Reset();
|
||||||
|
AcceptableDistance=0.0f;
|
||||||
|
Destination.Reset();
|
||||||
|
Priority = AP_Invalid;
|
||||||
|
bFinalApproach = FALSE;
|
||||||
|
Observer = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var FixStuckRequest MoveRequest;
|
||||||
|
var const public{protected} EActionPriority ActionPriority;
|
||||||
|
|
||||||
|
var const public{private} EActionPriority MovementLock;
|
||||||
|
|
||||||
|
var const transient bool bObserverNotified;
|
||||||
|
var const transient bool bDontNotifyObserver;
|
||||||
|
var transient bool bDontRestartByKismet;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
UBOOL IsMovementLocked(const EActionPriority Priority = AP_Logic) const // AP_Locic, i.e. AP_Invalid + 1.
|
||||||
|
{
|
||||||
|
return MovementLock >= Priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
EActionPriority GetMovementLock() const
|
||||||
|
{
|
||||||
|
return (EActionPriority)MovementLock;
|
||||||
|
}
|
||||||
|
|
||||||
|
UBOOL CanAcceptNewMoveRequest(EActionPriority NewRequestPriority) const
|
||||||
|
{
|
||||||
|
return NewRequestPriority >= ActionPriority;
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCEINLINE EActionPriority GetActionPriority() const
|
||||||
|
{
|
||||||
|
return (EActionPriority)ActionPriority;
|
||||||
|
}
|
||||||
|
|
||||||
|
FVector GetDestination(struct FFixStuckRequest& Request) const
|
||||||
|
{
|
||||||
|
return Request.Destination.GetPosition();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** overrideable only in native code (no-exported as virtual) */
|
||||||
|
function bool StuckFixToPointRequest(vector InDestLocation, EActionPriority CommandPriority, optional object ActionObserver, optional bool bStopAtEnd=true, optional bool bStickToNavmesh = true, optional float AcceptableDistance, optional Actor RotateAtEndToMatch);
|
||||||
|
function bool StuckFixToActorRequest(Actor inPawnGoal, EActionPriority CommandPriority, optional object ActionObserver, optional bool bInAllowedToFire=true, optional float AcceptableDistance, optional vector DestOffset, optional vector MidPointOffset, optional bool bDynamicMidPoint, optional bool bStopAtEnd=true, optional bool bStickToNavmesh=true);
|
||||||
|
|
||||||
|
event bool AbortMove(bool bNewRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param bNewRequest if set to false (default) then if there was a move
|
||||||
|
* task paused while lock was being set, then this task will be resumed.
|
||||||
|
* If true, it will not. This param makes sense only for bLock == true
|
||||||
|
*/
|
||||||
|
function SetMovementLock(bool bLock, optional EActionPriority Priority = AP_Logic, optional bool bNewRequest);
|
||||||
|
|
||||||
|
function protected Success();
|
||||||
|
function protected Failure();
|
||||||
|
|
||||||
|
|
||||||
|
/** Script interface to get location of destination point from given MovementRequest.
|
||||||
|
* no-exported to make inline. */
|
||||||
|
final native noexport function vector GetDestination(out MovementRequest Request) const;
|
||||||
|
|
||||||
|
final function EMoveRequestDestinationType GetDestinationType()
|
||||||
|
{
|
||||||
|
return MoveRequest.Destination.Type;
|
||||||
|
}
|
||||||
|
|
||||||
|
function StopMovement()
|
||||||
|
{
|
||||||
|
//@todo fill it!
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called from native code during latent movement when current move is considered unreachable */
|
||||||
|
function bool MoveUnreachable( Vector AttemptedDest, Actor AttemptedTarget )
|
||||||
|
{
|
||||||
|
if( AttemptedTarget != none )
|
||||||
|
{
|
||||||
|
`AILog( GetFuncName()$" AttemptedTarget: "$AttemptedTarget, 'PathWarning' );
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
state Succeeding `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Moving - END:"@GetStateName(), 'Move');
|
||||||
|
Success();
|
||||||
|
|
||||||
|
GotoState( 'Idling' );
|
||||||
|
}
|
||||||
|
|
||||||
|
state Failing `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Moving - END:"@GetStateName(), 'Move');
|
||||||
|
Failure();
|
||||||
|
|
||||||
|
GotoState( 'Idling' );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this state does nothing. It's here to leave other states when move is aborted,
|
||||||
|
* and to indicate that it happened */
|
||||||
|
state Aborting `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Moving - Aborted", 'Move');
|
||||||
|
//AbortMove(false);
|
||||||
|
StopMovement();
|
||||||
|
|
||||||
|
GotoState( 'Idling' );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this state does nothing. It's here to leave other states when move is aborted,
|
||||||
|
* and to indicate that it happened */
|
||||||
|
state Idling `DEBUGSTATE
|
||||||
|
{
|
||||||
|
Begin:
|
||||||
|
`AILog("Idling", 'Move');
|
||||||
|
StopMovement();
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
// mz> this change is a little bit hacky and will need further changes. AnimSys accepts path success if destination to cover < 150.0f;
|
||||||
|
//MinimumSuccessDistance=8100.0f //90 units
|
||||||
|
//MinimumSuccessDistance=160.0f //90 units
|
||||||
|
}
|
57
BaseAI/Classes/AITickablePlugin.uc
Normal file
57
BaseAI/Classes/AITickablePlugin.uc
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AITickablePlugin
|
||||||
|
//=============================================================================
|
||||||
|
// this plugin type introduces tickable states functionality to deriving plugins
|
||||||
|
//
|
||||||
|
// NOTE: currently every plugin used is ticked directly by owner (only movement plugins
|
||||||
|
// implemented so far). If more plugins are created and need to be ticked a simple //
|
||||||
|
// registration mechanism should be implemented to store all plugins to be ticked in
|
||||||
|
// some array in owning BaseAIController (much like BaseAISubsystem.SmartObjects for example)
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class AITickablePlugin extends AIPlugin within BaseAIController
|
||||||
|
native(Plugin)
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
var const float LatentTime; // Internal latent function use.
|
||||||
|
var const private{private} bool bTickingEnabled;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
void TickPlugin(FLOAT DeltaTime);
|
||||||
|
virtual void ProcessState(FLOAT DeltaSeconds);
|
||||||
|
virtual EGotoState GotoState( FName State, UBOOL bForceEvents = 0, UBOOL bKeepStack = 0 );
|
||||||
|
|
||||||
|
void SetEnableTicking(UBOOL bEnable)
|
||||||
|
{
|
||||||
|
bTickingEnabled = bEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
UBOOL IsTickingEnabled() const
|
||||||
|
{
|
||||||
|
return bTickingEnabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final native latent function Sleep(float Seconds);
|
||||||
|
|
||||||
|
event ScriptTick( float DeltaTime )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
function bool NotifyNpcTerminallyStuck()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function bool NotifyNpcInGrannyMode()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bTickingEnabled=true
|
||||||
|
}
|
318
BaseAI/Classes/BaseAIController.uc
Normal file
318
BaseAI/Classes/BaseAIController.uc
Normal file
@ -0,0 +1,318 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// BaseAIController
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class BaseAIController extends GameAIController
|
||||||
|
dependson(BaseAIPawn, PluginBase, AIPluginMovement)
|
||||||
|
implements(PlugInOwnerInterface)
|
||||||
|
native
|
||||||
|
config(AI);
|
||||||
|
|
||||||
|
var transient BaseAIPawn MyBaseAIPawn;
|
||||||
|
var transient BaseAISquad BaseSquad;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// animation related vars
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Plugins
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
var const public{protected} array<AITickablePlugin> TickablePlugins;
|
||||||
|
|
||||||
|
var instanced PluginSquad SquadPlugin;
|
||||||
|
|
||||||
|
var instanced AIPluginMovement MovementPlugin;
|
||||||
|
var class<AIPluginMovement> MovementPluginClass;
|
||||||
|
|
||||||
|
var instanced AIPluginLeap LeapPlugin;
|
||||||
|
var class<AIPluginLeap> LeapPluginClass;
|
||||||
|
|
||||||
|
var instanced AIPluginStuckFix StuckFixPlugin;
|
||||||
|
var class<AIPluginStuckFix> StuckFixPluginClass;
|
||||||
|
|
||||||
|
// base off KFAICommandHistory
|
||||||
|
var transient BaseAiPlugInHistory MyAiPlugInHistory;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Movement
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// perception
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
var bool bUsePerceptionHearing;
|
||||||
|
var bool bAlwaysAssignEnemy;
|
||||||
|
|
||||||
|
/** When last time our enemy was visible */
|
||||||
|
var float LastEnemySightedTime;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// firing
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Target selection/limitation
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
/** List of targets to shoot at */
|
||||||
|
var array<Actor> TargetList;
|
||||||
|
/** List of prohibited targets */
|
||||||
|
var array<Actor> ProhibitedTargetList;
|
||||||
|
|
||||||
|
var transient BaseAIPawn SquadAssignedTarget;
|
||||||
|
|
||||||
|
struct native LocalEnemyInfo
|
||||||
|
{
|
||||||
|
var array<float> PerceptionTimestamp;
|
||||||
|
var EWSPerceptionMode LatestPerception;
|
||||||
|
var EWSPerceptionMode DominantPerception;
|
||||||
|
var int VisibleCoverActions;
|
||||||
|
|
||||||
|
var float CurrentThreat;
|
||||||
|
var vector LatestLocation; //latest location with Seen perception
|
||||||
|
var Pawn Pawn;
|
||||||
|
|
||||||
|
var bool bSeenBefore;
|
||||||
|
var bool bIsPlayer;
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
/** Constructors */
|
||||||
|
FLocalEnemyInfo() {}
|
||||||
|
FLocalEnemyInfo(EEventParm)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
FLocalEnemyInfo(APawn* InPawn)
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FLocalEnemyInfo));
|
||||||
|
Pawn = InPawn;
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCEINLINE UBOOL CanBeSeenWithAction(BYTE Action) const
|
||||||
|
{
|
||||||
|
return (VisibleCoverActions & (1 << Action)) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
UBOOL operator==(const FLocalEnemyInfo& InEnemyInfo) const
|
||||||
|
{
|
||||||
|
return Pawn == InEnemyInfo.Pawn;
|
||||||
|
}
|
||||||
|
|
||||||
|
UBOOL operator==(const APawn* EnemyPawn) const
|
||||||
|
{
|
||||||
|
return Pawn == EnemyPawn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var array<LocalEnemyInfo> LocalEnemyList;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Attachments and SpecialActionSttachments
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Enable/Disable Navmesh and plugins
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
/** If this is on, NPC will always try to use Nav Mesh Path Finding Before Path Node */
|
||||||
|
var bool bUseNavMesh;
|
||||||
|
/** If this is on, NPC will always try to use plugins for movement. Only works with navmesh */
|
||||||
|
var bool bUsePluginsForMovement;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// debug variables
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
var(Debug) config int PlugInHistoryNum;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void Initialize();
|
||||||
|
void OnLevelStreamedOut(ULevel* Level);
|
||||||
|
virtual UBOOL Tick(FLOAT DeltaTime, enum ELevelTick TickType);
|
||||||
|
|
||||||
|
virtual void PreBeginPlay();
|
||||||
|
virtual void BeginDestroy();
|
||||||
|
virtual void GetSquadEnemies(TArray<class APawn*>& Items, UBOOL bExcludeProhibitedTargets = FALSE, UBOOL bExcludeBeliefInfo = FALSE);
|
||||||
|
|
||||||
|
virtual UBOOL IsFriendly(const class AController* const TestPlayer) const;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Movement
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// perception
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
void UpdateEnemyKnowledge(INT EnemyIdx, BYTE Perception);
|
||||||
|
|
||||||
|
#if !DO_BASEAI_LOGGING
|
||||||
|
# if COMPILER_SUPPORTS_NOOP
|
||||||
|
# define BaseAILog __noop
|
||||||
|
# else
|
||||||
|
# define BaseAILog GNull->Logf
|
||||||
|
# endif
|
||||||
|
static class FOutputDeviceRedirectorBase* GLog;
|
||||||
|
#else
|
||||||
|
VARARG_DECL(void,void,{},BaseAILog,VARARG_NONE,const TCHAR*,VARARG_NONE,VARARG_NONE);
|
||||||
|
VARARG_DECL(void,void,{},BaseAILog,VARARG_NONE,const TCHAR*,VARARG_EXTRA(enum EName E),VARARG_EXTRA(E));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// AI debug stuff:
|
||||||
|
virtual void GetGameSpecificDebug(BYTE element, TArrayNoInit<FString>& outLogLines, TArray<struct FSpaceLineInfo>* Lines = NULL) const;
|
||||||
|
|
||||||
|
static TArray<UClass*> InitializedAIClasses;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called ONCe per class for class specific initialization (e.g. ETQ queries)
|
||||||
|
*/
|
||||||
|
event InitializeAIClass()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
event Possess(Pawn inPawn, bool bVehicleTransition)
|
||||||
|
{
|
||||||
|
super.Possess(inPawn, bVehicleTransition);
|
||||||
|
|
||||||
|
if (inPawn != none)
|
||||||
|
{
|
||||||
|
MyBaseAIPawn = BaseAIPawn(inPawn);
|
||||||
|
`if(`notdefined(__TW_BASEAI_LEAN_))
|
||||||
|
InitializeDefaultBehavior();
|
||||||
|
|
||||||
|
// setup movement properties
|
||||||
|
SetupPathfinding();
|
||||||
|
`endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function PawnDied(Pawn InPawn)
|
||||||
|
{
|
||||||
|
CleanUp();
|
||||||
|
super.PawnDied(InPawn);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** This function needs to stay final */
|
||||||
|
native final function float UpdateEnemyRange();
|
||||||
|
native final function EWSSymbolicAngle UpdateEnemyAngle();
|
||||||
|
|
||||||
|
native function CleanUp(optional bool bBeingDestroyed);
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// PlugInOwner interface plimentation
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
function BaseAiPlugInHistory GetAiPlugInHistory()
|
||||||
|
{
|
||||||
|
return MyAiPlugInHistory;
|
||||||
|
}
|
||||||
|
|
||||||
|
function float GetTimeSince( float Time2Test )
|
||||||
|
{
|
||||||
|
return `TimeSince(Time2Test);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Squad mechanics
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
native function int BroadcastEnemyKnowledge(Pawn EnemyPawn, EWSPerceptionMode Perception);
|
||||||
|
native function RemoveEnemy(Pawn EnemyPawn);
|
||||||
|
native function RemoveAllEnemies();
|
||||||
|
native final function bool IsFriendlyPawn(Pawn TestPlayer) const;
|
||||||
|
native noexport function bool IsFriendly(Controller TestPlayer) const;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Animation related
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// perception
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
native final function UpdateEnemyPerception(optional bool bSkipResponseDelay);
|
||||||
|
|
||||||
|
/** Selects a target from the TargetList or selects an enemy normally */
|
||||||
|
native function bool SelectTargetInternal(bool bOnlyFromTargetList);
|
||||||
|
native event bool SetEnemy(Pawn NewEnemy);
|
||||||
|
native function bool SelectEnemy();
|
||||||
|
native function bool SelectTarget();
|
||||||
|
|
||||||
|
// @todo this will be handled by squads
|
||||||
|
//function NotifyKilled(Controller Killer, Controller Killed, Pawn KilledPawn)
|
||||||
|
function NotifyKilled(Controller Killer, Controller Killed, pawn KilledPawn, class<DamageType> damageTyp)
|
||||||
|
{
|
||||||
|
// remove focus from killed enemy
|
||||||
|
if (KilledPawn == Focus)
|
||||||
|
{
|
||||||
|
Focus = None;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Controller's implementation mess with Enemy, so work on this before calling parent
|
||||||
|
RemoveEnemy(KilledPawn);
|
||||||
|
|
||||||
|
super.NotifyKilled(Killer, Killed, KilledPawn, damageTyp);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// logic flow control
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Navigation
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Movement
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
function StopMovement(optional EActionPriority ActionPriority = AP_Logic)
|
||||||
|
{
|
||||||
|
if(MovementPlugin != None)
|
||||||
|
{
|
||||||
|
MovementPlugin.AbortMove(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if( LeapPlugin != none )
|
||||||
|
{
|
||||||
|
LeapPlugin.AbortMove(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if( StuckFixPlugin != none )
|
||||||
|
{
|
||||||
|
StuckFixPlugin.AbortMove(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Attachments and SpecialActionSttachments
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Level progress
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Debug functions
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
native function DrawEnemyPerception(Canvas DrawCanvas);
|
||||||
|
|
||||||
|
function DrawDebugTextToHud( HUD HUD, String Text, optional color TextColor );
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bAlwaysAssignEnemy=true
|
||||||
|
bUsePerceptionHearing=false
|
||||||
|
|
||||||
|
// this one is a legacy thing - this needs to be true even for AI actors
|
||||||
|
// because only then PlayerReplicationInfo will be created - teams for example need that
|
||||||
|
// @todo - really needs to be refactored, but can be soooo tricky
|
||||||
|
//bIsPlayer=TRUE
|
||||||
|
|
||||||
|
MovementPlugin=None
|
||||||
|
//MovementPluginClass="AIPluginMovement_Recast"
|
||||||
|
}
|
229
BaseAI/Classes/BaseAIPawn.uc
Normal file
229
BaseAI/Classes/BaseAIPawn.uc
Normal file
@ -0,0 +1,229 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// BaseAIPawn
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class BaseAIPawn extends GamePawn
|
||||||
|
dependson(BaseAITypes)
|
||||||
|
config(Game)
|
||||||
|
native
|
||||||
|
abstract
|
||||||
|
notplaceable
|
||||||
|
nativereplication;
|
||||||
|
|
||||||
|
var transient BaseAIController MyBaseAI;
|
||||||
|
|
||||||
|
/** remembers the team we were on pre-death as our PlayerReplicationInfo will be disconnected
|
||||||
|
* mz> reused as simple team number cache, moved from KFPawn.uc
|
||||||
|
*/
|
||||||
|
var byte LastTeamNum;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Breadcrumbs
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// mz> chaning this remember to change 'kBreadCrumbsMax' in BreadCrumbs struct (below)
|
||||||
|
const kBreadCrumbsMax = 10;
|
||||||
|
|
||||||
|
struct native Breadcrumbs
|
||||||
|
{
|
||||||
|
var transient vector Crumbs[kBreadCrumbsMax];
|
||||||
|
var transient byte CurrentCrumb;
|
||||||
|
var float CrumbDistanceSq;
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
// added this way since script consts were unsuable in this case
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
kBreadCrumbsMax = 10
|
||||||
|
};
|
||||||
|
|
||||||
|
FBreadcrumbs()
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FBreadcrumbs));
|
||||||
|
}
|
||||||
|
|
||||||
|
FBreadcrumbs(EEventParm)
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FBreadcrumbs));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Init(const FVector& Location, FLOAT inCrumbDistanceSq=10000.f)
|
||||||
|
{
|
||||||
|
for(INT i = 0; i < kBreadCrumbsMax; ++i)
|
||||||
|
{
|
||||||
|
Crumbs[i] = Location;
|
||||||
|
}
|
||||||
|
|
||||||
|
CrumbDistanceSq = inCrumbDistanceSq;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateCrumbs(const FVector& Location)
|
||||||
|
{
|
||||||
|
if(Crumbs[CurrentCrumb].DistanceSquared(Location) >= CrumbDistanceSq)
|
||||||
|
{
|
||||||
|
const BYTE newCrumb = (CurrentCrumb + 1) % kBreadCrumbsMax;
|
||||||
|
Crumbs[newCrumb] = Location;
|
||||||
|
CurrentCrumb = newCrumb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCEINLINE FVector GetOldestCrumb() const
|
||||||
|
{
|
||||||
|
return Crumbs[(CurrentCrumb + 1) % kBreadCrumbsMax];
|
||||||
|
}
|
||||||
|
|
||||||
|
FVector GetNthCrumb(INT N) const
|
||||||
|
{
|
||||||
|
return N >= kBreadCrumbsMax ? GetOldestCrumb() : Crumbs[(CurrentCrumb + kBreadCrumbsMax - N) % kBreadCrumbsMax];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
structdefaultproperties
|
||||||
|
{
|
||||||
|
CrumbDistanceSq=10000.f
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var transient BreadCrumbs MyBreadCrumbs;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Target selection/limitation
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
/** Cached value for damage config: AI type */
|
||||||
|
var transient /*const*/ byte MyAIType;
|
||||||
|
|
||||||
|
/** Array of all pawns attacking this controller.*/
|
||||||
|
var const array<BaseAIPawn> Attackers;
|
||||||
|
var const array<INT> AttackersPerTypeCount;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Animation related
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// members moved from GearPawn
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Plugins
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
var transient bool bLeaping;
|
||||||
|
var transient float TimeStartedLeap;
|
||||||
|
var transient float TimeImmuneWhileLeaping;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void PostBeginPlay();
|
||||||
|
virtual void PostScriptDestroyed();
|
||||||
|
virtual UBOOL Tick(FLOAT DeltaTime, enum ELevelTick TickType);
|
||||||
|
|
||||||
|
void AddAttacker(class ABaseAIPawn* Attacker);
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Properties interface
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Weapon handling
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Pawn overrides
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
function bool Died(Controller Killer, class<DamageType> DamageType, vector HitLocation)
|
||||||
|
{
|
||||||
|
`if(`notdefined(__TW_BASEAI_LEAN_))
|
||||||
|
AbortSOUsage();
|
||||||
|
`endif
|
||||||
|
|
||||||
|
class'BaseAISubsystem'.static.DecreaseTeamSize(GetTeamNum());
|
||||||
|
if(MyBaseAI != None && MyBaseAI.Enemy != None)
|
||||||
|
{
|
||||||
|
BaseAIPawn(MyBaseAI.Enemy).RemoveAttacker(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Super.Died(Killer,damageType,HitLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
function PossessedBy(Controller C, bool bVehicleTransition)
|
||||||
|
{
|
||||||
|
Super.PossessedBy(C, bVehicleTransition);
|
||||||
|
MyBaseAI = BaseAIController(C);
|
||||||
|
|
||||||
|
// BaseAIPawn subclasses actually do get possessed by players!
|
||||||
|
if ( MyBaseAI != None )
|
||||||
|
{
|
||||||
|
LastTeamNum = MyBaseAI.GetTeamNum();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function UnPossessed()
|
||||||
|
{
|
||||||
|
MyBaseAI = None;
|
||||||
|
|
||||||
|
super.UnPossessed();
|
||||||
|
`if(`notdefined(__TW_BASEAI_LEAN_))
|
||||||
|
if (AnimationProxy != None)
|
||||||
|
{
|
||||||
|
AnimationProxy.UnPossessed();
|
||||||
|
}
|
||||||
|
`endif
|
||||||
|
}
|
||||||
|
|
||||||
|
simulated function NotifyTeamChanged()
|
||||||
|
{
|
||||||
|
Super.NotifyTeamChanged();
|
||||||
|
|
||||||
|
LastTeamNum = GetTeamNum();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Readabilities (Chatter too)
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Target selection/limitation
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
/**
|
||||||
|
* @param AIType specifies what type of attackers is of interest, -1 means all
|
||||||
|
* @return number of Pawns of given type (or all if AIType == -1) attacking this controller
|
||||||
|
*/
|
||||||
|
native final function int GetAttackerCount(optional int AIType = -1) const;
|
||||||
|
|
||||||
|
native final function RemoveAttacker(BaseAIPawn Attacker);
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// level progress stuff
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// movement
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// debug
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
final native function DrawCrumbs(HUD HUD) const;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
`if(`notdefined(__TW_BASEAI_LEAN_))
|
||||||
|
AISelectionModifier=1.0
|
||||||
|
AimAccuracy=Accuracy_Normal
|
||||||
|
bUseAnimationProxy=true
|
||||||
|
MovementProps=(bStartMovementShooting=true, bStartMovementShootingOnRepath=false, bEndMovementShooting=true, bCanCombatWalk=true)
|
||||||
|
bHasAISelectionModifierPerTeam=false
|
||||||
|
`endif
|
||||||
|
|
||||||
|
bCanBeAdheredTo=TRUE
|
||||||
|
bCanBeFrictionedTo=TRUE
|
||||||
|
}
|
79
BaseAI/Classes/BaseAISquad.uc
Normal file
79
BaseAI/Classes/BaseAISquad.uc
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AnimationProxy
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
class BaseAISquad extends Info
|
||||||
|
native;
|
||||||
|
|
||||||
|
/** Controller for leader of the squad */
|
||||||
|
var() editconst Controller Leader;
|
||||||
|
var() editconst Actor FormationCenter;
|
||||||
|
|
||||||
|
/** whether this squad has a human controlled player in it */
|
||||||
|
var bool bPlayerSquad;
|
||||||
|
|
||||||
|
var bool bIsMP;
|
||||||
|
|
||||||
|
var transient bool bSquadInCombat;
|
||||||
|
|
||||||
|
var transient float NextEnemySelectionTimestamp;
|
||||||
|
/** Call UpdateEnemySelection every X seconds*/
|
||||||
|
var float EnemySelectionInterval;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void TickSpecial(FLOAT DeltaSeconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called immediately after gameplay begins. */
|
||||||
|
event PostBeginPlay()
|
||||||
|
{
|
||||||
|
super.PostBeginPlay();
|
||||||
|
|
||||||
|
class'BaseAISubsystem'.static.RegisterSquad(self);
|
||||||
|
|
||||||
|
bIsMP = WorldInfo.GRI.IsMultiplayerGame();
|
||||||
|
}
|
||||||
|
|
||||||
|
event Destroyed()
|
||||||
|
{
|
||||||
|
class'BaseAISubsystem'.static.UnRegisterSquad(self);
|
||||||
|
|
||||||
|
super.Destroyed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called by BaseAISubsystem to update enemy info
|
||||||
|
* @return true if given pawn was on squad's enemy list, false otherwise
|
||||||
|
*/
|
||||||
|
native function bool NotifyKilled(Controller Killer, Controller Killed, Pawn KilledPawn, class<DamageType> damageType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called by PluginSquad
|
||||||
|
*/
|
||||||
|
final native function EnemyPerceivedBy(Controller Member, EWSPerceptionMode PerceptionType, Pawn Enemy);
|
||||||
|
|
||||||
|
native function UpdateLeader(Controller inLeader);
|
||||||
|
|
||||||
|
native function int GetSquadMemberCount() const;
|
||||||
|
native function bool GetSquadMembers(out array<BaseAIPawn> Members);
|
||||||
|
/** Returns FormationCenter when not in combat, and Leader pawn if in combat.
|
||||||
|
* @note could add a flag toggling this behavior. No need for it at the moment
|
||||||
|
*/
|
||||||
|
native final function BaseAIPawn GetSquadCenterPawn();
|
||||||
|
|
||||||
|
/** picks target/enemy for all squad members with BaseAIController.bSquadBasedEnemySelection == true
|
||||||
|
* @return TRUE if any work has been done, and there is a point in re-calling this in some time
|
||||||
|
*/
|
||||||
|
native function bool UpdateEnemySelection();
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
EnemySelectionInterval=0.4f
|
||||||
|
bIsMP=false
|
||||||
|
}
|
114
BaseAI/Classes/BaseAISubsystem.uc
Normal file
114
BaseAI/Classes/BaseAISubsystem.uc
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AnimationProxy
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
class BaseAISubsystem extends AISubsystem
|
||||||
|
config(Engine)
|
||||||
|
native
|
||||||
|
inherits(FCallbackEventDevice,FTickableObject);
|
||||||
|
|
||||||
|
var AIDebugTool AIDebug;
|
||||||
|
|
||||||
|
var const array<BaseAISquad> Squads;
|
||||||
|
|
||||||
|
var const array<INT> TeamSizes;
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// @deprecated with __TW_BASEAI_LEAN_
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
`if(`notdefined(__TW_BASEAI_LEAN_))
|
||||||
|
var ETQSystem ETQSys;
|
||||||
|
var BTManager BTMgr;
|
||||||
|
var MessageSystem MsgSys;
|
||||||
|
var NavigationSystem NavSys;
|
||||||
|
var DigitalActingManager DAM;
|
||||||
|
var SightSystem SightSys;
|
||||||
|
|
||||||
|
var const SmartObjectReplicationActor SmartObjectReplication;
|
||||||
|
var const array<SOHubComponent> SmartObjects;
|
||||||
|
var const array<SOHubComponent> InitPendingSmartObjects;
|
||||||
|
var const array<CoverLink> SpawnedCovers;
|
||||||
|
var const array<AIAvoidanceComponent> AvoidanceComponents;
|
||||||
|
|
||||||
|
native static final noexport function ETQSystem GetETQSystem();
|
||||||
|
native static final noexport function BTManager GetBTManager();
|
||||||
|
native static final noexport function MessageSystem GetMessageSystem();
|
||||||
|
native static final noexport function NavigationSystem GetNavigationSystem();
|
||||||
|
native static final noexport function DigitalActingManager GetDAM();
|
||||||
|
native static final noexport function SightSystem GetSightSystem();
|
||||||
|
|
||||||
|
native static final noexport function RegisterSmartObject(SOHubComponent SO);
|
||||||
|
native static final noexport function UnRegisterSmartObject(SOHubComponent SO);
|
||||||
|
|
||||||
|
native static final noexport function RegisterSpawnedCover(CoverLink Cover);
|
||||||
|
native static final noexport function UnRegisterSpawnedCover(CoverLink Cover);
|
||||||
|
|
||||||
|
native static final noexport function RegisterAvoidanceComponent(AIAvoidanceComponent AvoidanceComponent);
|
||||||
|
native static final noexport function UnRegisterAvoidanceComponent(AIAvoidanceComponent AvoidanceComponent);
|
||||||
|
`endif
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// END __TW_BASEAI_LEAN_
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
native static final noexport function BaseAISubsystem GetInstance();
|
||||||
|
native static final noexport function AIDebugTool GetAIDebugTool();
|
||||||
|
|
||||||
|
native static final noexport function RegisterSquad(BaseAISquad Squad);
|
||||||
|
native static final noexport function UnRegisterSquad(BaseAISquad Squad);
|
||||||
|
|
||||||
|
native static final noexport function IncreaseTeamSize(BYTE TeamId);
|
||||||
|
native static final noexport function DecreaseTeamSize(BYTE TeamId);
|
||||||
|
native static final noexport function int GetTeamSize(byte TeamId);
|
||||||
|
native static final noexport function int GetEnemyTeamsSize(byte TeamId);
|
||||||
|
|
||||||
|
//NotifyKilled(Controller Killer, Controller Killed, pawn KilledPawn, class<DamageType> damageType)
|
||||||
|
native static final function NotifyKilled(Controller Killer, Controller KilledController, Pawn KilledPawn, class<DamageType> damageType);
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void Init(UBOOL bEngineStart = FALSE);
|
||||||
|
virtual void Tick(FLOAT DeltaSeconds);
|
||||||
|
virtual void CleanUp(UBOOL bShutDown = FALSE);
|
||||||
|
virtual void PrepareMapChange();
|
||||||
|
virtual void OnLevelStreamedOut(ULevel* Level);
|
||||||
|
|
||||||
|
static UAIDebugTool* GetAIDebugTool(void);
|
||||||
|
|
||||||
|
static void RegisterSquad(class ABaseAISquad* Squad);
|
||||||
|
static void UnRegisterSquad(class ABaseAISquad* Squad);
|
||||||
|
static TArray<ABaseAISquad*>* GetSquads();
|
||||||
|
|
||||||
|
static void ObjectDestroyed(UObject* Object);
|
||||||
|
|
||||||
|
static void IncreaseTeamSize(BYTE TeamId);
|
||||||
|
static void DecreaseTeamSize(BYTE TeamId);
|
||||||
|
|
||||||
|
static void OnPawnDestroyed(class ABaseAIPawn* Pawn);
|
||||||
|
void OnCheckPointLoad();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void DecreaseTeamSizeInternal(BYTE TeamId);
|
||||||
|
public:
|
||||||
|
static int GetTeamSize(BYTE TeamId);
|
||||||
|
static int GetEnemyTeamsSize(BYTE TeamId, BYTE TeamIdLimit = 255);
|
||||||
|
|
||||||
|
//-- editor related methods --//
|
||||||
|
void OnPIEEnd();
|
||||||
|
void OnPIEMapSwitch();
|
||||||
|
|
||||||
|
virtual void Send(ECallbackEventType InType);
|
||||||
|
virtual void Send(ECallbackEventType InType, DWORD Flags);
|
||||||
|
|
||||||
|
virtual UBOOL IsTickable() const { return TRUE; }
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bImplementsNavMeshGeneration=true
|
||||||
|
}
|
105
BaseAI/Classes/BaseAITypes.uc
Normal file
105
BaseAI/Classes/BaseAITypes.uc
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// BaseAITypes
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class BaseAITypes extends Object
|
||||||
|
native(Types)
|
||||||
|
abstract
|
||||||
|
config(AI);
|
||||||
|
|
||||||
|
enum EActionPriority
|
||||||
|
{
|
||||||
|
AP_Invalid,
|
||||||
|
AP_Logic,
|
||||||
|
AP_Kismet, // default GoW priority, not only for kismet
|
||||||
|
AP_Reaction,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EBaseMoveMood
|
||||||
|
{
|
||||||
|
BMM_Invalid,
|
||||||
|
BMM_Static,
|
||||||
|
BMM_Slow,
|
||||||
|
BMM_Normal,
|
||||||
|
BMM_Fast,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EBaseMoveType
|
||||||
|
{
|
||||||
|
BMT_Invalid,
|
||||||
|
BMT_Normal,
|
||||||
|
BMT_Combat,
|
||||||
|
BMT_Careful,
|
||||||
|
BMT_Pain,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EWSPerceptionMode
|
||||||
|
{
|
||||||
|
WSPM_None,
|
||||||
|
WSPM_Memory,
|
||||||
|
WSPM_Belief,
|
||||||
|
WSPM_Hearing,
|
||||||
|
WSPM_Sight,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EWSSymbolicAngle
|
||||||
|
{
|
||||||
|
WSSA_Front,
|
||||||
|
WSSA_Side,
|
||||||
|
WSSA_Back,
|
||||||
|
WSSA_Unknown,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EBTResult
|
||||||
|
{
|
||||||
|
BTR_Error,
|
||||||
|
BTR_Abort,
|
||||||
|
BTR_Fail,
|
||||||
|
BTR_Success,
|
||||||
|
BTR_NotFinished,
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// Debug types
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
enum EDebugLineType
|
||||||
|
{
|
||||||
|
DLT_Generic,
|
||||||
|
DLT_InstantFire,
|
||||||
|
DLT_NoPath,
|
||||||
|
DLT_LeaderFollowing,
|
||||||
|
DLT_Failed,
|
||||||
|
DLT_Red,
|
||||||
|
DLT_Green,
|
||||||
|
DLT_Blue,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct native SpaceLineInfo
|
||||||
|
{
|
||||||
|
var vector Start;
|
||||||
|
var vector End;
|
||||||
|
var EDebugLineType Type;
|
||||||
|
var init string Comment;
|
||||||
|
var native Name Category;
|
||||||
|
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
/** Constructors */
|
||||||
|
FSpaceLineInfo() {}
|
||||||
|
FSpaceLineInfo(EEventParm)
|
||||||
|
{
|
||||||
|
appMemzero(this, sizeof(FSpaceLineInfo));
|
||||||
|
}
|
||||||
|
FSpaceLineInfo(FVector inStart,FVector inEnd,BYTE inType, const FString& inComment,FName inCategory=NAME_None)
|
||||||
|
: Start(inStart), End(inEnd), Type(inType), Comment(inComment), Category(inCategory)
|
||||||
|
{}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
}
|
111
BaseAI/Classes/BaseAiPlugInHistory.uc
Normal file
111
BaseAI/Classes/BaseAiPlugInHistory.uc
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// BaseAiPlugInHistory
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class BaseAiPlugInHistory extends Object
|
||||||
|
native(Plugin)
|
||||||
|
dependson(PluginBase);
|
||||||
|
|
||||||
|
|
||||||
|
struct native BaseAIPlugInHistoryItem
|
||||||
|
{
|
||||||
|
var class<AICommandBase> PlugInClass;
|
||||||
|
var string PlugInName;
|
||||||
|
var float TimeStamp; // World time command was started
|
||||||
|
var float Duration; // Total time spent in the command
|
||||||
|
var bool bAborted; // Command was aborted (which is often fine and intentional depending on the context) (TODO:Change to bytes)
|
||||||
|
var bool bFailure; // Command failed (this is also not necessarily bad, at times it's expected)
|
||||||
|
var bool bSuccess; // Command succeeded
|
||||||
|
var string VerboseString; // Optional extra info that can be added
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
var transient array<BaseAIPlugInHistoryItem> PlugInHistory;
|
||||||
|
var int PlugInHistoryNum;
|
||||||
|
|
||||||
|
var BaseAIController CtrlOwner;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void StorePlugInHistory( UPluginBase* ThePlugIn );
|
||||||
|
}
|
||||||
|
|
||||||
|
event Setup( int InPlugInHistoryNum, BaseAIController InCtrlOwner )
|
||||||
|
{
|
||||||
|
PlugInHistoryNum = InPlugInHistoryNum;
|
||||||
|
CtrlOwner = InCtrlOwner;
|
||||||
|
}
|
||||||
|
|
||||||
|
simulated function DrawDebugToHud( HUD HUD, name Category )
|
||||||
|
{
|
||||||
|
//local KFHUDBase kfHUD;
|
||||||
|
local int plugInCnt;
|
||||||
|
local Canvas canToUse;
|
||||||
|
//local BaseAICommand Cmd;
|
||||||
|
local BaseAIPlugInHistoryItem plugInItem;
|
||||||
|
//local bool bDrawDebugCommandStack, bDrawDebugCommandHistory;
|
||||||
|
//local bool bDrawDebugAllPlugins, bDrawDebugPlugInHistory;
|
||||||
|
//local string AddTxt, NullTxt;
|
||||||
|
//local AICommand AC;
|
||||||
|
|
||||||
|
//kfHUD = KFHUDBase(kfHud);
|
||||||
|
////local float Aggression;
|
||||||
|
//bDrawDebugCommandStack = false;
|
||||||
|
//bDrawDebugCommandHistory = false;
|
||||||
|
|
||||||
|
// if( Category == 'Default' || Category == 'All' || Category == 'OverheadNames' )
|
||||||
|
// {
|
||||||
|
// bDrawDebugCommandStack = false;
|
||||||
|
// bDrawDebugCommandHistory = false;
|
||||||
|
// Icon = Texture2D'ENG_EditorResources_TEX.AI.S_AI';
|
||||||
|
// DrawIconOverhead(HUD, Icon);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// if( bDebug_ShowViewCone )
|
||||||
|
// {
|
||||||
|
// if( MyKFPawn != None )
|
||||||
|
// {
|
||||||
|
// tmp = MyKFPawn.GetPawnViewLocation();
|
||||||
|
// rot = MyKFPawn.GetBaseAimRotation();
|
||||||
|
// }
|
||||||
|
// DrawDebugCone(tmp ,vector( rot),Pawn .SightRadius, Acos(Pawn .PeripheralVision), Acos(Pawn .PeripheralVision),16,MakeColor(255,0,0,255));
|
||||||
|
// }
|
||||||
|
|
||||||
|
//return;
|
||||||
|
// NullTxt = "None";
|
||||||
|
// Draw list of commands down the side of the screen
|
||||||
|
if( /*Pawn != None && Category == 'All'*/ true )
|
||||||
|
{
|
||||||
|
canToUse = HUD.Canvas;
|
||||||
|
canToUse.SetOrigin(0,0);
|
||||||
|
canToUse.Font = class'Engine'.Static.GetSmallFont();
|
||||||
|
canToUse.SetPos(canToUse.SizeX * 0.05f, canToUse.SizeY * 0.25f);
|
||||||
|
|
||||||
|
// WRITE OUT COMMAND HISTORY
|
||||||
|
// C.SetDrawColor(255, 255, 255, 255);
|
||||||
|
CtrlOwner.DrawDebugTextToHud( HUD, "************************************************************" );
|
||||||
|
//C.SetDrawColor(0, 0, 255, 255);
|
||||||
|
CtrlOwner.DrawDebugTextToHud( HUD, "PLUG IN HISTORY (Count:"@PlugInHistoryNum$")" );
|
||||||
|
plugInCnt = 0;
|
||||||
|
foreach PlugInHistory( plugInItem )
|
||||||
|
{
|
||||||
|
plugInCnt++;
|
||||||
|
// C.SetDrawColor(255, 0, 0, 255);
|
||||||
|
CtrlOwner.DrawDebugTextToHud( HUD, "PlugIn"@plugInCnt$":"@String(plugInItem.PlugInClass)@"Time:"@plugInItem.TimeStamp);
|
||||||
|
if( Len(plugInItem.VerboseString) > 0 )
|
||||||
|
{
|
||||||
|
// C.SetDrawColor(255, 64, 64, 255);
|
||||||
|
CtrlOwner.DrawDebugTextToHud( HUD, ".............."@plugInItem.VerboseString );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
PlugInHistoryNum=25
|
||||||
|
}
|
25
BaseAI/Classes/CodeSpeedTestCommandlet.uc
Normal file
25
BaseAI/Classes/CodeSpeedTestCommandlet.uc
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AnimationProxy
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
class CodeSpeedTestCommandlet extends Commandlet
|
||||||
|
native;
|
||||||
|
|
||||||
|
var transient object CurrentPackage;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Commandlet entry point
|
||||||
|
*
|
||||||
|
* @param Params the command line parameters that were passed in.
|
||||||
|
*
|
||||||
|
* @return 0 if the commandlet succeeded; otherwise, an error code defined by the commandlet.
|
||||||
|
*/
|
||||||
|
virtual INT Main(const FString& Params);
|
||||||
|
};
|
13
BaseAI/Classes/LatentActionObserver.uc
Normal file
13
BaseAI/Classes/LatentActionObserver.uc
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AnimationProxy
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
interface LatentActionObserver
|
||||||
|
native;
|
||||||
|
|
||||||
|
native function OnLatentFinished(BaseAIController Observer, Object Action, byte FinishResult);
|
64
BaseAI/Classes/NavigationPath.uc
Normal file
64
BaseAI/Classes/NavigationPath.uc
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// NavigationPath
|
||||||
|
//=============================================================================
|
||||||
|
// deprecated stub class on 6/29/2015 (script only)
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class NavigationPath extends Object;
|
||||||
|
|
||||||
|
struct BaseTransform
|
||||||
|
{
|
||||||
|
var const private{private} Actor Base;
|
||||||
|
var const private{private} Vector InitialLocation;
|
||||||
|
var const private{private} Rotator InitialRotation;
|
||||||
|
// used in lazy update
|
||||||
|
var const private{private} Vector UpdatedForLocation;
|
||||||
|
var const private{private} Rotator UpdatedForRotation;
|
||||||
|
// to take from initial pos into base pos
|
||||||
|
var const private{private} Matrix InitialReversedTransform;
|
||||||
|
// whole transform from initial pos (as in array) into world pos
|
||||||
|
var const private{private} Matrix IBS2WSTransform;
|
||||||
|
// reverse
|
||||||
|
var const private{private} Matrix WS2IBSTransform;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct PathPoint
|
||||||
|
{
|
||||||
|
var Vector Location;
|
||||||
|
var byte Flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
// -- not to be changed from script! -- //
|
||||||
|
var init const array<PathPoint> PathPoints;
|
||||||
|
|
||||||
|
struct PolyArray_Mirror
|
||||||
|
{
|
||||||
|
var init array<int> Dummy;
|
||||||
|
};
|
||||||
|
var private const PolyArray_Mirror PolysUsed;
|
||||||
|
|
||||||
|
/** Base on which this path is generated. Valid if bDynamic == true. */
|
||||||
|
var const BaseTransform Base;
|
||||||
|
/** Destination expressed in initial navmesh position. */
|
||||||
|
var const vector LocalDestination;
|
||||||
|
|
||||||
|
var private{private} const bool bDynamic;
|
||||||
|
/** variable auto-incremented every new path is stored in this path object */
|
||||||
|
var public{private} const int Version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns indexed element's position offset and rotated if necessary
|
||||||
|
*/
|
||||||
|
final function vector GetElementPos(int index);
|
||||||
|
|
||||||
|
final function SetRoute(array<PathPoint> Route);
|
||||||
|
|
||||||
|
/** function used to translate given location to path's generation base's space */
|
||||||
|
final function vector WorldToLocal(vector InLocation);
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
// debug stuff
|
||||||
|
// ----------------------------------------------------------------------- //
|
||||||
|
final function DrawPath(Canvas Canvas, optional byte R=0, optional byte G=255, optional byte B=128, optional bool bPersistent);
|
52
BaseAI/Classes/PlayerInputRecorder.uc
Normal file
52
BaseAI/Classes/PlayerInputRecorder.uc
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AnimationProxy
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
class PlayerInputRecorder extends Object
|
||||||
|
native(Tools);
|
||||||
|
|
||||||
|
static native noexport final function StartRecording(string Filename);
|
||||||
|
static native noexport final function StopRecording();
|
||||||
|
static native noexport final function Replay(string Filename);
|
||||||
|
static native noexport final function StopReplay();
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
#if HASEDITOR
|
||||||
|
// to be specialized in Platforms' drivers
|
||||||
|
template<typename TJoystickInfo, typename TXInputState>
|
||||||
|
static void Replay(TJoystickInfo&, TXInputState&);
|
||||||
|
|
||||||
|
// to be specialized in Platforms' drivers
|
||||||
|
template<typename TJoystickInfo, typename TXInputState>
|
||||||
|
static void Record(TJoystickInfo&, TXInputState&);
|
||||||
|
|
||||||
|
// to be defined in Platforms' drivers
|
||||||
|
static void FlushInputRecBuffer(UBOOL bFinalize);
|
||||||
|
|
||||||
|
static UBOOL IsRecording();
|
||||||
|
static UBOOL IsReplaying();
|
||||||
|
|
||||||
|
static void StopReplay();
|
||||||
|
static void OnReplayingStop();
|
||||||
|
|
||||||
|
static UBOOL ReadInRecordedPlayerInput(UBOOL bFinishing = FALSE);
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
kInputRecordBufferSize = 128
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static FString CurrentFileName;
|
||||||
|
static UBOOL bIsInputRecording;
|
||||||
|
static UBOOL bIsInputReplaying;
|
||||||
|
static INT Version;
|
||||||
|
static INT ReplayIndex;
|
||||||
|
#endif // HASEDITOR
|
||||||
|
};
|
14
BaseAI/Classes/PlugInOwnerInterface.uc
Normal file
14
BaseAI/Classes/PlugInOwnerInterface.uc
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// PlugInOwnerInterface
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
interface PlugInOwnerInterface;
|
||||||
|
|
||||||
|
function BaseAiPlugInHistory GetAiPlugInHistory();
|
||||||
|
|
||||||
|
//function float GetCurrentTime();
|
||||||
|
function float GetTimeSince( float Time2Test );
|
122
BaseAI/Classes/PluginBase.uc
Normal file
122
BaseAI/Classes/PluginBase.uc
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// PluginBase
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
class PluginBase extends Object
|
||||||
|
abstract
|
||||||
|
native(Plugin);
|
||||||
|
|
||||||
|
var PlugInOwnerInterface PlugInOwner;
|
||||||
|
var const public{private} bool bIsPluginEnabled;
|
||||||
|
|
||||||
|
var bool bAborted;
|
||||||
|
var bool bFailure;
|
||||||
|
var bool bSuccess;
|
||||||
|
|
||||||
|
var BaseAiPlugInHistory OwnersAiPlugInHistory;
|
||||||
|
var string HistoryString;
|
||||||
|
|
||||||
|
/** Exiting status of this plugin */
|
||||||
|
var() transient string StatusStr;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
FORCEINLINE UBOOL IsPluginEnabled() const
|
||||||
|
{
|
||||||
|
return bIsPluginEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void CleanUp(UBOOL bBeingDestroyed) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
native function DisablePlugin();
|
||||||
|
native function EnablePlugin();
|
||||||
|
|
||||||
|
simulated function DrawDebugToHud( HUD HUD, name Category );
|
||||||
|
|
||||||
|
|
||||||
|
event ScriptInitialize()
|
||||||
|
{
|
||||||
|
bAborted = false;
|
||||||
|
bFailure = false;
|
||||||
|
bSuccess = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
event DrawDebug(HUD H, Name Category);
|
||||||
|
|
||||||
|
/*********************************************************************************************
|
||||||
|
* Debugging
|
||||||
|
********************************************************************************************* */
|
||||||
|
|
||||||
|
/** Update command history (debugging) */
|
||||||
|
function UpdateCommandHistory()
|
||||||
|
{
|
||||||
|
local int i;
|
||||||
|
|
||||||
|
if( PlugInOwner != none )
|
||||||
|
{
|
||||||
|
if( OwnersAiPlugInHistory == none )
|
||||||
|
{
|
||||||
|
OwnersAiPlugInHistory = PlugInOwner.GetAiPlugInHistory();
|
||||||
|
}
|
||||||
|
|
||||||
|
for( i = 0; i < OwnersAiPlugInHistory.PlugInHistory.Length; i++ )
|
||||||
|
{
|
||||||
|
if( OwnersAiPlugInHistory.PlugInHistory[i].PlugInName != "" && OwnersAiPlugInHistory.PlugInHistory[i].PlugInName == string(name) )
|
||||||
|
{
|
||||||
|
if( bAborted)
|
||||||
|
{
|
||||||
|
OwnersAiPlugInHistory.PlugInHistory[i].bAborted = true;
|
||||||
|
}
|
||||||
|
if( bFailure)
|
||||||
|
{
|
||||||
|
OwnersAiPlugInHistory.PlugInHistory[i].bFailure = true;
|
||||||
|
}
|
||||||
|
if( bSuccess )
|
||||||
|
{
|
||||||
|
OwnersAiPlugInHistory.PlugInHistory[i].bSuccess = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateHistoryString( "Status: " $ StatusStr );
|
||||||
|
//HistoryString = "Status: "$Status;
|
||||||
|
OwnersAiPlugInHistory.PlugInHistory[i].Duration = PlugInOwner.GetTimeSince(OwnersAiPlugInHistory.PlugInHistory[i].TimeStamp);
|
||||||
|
OwnersAiPlugInHistory.PlugInHistory[i].VerboseString = HistoryString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Update the command's HistoryString, which is output when DumpCommandHistory() is called */
|
||||||
|
function UpdateHistoryString( string AddString )
|
||||||
|
{
|
||||||
|
|
||||||
|
if( PlugInOwner != none )
|
||||||
|
{
|
||||||
|
if( OwnersAiPlugInHistory == none )
|
||||||
|
{
|
||||||
|
OwnersAiPlugInHistory = PlugInOwner.GetAiPlugInHistory();
|
||||||
|
}
|
||||||
|
|
||||||
|
if( OwnersAiPlugInHistory.PlugInHistoryNum > 0 )
|
||||||
|
{
|
||||||
|
HistoryString = HistoryString$" "$AddString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Used when dumping command history to log file */
|
||||||
|
event string GetDebugVerboseText()
|
||||||
|
{
|
||||||
|
return HistoryString;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bIsPluginEnabled=true
|
||||||
|
HistoryString="[I]"
|
||||||
|
}
|
26
BaseAI/Classes/PluginSquad.uc
Normal file
26
BaseAI/Classes/PluginSquad.uc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AnimationProxy
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This plugin introduces squad mechanics to owning BaseAIController. This class is not the same as a squad itself,
|
||||||
|
* it introduces actions that can be performed on a squad. Advantage of this approach is that any given BaseAIController
|
||||||
|
* can easily change squads just by changing 'Squad' variable of its 'CoveringPlugin'.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class PluginSquad extends AIPlugin within BaseAIController
|
||||||
|
native(Plugin);
|
||||||
|
|
||||||
|
var const BaseAISquad Squad;
|
||||||
|
|
||||||
|
final native function EnemyPerceived(EWSPerceptionMode PerceptionType, Pawn PerceivedEnemy);
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
}
|
66
BaseAI/Globals.uci
Normal file
66
BaseAI/Globals.uci
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// Globals
|
||||||
|
//=============================================================================
|
||||||
|
// /* MessageSystem macros */
|
||||||
|
//=============================================================================
|
||||||
|
// Killing Floor 2
|
||||||
|
// Copyright (C) 2015 Tripwire Interactive LLC
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
`define MsgSystem class'MessageSystem'.static.GetInstance()
|
||||||
|
|
||||||
|
|
||||||
|
/* Behavior tree macros */
|
||||||
|
|
||||||
|
`if(`isdefined(FINAL_RELEASE))
|
||||||
|
|
||||||
|
`define BTLog(msg)
|
||||||
|
`define BTLog_Ext(msg, object)
|
||||||
|
|
||||||
|
`define AILog(text)
|
||||||
|
`define AILog(text, category)
|
||||||
|
`define AILog(text, category, bForce)
|
||||||
|
`define AILog_Ext(text, category, object)
|
||||||
|
|
||||||
|
`define AILogNativeCallStack()
|
||||||
|
`define AILogScriptCallStack()
|
||||||
|
`define AILogNativeCallStack_Ext(actor)
|
||||||
|
`define AILogScriptCallStack_Ext(actor)
|
||||||
|
`define AILogSpaceLine(Owner, Start, End)
|
||||||
|
`define AILogSpaceLine(Owner, Start, End, Type)
|
||||||
|
`define AILogSpaceLine(Owner, Start, End, Type, Comment)
|
||||||
|
`define AILogSpaceLine(Owner, Start, End, Type, Comment, Category)
|
||||||
|
|
||||||
|
`define AILogSetContext(Owner)
|
||||||
|
|
||||||
|
`define DEBUGSTATE
|
||||||
|
|
||||||
|
`else
|
||||||
|
|
||||||
|
`define BTLog(msg) AILog_Internal(`msg, 'BehaviorTree')
|
||||||
|
`define BTLog_Ext(msg, object) if (`object != none) { `object.AILog_Internal(`msg, 'BehaviorTree' ); }
|
||||||
|
|
||||||
|
`define StaticEngineContext class'Engine'.static.GetEngine()
|
||||||
|
`define AILog(text) if( ! `StaticEngineContext.bDisableAILogging) {AILog_Internal(`text);}
|
||||||
|
`define AILog(text, category) if( ! `StaticEngineContext.bDisableAILogging) {AILog_Internal(`text,`category);}
|
||||||
|
`define AILog(text, category, bForce) if( ! `StaticEngineContext.bDisableAILogging) {AILog_Internal(`text,`category,`bForce);}
|
||||||
|
`define AILog_Ext(text, category, object) if( !`StaticEngineContext.bDIsableAILogging && `object != None ) { `object.AILog_Internal(`text,`category); }
|
||||||
|
|
||||||
|
`define AILogNativeCallStack() class'BaseAISubsystem'.static.GetAIDebugTool().DumpNativeCallStack(self)
|
||||||
|
`define AILogScriptCallStack() AILog_Internal(GetScriptTrace(),'CallStack')
|
||||||
|
|
||||||
|
`define AILogNativeCallStack_Ext(actor) class'BaseAISubsystem'.static.GetAIDebugTool().DumpNativeCallStack(`actor)
|
||||||
|
`define AILogScriptCallStack_Ext(actor) `actor.AILog_Internal(GetScriptTrace(),'CallStack')
|
||||||
|
|
||||||
|
`define AILogSpaceLine(Owner, Start, End) class'BaseAISubsystem'.static.GetAIDebugTool().LogSpaceLine(`Owner, `Start, `End, DLT_Generic)
|
||||||
|
`define AILogSpaceLine(Owner, Start, End, Type) class'BaseAISubsystem'.static.GetAIDebugTool().LogSpaceLine(`Owner, `Start, `End, `Type)
|
||||||
|
`define AILogSpaceLine(Owner, Start, End, Type, Comment) class'BaseAISubsystem'.static.GetAIDebugTool().LogSpaceLine(`Owner, `Start, `End, `Type, `Comment)
|
||||||
|
`define AILogSpaceLine(Owner, Start, End, Type, Comment, Category) class'BaseAISubsystem'.static.GetAIDebugTool().LogSpaceLine(`Owner, `Start, `End, `Type, `Comment, `Category)
|
||||||
|
|
||||||
|
|
||||||
|
`define AILogSetContext(Owner) class'BaseAISubsystem'.static.GetAIDebugTool().SetContext(`Owner)
|
||||||
|
|
||||||
|
`define DEBUGSTATE extends DEBUGSTATE
|
||||||
|
|
||||||
|
`endif
|
||||||
|
|
120
Core/Classes/Commandlet.uc
Normal file
120
Core/Classes/Commandlet.uc
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* UnrealScript Commandlet (command-line applet) class.
|
||||||
|
*
|
||||||
|
* Commandlets are executed from the ucc.exe command line utility, using the
|
||||||
|
* following syntax:
|
||||||
|
*
|
||||||
|
* yourgame.exe package_name.commandlet_class_name [parm=value]...
|
||||||
|
*
|
||||||
|
* for example:
|
||||||
|
*
|
||||||
|
* yourgame.exe Core.HelloWorldCommandlet
|
||||||
|
* yourgame.exe UnrealEd.MakeCommandlet
|
||||||
|
*
|
||||||
|
* As a convenience, if a user tries to run a commandlet and the exact
|
||||||
|
* name he types isn't found, then ucc.exe appends the text "commandlet"
|
||||||
|
* onto the name and tries again. Therefore, the following shortcuts
|
||||||
|
* perform identically to the above:
|
||||||
|
*
|
||||||
|
* yourgame.exe Core.HelloWorld
|
||||||
|
* yourgame.exe UnrealEd.Make
|
||||||
|
*
|
||||||
|
* Commandlets are executed in a "raw" UnrealScript environment, in which
|
||||||
|
* the game isn't loaded, the client code isn't loaded, no levels are
|
||||||
|
* loaded, and no actors exist.
|
||||||
|
*/
|
||||||
|
class Commandlet
|
||||||
|
extends Object
|
||||||
|
abstract
|
||||||
|
transient
|
||||||
|
native;
|
||||||
|
|
||||||
|
/** Description of the commandlet's purpose */
|
||||||
|
var localized string HelpDescription;
|
||||||
|
|
||||||
|
/** Usage template to show for "ucc help" */
|
||||||
|
var localized string HelpUsage;
|
||||||
|
|
||||||
|
/** Hyperlink for more info */
|
||||||
|
var localized string HelpWebLink;
|
||||||
|
|
||||||
|
/** The name of the parameter the commandlet takes */
|
||||||
|
var localized array<string> HelpParamNames;
|
||||||
|
|
||||||
|
/** The description of the parameter */
|
||||||
|
var localized array<string> HelpParamDescriptions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to load objects required in server, client, and editor context. If IsEditor is set to false, then a
|
||||||
|
* UGameEngine (or whatever the value of Engine.Engine.GameEngine is) will be created for the commandlet instead
|
||||||
|
* of a UEditorEngine (or Engine.Engine.EditorEngine), unless the commandlet overrides the CreateCustomEngine method.
|
||||||
|
*/
|
||||||
|
var bool IsServer, IsClient, IsEditor;
|
||||||
|
|
||||||
|
/** Whether to redirect standard log to the console */
|
||||||
|
var bool LogToConsole;
|
||||||
|
|
||||||
|
/** Whether to show standard error and warning count on exit */
|
||||||
|
var bool ShowErrorCount;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual INT Main(const FString& Params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a string into tokens, separating switches (beginning with - or /) from
|
||||||
|
* other parameters
|
||||||
|
*
|
||||||
|
* @param CmdLine the string to parse
|
||||||
|
* @param Tokens [out] filled with all parameters found in the string
|
||||||
|
* @param Switches [out] filled with all switches found in the string
|
||||||
|
*
|
||||||
|
* @return @todo
|
||||||
|
*/
|
||||||
|
static void ParseCommandLine( const TCHAR* CmdLine, TArray<FString>& Tokens, TArray<FString>& Switches )
|
||||||
|
{
|
||||||
|
FString NextToken;
|
||||||
|
while ( ParseToken(CmdLine, NextToken, FALSE) )
|
||||||
|
{
|
||||||
|
if ( **NextToken == TCHAR('-') || **NextToken == TCHAR('/') )
|
||||||
|
{
|
||||||
|
new(Switches) FString(NextToken.Mid(1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new(Tokens) FString(NextToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is where you put any custom code that needs to be executed from InitializeIntrinsicPropertyValues() in
|
||||||
|
* your commandlet
|
||||||
|
*/
|
||||||
|
void StaticInitialize() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows commandlets to override the default behavior and create a custom engine class for the commandlet. If
|
||||||
|
* the commandlet implements this function, it should fully initialize the UEngine object as well. Commandlets
|
||||||
|
* should indicate that they have implemented this function by assigning the custom UEngine to GEngine.
|
||||||
|
*/
|
||||||
|
virtual void CreateCustomEngine() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entry point for your commandlet
|
||||||
|
*
|
||||||
|
* @param Params the string containing the parameters for the commandlet
|
||||||
|
*/
|
||||||
|
event int Main(string Params);
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
IsServer=true
|
||||||
|
IsClient=true
|
||||||
|
IsEditor=true
|
||||||
|
LogToConsole=false
|
||||||
|
ShowErrorCount=true
|
||||||
|
}
|
89
Core/Classes/Component.uc
Normal file
89
Core/Classes/Component.uc
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* This class is the base class for any kind of object that wants the following features:
|
||||||
|
* - be a subobject inside a class definition (called the owner class)
|
||||||
|
* - values of the component can be overridden in a subclass of the owner class, by
|
||||||
|
* defining a component in the subclass with the same name as the component in the base class
|
||||||
|
* definition. Note, you CANNOT GIVE IT A CLASS= DEFINITION! (See UDN page for more info)
|
||||||
|
* - Changes to the default values to the component will be propagated to components that are
|
||||||
|
* created inside a map, unless the value was changed away from the default value in the editor.
|
||||||
|
*/
|
||||||
|
class Component extends Object
|
||||||
|
native
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
var const native Class TemplateOwnerClass;
|
||||||
|
var const native name TemplateName;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Given a subobject and an owner class, save a refernce to it for retrieveing defaults on load
|
||||||
|
* @param OriginalSubObject The original template for this subobject (or another instance for a duplication?)
|
||||||
|
* @param OwnerClass The class that contains the original template
|
||||||
|
* @param SubObjectName If the OriginalSubObject is NULL, manually set the name of the subobject to this
|
||||||
|
*/
|
||||||
|
void LinkToSourceDefaultObject(UComponent* OriginalComponent, UClass* OwnerClass, FName ComponentName = NAME_None);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the SourceDefaultObject onto our own memory to propagate any modified defaults
|
||||||
|
* @param Ar The archive used to serialize the pointer to the subobject template
|
||||||
|
*/
|
||||||
|
void PreSerialize(FArchive& Ar);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the Source DefaultObject onto our own memory to propagate any modified defaults
|
||||||
|
* @return The object pointed to by the SourceDefaultActorClass and SourceDefaultSubObjectName
|
||||||
|
*/
|
||||||
|
UComponent* ResolveSourceDefaultObject();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns name to use for this component in component instancing maps.
|
||||||
|
*
|
||||||
|
* @return a name for this component which is unique within a single object graph.
|
||||||
|
*/
|
||||||
|
FName GetInstanceMapName() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether this component was instanced from a component template.
|
||||||
|
*
|
||||||
|
* @return TRUE if this component was instanced from a template. FALSE if this component was created manually at runtime.
|
||||||
|
*/
|
||||||
|
UBOOL IsInstanced() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether native properties are identical to the one of the passed in component.
|
||||||
|
*
|
||||||
|
* @param Other Other component to compare against
|
||||||
|
*
|
||||||
|
* @return TRUE if native properties are identical, FALSE otherwise
|
||||||
|
*/
|
||||||
|
virtual UBOOL AreNativePropertiesIdenticalTo( UComponent* Other ) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback for retrieving a textual representation of natively serialized properties. Child classes should implement this method if they wish
|
||||||
|
* to have natively serialized property values included in things like diffcommandlet output.
|
||||||
|
*
|
||||||
|
* @param out_PropertyValues receives the property names and values which should be reported for this object. The map's key should be the name of
|
||||||
|
* the property and the map's value should be the textual representation of the property's value. The property value should
|
||||||
|
* be formatted the same way that UProperty::ExportText formats property values (i.e. for arrays, wrap in quotes and use a comma
|
||||||
|
* as the delimiter between elements, etc.)
|
||||||
|
* @param ExportFlags bitmask of EPropertyPortFlags used for modifying the format of the property values
|
||||||
|
*
|
||||||
|
* @return return TRUE if property values were added to the map.
|
||||||
|
*/
|
||||||
|
virtual UBOOL GetNativePropertyValues( TMap<FString,FString>& out_PropertyValues, DWORD ExportFlags=0 ) const;
|
||||||
|
|
||||||
|
// UObject interface.
|
||||||
|
|
||||||
|
virtual UBOOL IsPendingKill() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return if this object is a UComponent or subclass
|
||||||
|
*/
|
||||||
|
virtual UBOOL IsAComponent() const
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
131
Core/Classes/DistributionFloat.uc
Normal file
131
Core/Classes/DistributionFloat.uc
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class DistributionFloat extends Component
|
||||||
|
inherits(FCurveEdInterface)
|
||||||
|
native
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
editinlinenew
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
struct native RawDistributionFloat extends RawDistribution
|
||||||
|
{
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
#if !CONSOLE
|
||||||
|
/**
|
||||||
|
* Initialize a raw distribution from the original Unreal distribution
|
||||||
|
*/
|
||||||
|
void Initialize();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a pointer to the raw distribution if you can just call FRawDistribution::GetValue1 on it, otherwise NULL
|
||||||
|
*/
|
||||||
|
const FRawDistribution* GetFastRawDistribution();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value at the specified F
|
||||||
|
*/
|
||||||
|
FLOAT GetValue(FLOAT F=0.0f, UObject* Data=NULL, class FRandomStream* InRandomStream = NULL);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the min and max values
|
||||||
|
*/
|
||||||
|
void GetOutRange(FLOAT& MinOut, FLOAT& MaxOut);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is this distribution a uniform type? (ie, does it have two values per entry?)
|
||||||
|
*/
|
||||||
|
inline UBOOL IsUniform() { return LookupTableNumElements == 2; }
|
||||||
|
}
|
||||||
|
|
||||||
|
var() export noclear DistributionFloat Distribution;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct native MatineeRawDistributionFloat extends RawDistributionFloat
|
||||||
|
{
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the value at the specified F
|
||||||
|
*/
|
||||||
|
FLOAT GetValue(FLOAT F=0.0f, UObject* Data=NULL, class FRandomStream* InRandomStream = NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The value that will be modified by Matinee. */
|
||||||
|
var float MatineeValue;
|
||||||
|
|
||||||
|
/** TRUE when the value returned is controlled by matinee. */
|
||||||
|
var bool bInMatinee;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
|
||||||
|
#if !CONSOLE
|
||||||
|
/**
|
||||||
|
* Return the operation used at runtime to calculate the final value
|
||||||
|
*/
|
||||||
|
virtual ERawDistributionOperation GetOperation() { return RDO_None; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the lock flags used at runtime to calculate the final value
|
||||||
|
*/
|
||||||
|
virtual ERawDistributionLockFlags GetLockFlags(INT InIndex) { return RDL_None; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fill out an array of floats and return the number of elements in the entry
|
||||||
|
*
|
||||||
|
* @param Time The time to evaluate the distribution
|
||||||
|
* @param Values An array of values to be filled out, guaranteed to be big enough for 4 values
|
||||||
|
* @return The number of elements (values) set in the array
|
||||||
|
*/
|
||||||
|
virtual DWORD InitializeRawEntry(FLOAT Time, FLOAT* Values);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
virtual FLOAT GetValue( FLOAT F = 0.f, UObject* Data = NULL, class FRandomStream* InRandomStream = NULL );
|
||||||
|
|
||||||
|
virtual void GetInRange(FLOAT& MinIn, FLOAT& MaxIn);
|
||||||
|
virtual void GetOutRange(FLOAT& MinOut, FLOAT& MaxOut);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return whether or not this distribution can be baked into a FRawDistribution lookup table
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanBeBaked() const
|
||||||
|
{
|
||||||
|
return bCanBeBaked;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** UObject interface */
|
||||||
|
virtual void Serialize(FArchive& Ar);
|
||||||
|
|
||||||
|
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the distribution can be baked, then we don't need it on the client or server
|
||||||
|
*/
|
||||||
|
virtual UBOOL NeedsLoadForClient() const;
|
||||||
|
virtual UBOOL NeedsLoadForServer() const;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** Can this variable be baked out to a FRawDistribution? Should be TRUE 99% of the time*/
|
||||||
|
var(Baked) bool bCanBeBaked;
|
||||||
|
|
||||||
|
/** Set internally when the distribution is updated so that that FRawDistribution can know to update itself*/
|
||||||
|
var bool bIsDirty;
|
||||||
|
|
||||||
|
/** Script-accessible way to query a float distribution */
|
||||||
|
native function float GetFloatValue(optional float F = 0.0);
|
||||||
|
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bCanBeBaked=true
|
||||||
|
// make sure the FRawDistribution is initialized
|
||||||
|
bIsDirty=true
|
||||||
|
}
|
133
Core/Classes/DistributionVector.uc
Normal file
133
Core/Classes/DistributionVector.uc
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class DistributionVector extends Component
|
||||||
|
inherits(FCurveEdInterface)
|
||||||
|
native
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
editinlinenew
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
enum EDistributionVectorLockFlags
|
||||||
|
{
|
||||||
|
EDVLF_None,
|
||||||
|
EDVLF_XY,
|
||||||
|
EDVLF_XZ,
|
||||||
|
EDVLF_YZ,
|
||||||
|
EDVLF_XYZ
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EDistributionVectorMirrorFlags
|
||||||
|
{
|
||||||
|
EDVMF_Same,
|
||||||
|
EDVMF_Different,
|
||||||
|
EDVMF_Mirror
|
||||||
|
};
|
||||||
|
|
||||||
|
struct native RawDistributionVector extends RawDistribution
|
||||||
|
{
|
||||||
|
structcpptext
|
||||||
|
{
|
||||||
|
#if !CONSOLE
|
||||||
|
/**
|
||||||
|
* Initialize a raw distribution from the original Unreal distribution
|
||||||
|
*/
|
||||||
|
void Initialize();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a pointer to the raw distribution if you can just call FRawDistribution::GetValue3 on it, otherwise NULL
|
||||||
|
*/
|
||||||
|
const FRawDistribution *GetFastRawDistribution();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value at the specified F
|
||||||
|
*/
|
||||||
|
FVector GetValue(FLOAT F=0.0f, UObject* Data=NULL, INT LastExtreme=0, class FRandomStream* InRandomStream = NULL);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the min and max values
|
||||||
|
*/
|
||||||
|
void GetOutRange(FLOAT& MinOut, FLOAT& MaxOut);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is this distribution a uniform type? (ie, does it have two values per entry?)
|
||||||
|
*/
|
||||||
|
inline UBOOL IsUniform() { return LookupTableNumElements == 2; }
|
||||||
|
}
|
||||||
|
|
||||||
|
var() export noclear DistributionVector Distribution;
|
||||||
|
};
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
|
||||||
|
#if !CONSOLE
|
||||||
|
/**
|
||||||
|
* Return the operation used at runtime to calculate the final value
|
||||||
|
*/
|
||||||
|
virtual ERawDistributionOperation GetOperation() { return RDO_None; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the lock flags used at runtime to calculate the final value
|
||||||
|
*/
|
||||||
|
virtual ERawDistributionLockFlags GetLockFlags(INT InIndex) { return RDL_None; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the distribution is a uniform curve
|
||||||
|
*/
|
||||||
|
virtual UBOOL IsUniformCurve() { return FALSE; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fill out an array of vectors and return the number of elements in the entry
|
||||||
|
*
|
||||||
|
* @param Time The time to evaluate the distribution
|
||||||
|
* @param Values An array of values to be filled out, guaranteed to be big enough for 2 vectors
|
||||||
|
* @return The number of elements (values) set in the array
|
||||||
|
*/
|
||||||
|
virtual DWORD InitializeRawEntry(FLOAT Time, FVector* Values);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
virtual FVector GetValue( FLOAT F = 0.f, UObject* Data = NULL, INT LastExtreme = 0, class FRandomStream* InRandomStream = NULL );
|
||||||
|
|
||||||
|
virtual void GetInRange(FLOAT& MinIn, FLOAT& MaxIn);
|
||||||
|
virtual void GetOutRange(FLOAT& MinOut, FLOAT& MaxOut);
|
||||||
|
virtual void GetRange(FVector& OutMin, FVector& OutMax);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return whether or not this distribution can be baked into a FRawDistribution lookup table
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanBeBaked() const
|
||||||
|
{
|
||||||
|
return bCanBeBaked;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** UObject interface */
|
||||||
|
virtual void Serialize(FArchive& Ar);
|
||||||
|
|
||||||
|
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the distribution can be baked, then we don't need it on the client or server
|
||||||
|
*/
|
||||||
|
virtual UBOOL NeedsLoadForClient() const;
|
||||||
|
virtual UBOOL NeedsLoadForServer() const;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Can this variable be baked out to a FRawDistribution? Should be TRUE 99% of the time*/
|
||||||
|
var(Baked) bool bCanBeBaked;
|
||||||
|
|
||||||
|
/** Set internally when the distribution is updated so that that FRawDistribution can know to update itself*/
|
||||||
|
var bool bIsDirty;
|
||||||
|
|
||||||
|
/** Script-accessible way to query a vector distribution */
|
||||||
|
native function vector GetVectorValue(optional float F = 0.0, optional INT LastExtreme = 0);
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bCanBeBaked=true
|
||||||
|
// make sure the FRawDistribution is initialized
|
||||||
|
bIsDirty=true
|
||||||
|
}
|
28
Core/Classes/Factory.uc
Normal file
28
Core/Classes/Factory.uc
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* Base class for all factories
|
||||||
|
*
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class Factory extends Object
|
||||||
|
abstract
|
||||||
|
noexport
|
||||||
|
native;
|
||||||
|
|
||||||
|
var class SupportedClass;
|
||||||
|
var class ContextClass;
|
||||||
|
var string Description;
|
||||||
|
var array<string> Formats;
|
||||||
|
var bool bCreateNew;
|
||||||
|
var bool bEditAfterNew;
|
||||||
|
var bool bEditorImport;
|
||||||
|
var bool bText;
|
||||||
|
var int AutoPriority;
|
||||||
|
|
||||||
|
/** List of game names that this factory can be used for (if empty, all games valid) */
|
||||||
|
var array<string> ValidGameNames;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
Description = "";
|
||||||
|
}
|
||||||
|
|
20
Core/Classes/HelpCommandlet.uc
Normal file
20
Core/Classes/HelpCommandlet.uc
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** This commandlet finds and displays help information on other commandlets */
|
||||||
|
class HelpCommandlet extends Commandlet
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual INT Main(const FString& Params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Looks at the parameters and displays help based upon those parameters
|
||||||
|
*
|
||||||
|
* @param Params the string containing the parameters for the commandlet
|
||||||
|
*/
|
||||||
|
event int Main(string Params);
|
||||||
|
|
9
Core/Classes/Interface.uc
Normal file
9
Core/Classes/Interface.uc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* Base class for all interfaces
|
||||||
|
*
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
interface Interface
|
||||||
|
native;
|
||||||
|
|
||||||
|
|
2232
Core/Classes/Object.uc
Normal file
2232
Core/Classes/Object.uc
Normal file
File diff suppressed because it is too large
Load Diff
33
Core/Classes/Subsystem.uc
Normal file
33
Core/Classes/Subsystem.uc
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
//=============================================================================
|
||||||
|
// Subsystem: The base class all subsystems. Subsystems usually
|
||||||
|
// correspond to large C++ classes. The benefit of defining a C++ class as
|
||||||
|
// a subsystem is that you can make some of its variables script-accessible,
|
||||||
|
// and you can make some of its properties automatically saveable as part
|
||||||
|
// of the configuration.
|
||||||
|
//
|
||||||
|
// This is a built-in Unreal class and it shouldn't be modified.
|
||||||
|
//=============================================================================
|
||||||
|
class Subsystem extends Object
|
||||||
|
abstract
|
||||||
|
native
|
||||||
|
transient
|
||||||
|
inherits(FExec);
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
|
||||||
|
// USubsystem interface.
|
||||||
|
virtual void Tick( FLOAT DeltaTime )
|
||||||
|
{}
|
||||||
|
|
||||||
|
// FExec interface.
|
||||||
|
virtual UBOOL Exec( const TCHAR* Cmd, FOutputDevice& Ar ) { return 0; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
}
|
144
Core/Globals.uci
Normal file
144
Core/Globals.uci
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Globals.uci - Unreal Engine global include file for UnrealScript.
|
||||||
|
* Never include this file before the class definition.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Macro for including the current function name in a string.
|
||||||
|
*/
|
||||||
|
`define Location "("$Name$") `{ClassName}::"$GetStateName()$":"$GetFuncName()
|
||||||
|
`define StaticLocation "`{ClassName}::"$GetStateName()$":"$GetFuncName()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expands to an in-line if statement with a log if debug is defined;
|
||||||
|
* it expands to nothing if debug is not defined. The debug macro takes
|
||||||
|
* its value from the -debug flag on the script compilation command line.
|
||||||
|
*
|
||||||
|
* Also demonstrates how to use backslashes to declare a multi-line macro.
|
||||||
|
*
|
||||||
|
* @param msg the string that should be logged
|
||||||
|
* @param cond [opt] the condition that is used to evaluate whether the message should be written
|
||||||
|
* @param tag [opt] the tag for the log statement
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
this macro is now added to the hardcoded symbol table, so don't try adding it again
|
||||||
|
`if(`isdefined(debug))
|
||||||
|
`define Logd(msg,cond,tag)\
|
||||||
|
`if(`cond)\
|
||||||
|
if (`cond)\
|
||||||
|
`{endif}\
|
||||||
|
log(`msg`if(`tag),`tag`endif)
|
||||||
|
`else
|
||||||
|
`define Logd
|
||||||
|
`endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expands to an in-line if statement with a log unless FINAL_RELEASE is defined;
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param msg the string that should be logged
|
||||||
|
* @param cond [opt] the condition that is used to evaluate whether the message should be written
|
||||||
|
* @param tag [opt] the tag for the log statement
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
this macro is now added to the hardcoded symbol table, so don't try adding it again
|
||||||
|
`if( `isdefined(FINAL_RELEASE) )
|
||||||
|
`if(`isdefined(FINAL_RELEASE_DEBUGCONSOLE))
|
||||||
|
`define Log(msg,cond,tag) `if(`cond)if(`cond)`{endif}log(`msg`if(`tag),`tag`endif)
|
||||||
|
`else
|
||||||
|
`define Log(msg,cond,tag)
|
||||||
|
`endif
|
||||||
|
`else
|
||||||
|
`define Log(msg,cond,tag) `if(`cond)if(`cond)`{endif}log(`msg`if(`tag),`tag`endif)
|
||||||
|
`endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Macro for easily logging a property or function return value. Expands into a string
|
||||||
|
* containing the name of the expression and value of the expression.
|
||||||
|
* Useful for writing self-documenting log statements.
|
||||||
|
*
|
||||||
|
* @param expr the expression that you want to log
|
||||||
|
* @param name [opt] the text that will immediately preceed the expression's value
|
||||||
|
* in the log statement. if not specified, uses expr.
|
||||||
|
*/
|
||||||
|
`define ShowVar(expr,name) "`if(`name)`name`else`expr`endif:'"$`expr$"'"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Macro for easily logging a property or function return value. Expands into a string
|
||||||
|
* containing the name of the expression and value of the expression.
|
||||||
|
* Useful for writing self-documenting log statements.
|
||||||
|
*
|
||||||
|
* @param expr the expression that you want to log
|
||||||
|
* @param name [opt] the text that will immediately preceed the expression's value
|
||||||
|
* in the log statement. if not specified, uses expr.
|
||||||
|
*/
|
||||||
|
`define ShowEnum(enum,expr,name) "`if(`name)`name`else`expr`endif:'"$GetEnum(Enum'`enum',`expr)$"'"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Macro for easily logging the name of an object. Useful for logging objects without extraneous
|
||||||
|
* checks against None.
|
||||||
|
*
|
||||||
|
* @param obj the object that you want to log
|
||||||
|
* @param name [opt] the text that will immediately preceed the object's name
|
||||||
|
* in the log statement. if not specified, uses obj.
|
||||||
|
*/
|
||||||
|
`define ShowObj(Obj,name) "`if(`name)`name`else`Obj`endif:"$(`Obj != None ? string(`Obj.Name) : "None")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Macro for logging the entry into a function.
|
||||||
|
*
|
||||||
|
* @param msg [opt] any additional text you'd like included in the log message
|
||||||
|
* @param cond [opt] the condition that is used to evaluate whether the message should be written
|
||||||
|
*/
|
||||||
|
`define Entry(msg,cond,tag) `log(">> "$ `Location `if(`msg)@`msg`endif, `if(`cond), `cond`{endif}`if(`tag), `tag`{endif})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Macro for logging the exit from a function.
|
||||||
|
*
|
||||||
|
* @param msg [opt] any additional text you'd like included in the log message
|
||||||
|
* @param cond [opt] the condition that is used to evaluate whether the message should be written
|
||||||
|
*/
|
||||||
|
`define Exit(msg,cond,tag) `log("<< "$ `Location `if(`msg)@`msg`endif, `if(`cond), `cond`{endif}`if(`tag), `tag`{endif})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Macro for logging an IP address
|
||||||
|
*
|
||||||
|
* @param addr the IP address you want to log
|
||||||
|
*/
|
||||||
|
// `define ShowAddr(addr) " Addr:'"$IpAddrToString(`addr)$"'"
|
||||||
|
|
||||||
|
|
||||||
|
`define LogFatal(cat,msg) `log("FATAL:" @ `msg,,`cat)
|
||||||
|
`define LogError(cat,msg) `log("ERROR:" @ `msg,,`cat)
|
||||||
|
`define LogWarn(cat,msg) `log("WARN:" @ `msg,,`cat)
|
||||||
|
`define LogInfo(cat,msg) `log("INFO:" @ `msg,,`cat)
|
||||||
|
`define LogDebug(cat,msg) `log("DEBUG:" @ `msg,,`cat)
|
||||||
|
`define LogTrace(cat,msg) `log("TRACE:" @ `msg,,`cat)
|
||||||
|
|
||||||
|
/** Convenience macro for inventory debugging */
|
||||||
|
`define LogInv(msg) `log(WorldInfo.TimeSeconds @ "Self:" @ Self @ "Instigator:" @ Instigator @ GetStateName() $ "::" $ GetFuncName() @ `msg,,'Inventory')
|
||||||
|
`define DLog(msg) `Log(WorldInfo.TimeSeconds @ Self @ GetStateName() $ "::" $ GetFuncName() @ `msg)
|
||||||
|
|
||||||
|
/** This is a slick way to to do thing like: TimeSince(LastFoo) < Delta where the macro makes it a lot easier to read what the code is doing **/
|
||||||
|
`define TimeSince(Time) (WorldInfo.TimeSeconds - `Time)
|
||||||
|
/** This is used for classes which are object derived and do not have access to WorldInfo so we need to pass in the Actor to get a worldinfo **/
|
||||||
|
`define TimeSinceEx(Actor,Time) (`Actor.WorldInfo.TimeSeconds - `Time)
|
||||||
|
|
||||||
|
//@HSL_BEGIN_XBOX
|
||||||
|
`define AddUniqueItemToArray(Array,Item) if (`Array.Find(`Item) == INDEX_NONE) { `Array.AddItem(`Item); }
|
||||||
|
|
||||||
|
//@igs(jc): Make players and controllers 16 globally for our purposes. If you change these
|
||||||
|
// numbers, make sure you also adjust the ones in UnDingo.h
|
||||||
|
`define MAX_NUM_PLAYERS 24
|
||||||
|
`define MAX_NUM_CONTROLLERS 24
|
||||||
|
//@HSL_END_XBOX
|
||||||
|
|
||||||
|
/** To use WITH_PHYSX directive in uc files. Comment this out when using WITH_NOVODEX **/
|
||||||
|
`define WITH_PHYSX
|
49
Core/nFringeGlobals.uci
Normal file
49
Core/nFringeGlobals.uci
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/**
|
||||||
|
* Expands to an in-line if statement with a log if debug is defined;
|
||||||
|
* it expands to nothing if debug is not defined. The debug macro takes
|
||||||
|
* its value from the -debug flag on the script compilation command line.
|
||||||
|
*
|
||||||
|
* Also demonstrates how to use backslashes to declare a multi-line macro.
|
||||||
|
*
|
||||||
|
* @param msg the string that should be logged
|
||||||
|
* @param cond [opt] the condition that is used to evaluate whether the message should be written
|
||||||
|
* @param tag [opt] the tag for the log statement
|
||||||
|
*/
|
||||||
|
`if(`isdefined(debug))
|
||||||
|
`define logd(msg,cond,tag)\
|
||||||
|
`if(`cond)\
|
||||||
|
if (`cond)\
|
||||||
|
`{endif}\
|
||||||
|
log(`msg`if(`tag),`tag`endif)
|
||||||
|
`else
|
||||||
|
`define logd
|
||||||
|
`endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expands to an in-line if statement with a log unless FINAL_RELEASE is defined;
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param msg the string that should be logged
|
||||||
|
* @param cond [opt] the condition that is used to evaluate whether the message should be written
|
||||||
|
* @param tag [opt] the tag for the log statement
|
||||||
|
*/
|
||||||
|
`if(`isdefined(FINAL_RELEASE))
|
||||||
|
`define log(msg,cond,tag)
|
||||||
|
`else
|
||||||
|
`define log(msg,cond,tag) `if(`cond)if(`cond)`{endif}log(`msg`if(`tag),`tag`endif)
|
||||||
|
`endif
|
||||||
|
|
||||||
|
`if(`isdefined(FINAL_RELEASE))
|
||||||
|
`define warn(msg,cond)
|
||||||
|
`else
|
||||||
|
`define warn(msg,cond) `if(`cond)if(`cond)`{endif}warn(`msg)
|
||||||
|
`endif
|
||||||
|
|
||||||
|
`if(`isdefined(FINAL_RELEASE))
|
||||||
|
`define assert(cond)
|
||||||
|
`else
|
||||||
|
`define assert(cond) Assert(`cond)
|
||||||
|
`endif
|
||||||
|
|
||||||
|
`define ConditionalExtends(x)
|
||||||
|
|
48
Engine/Classes/AICommandBase.uc
Normal file
48
Engine/Classes/AICommandBase.uc
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class AICommandBase extends Object within AIController
|
||||||
|
native(AI)
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When determining the utility value one can think of it in these terms:
|
||||||
|
*
|
||||||
|
* -how important is doing this action compared to other actions
|
||||||
|
* -how exciting is doing this action compared to other actions
|
||||||
|
*
|
||||||
|
* e.g. I have 2 idle actions; reading a newspaper and picking on a pedestrian. Picking on the pedestrian is more existing
|
||||||
|
* so it should be higher rated than reading the newspaper
|
||||||
|
*
|
||||||
|
* e.g. I have an action am drinking ambrosia and responding to a threat. In this case drinking ambrosia is really
|
||||||
|
* important. At the same importance as "EngageThreat" classification. So we will add EngageThreat.UtilityStartVal
|
||||||
|
* to our utilty score to represent that.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Utility functions should be checking for the data that says whether or not something occured. They should NOT be
|
||||||
|
* checking for things like: If you were in an Idle Action and/or if your current Action has some property set.
|
||||||
|
* That is bad as that is causing undue coupling between Actions.
|
||||||
|
*
|
||||||
|
* Additionally, the Utilty Function rules all. Period.
|
||||||
|
*
|
||||||
|
* If things are not correctly occurring then the utility function is broken in some way.
|
||||||
|
* One should not try to set special bools on blackboard/controller/active state and then look for them
|
||||||
|
*
|
||||||
|
* If the current set of stimuli is not "valid" / "able to have data for the utility" then we need to
|
||||||
|
* more than likely add some generalized functionality to it.
|
||||||
|
*
|
||||||
|
* If that can not be done then we need to start along the "bool cloud" path in the stimulus struct But that should be the last option.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
static event int GetUtility( AIController InAI )
|
||||||
|
{
|
||||||
|
`warn( "AICommandBase Base Class GetUtility was called. Please have your Parent Type or your indiv AICmd implement this function" );
|
||||||
|
ScriptTrace();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
}
|
358
Engine/Classes/AIController.uc
Normal file
358
Engine/Classes/AIController.uc
Normal file
@ -0,0 +1,358 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AIController, the base class of AI.
|
||||||
|
//
|
||||||
|
// Controllers are non-physical actors that can be attached to a pawn to control
|
||||||
|
// its actions. AIControllers implement the artificial intelligence for the pawns they control.
|
||||||
|
//
|
||||||
|
//Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
//=============================================================================
|
||||||
|
class AIController extends Controller
|
||||||
|
native(AI);
|
||||||
|
|
||||||
|
`if(`notdefined(__TW_))
|
||||||
|
/** auto-adjust around corners, with no hitwall notification for controller or pawn
|
||||||
|
if wall is hit during a MoveTo() or MoveToward() latent execution. */
|
||||||
|
var bool bAdjustFromWalls;
|
||||||
|
`endif
|
||||||
|
|
||||||
|
/** skill, scaled by game difficulty (add difficulty to this value) */
|
||||||
|
var float Skill;
|
||||||
|
|
||||||
|
/** Move target from last scripted action */
|
||||||
|
var Actor ScriptedMoveTarget;
|
||||||
|
|
||||||
|
/** Route from last scripted action; if valid, sets ScriptedMoveTarget with the points along the route */
|
||||||
|
var Route ScriptedRoute;
|
||||||
|
|
||||||
|
/** if true, we're following the scripted route in reverse */
|
||||||
|
var bool bReverseScriptedRoute;
|
||||||
|
|
||||||
|
/** if ScriptedRoute is valid, the index of the current point we're moving to */
|
||||||
|
var int ScriptedRouteIndex;
|
||||||
|
|
||||||
|
/** view focus from last scripted action */
|
||||||
|
var Actor ScriptedFocus;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
INT AcceptNearbyPath(AActor *goal);
|
||||||
|
#if __TW_PATHFINDING_
|
||||||
|
virtual void AdjustFromWall(FVector HitNormal, AActor* HitActor);
|
||||||
|
#else
|
||||||
|
void AdjustFromWall(FVector HitNormal, AActor* HitActor);
|
||||||
|
#endif
|
||||||
|
virtual void SetAdjustLocation(FVector NewLoc,UBOOL bAdjust,UBOOL bOffsetFromBase=FALSE);
|
||||||
|
virtual FVector DesiredDirection();
|
||||||
|
|
||||||
|
/** Called when the AIController is destroyed via script */
|
||||||
|
virtual void PostScriptDestroyed();
|
||||||
|
}
|
||||||
|
|
||||||
|
event PreBeginPlay()
|
||||||
|
{
|
||||||
|
Super.PreBeginPlay();
|
||||||
|
if ( bDeleteMe )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( WorldInfo.Game != None )
|
||||||
|
Skill += WorldInfo.Game.GetModifiedGameDifficulty();
|
||||||
|
Skill = FClamp(Skill, 0, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
`if(`__TW_PATHFINDING_)
|
||||||
|
// Adding declaration here for easier ability to call this event from native code in Engine
|
||||||
|
event AILog_Internal( coerce string LogText, optional Name LogCategory, optional bool bForce, optional bool BugIt, optional bool bSkipExtraInfo );
|
||||||
|
`endif
|
||||||
|
|
||||||
|
/* Reset()
|
||||||
|
reset actor to initial state - used when restarting level without reloading.
|
||||||
|
*/
|
||||||
|
function Reset()
|
||||||
|
{
|
||||||
|
Super.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* list important AIController variables on canvas. HUD will call DisplayDebug() on the current ViewTarget when
|
||||||
|
* the ShowDebug exec is used
|
||||||
|
*
|
||||||
|
* @param HUD - HUD with canvas to draw on
|
||||||
|
* @input out_YL - Height of the current font
|
||||||
|
* @input out_YPos - Y position on Canvas. out_YPos += out_YL, gives position to draw text for next debug line.
|
||||||
|
*/
|
||||||
|
simulated function DisplayDebug(HUD HUD, out float out_YL, out float out_YPos)
|
||||||
|
{
|
||||||
|
local int i;
|
||||||
|
local string T;
|
||||||
|
local Canvas Canvas;
|
||||||
|
|
||||||
|
Canvas = HUD.Canvas;
|
||||||
|
|
||||||
|
super.DisplayDebug(HUD, out_YL, out_YPos);
|
||||||
|
|
||||||
|
if (HUD.ShouldDisplayDebug('AI'))
|
||||||
|
{
|
||||||
|
Canvas.DrawColor.B = 255;
|
||||||
|
if ( (Pawn != None) && (MoveTarget != None) && Pawn.ReachedDestination(MoveTarget) )
|
||||||
|
Canvas.DrawText(" Skill "$Skill$" NAVIGATION MoveTarget "$GetItemName(String(MoveTarget))$"(REACHED) MoveTimer "$MoveTimer, false);
|
||||||
|
else
|
||||||
|
Canvas.DrawText(" Skill "$Skill$" NAVIGATION MoveTarget "$GetItemName(String(MoveTarget))$" MoveTimer "$MoveTimer, false);
|
||||||
|
out_YPos += out_YL;
|
||||||
|
Canvas.SetPos(4,out_YPos);
|
||||||
|
|
||||||
|
Canvas.DrawText(" Destination "$GetDestinationPosition()$" Focus "$GetItemName(string(Focus))$" Preparing Move "$bPreparingMove, false);
|
||||||
|
out_YPos += out_YL;
|
||||||
|
Canvas.SetPos(4,out_YPos);
|
||||||
|
|
||||||
|
Canvas.DrawText(" RouteGoal "$GetItemName(string(RouteGoal))$" RouteDist "$RouteDist, false);
|
||||||
|
out_YPos += out_YL;
|
||||||
|
Canvas.SetPos(4,out_YPos);
|
||||||
|
|
||||||
|
for ( i=0; i<RouteCache.Length; i++ )
|
||||||
|
{
|
||||||
|
if ( RouteCache[i] == None )
|
||||||
|
{
|
||||||
|
if ( i > 5 )
|
||||||
|
T = T$"--"$GetItemName(string(RouteCache[i-1]));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if ( i < 5 )
|
||||||
|
T = T$GetItemName(string(RouteCache[i]))$"-";
|
||||||
|
}
|
||||||
|
|
||||||
|
Canvas.DrawText(" RouteCache: "$T, false);
|
||||||
|
out_YPos += out_YL;
|
||||||
|
Canvas.SetPos(4,out_YPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
event SetTeam(int inTeamIdx)
|
||||||
|
{
|
||||||
|
WorldInfo.Game.ChangeTeam(self,inTeamIdx,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation)
|
||||||
|
{
|
||||||
|
// AI does things from the Pawn
|
||||||
|
if (Pawn != None)
|
||||||
|
{
|
||||||
|
out_Location = Pawn.Location;
|
||||||
|
out_Rotation = Pawn.Rotation;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Super.GetPlayerViewPoint(out_Location, out_Rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scripting hook to move this AI to a specific actor.
|
||||||
|
*/
|
||||||
|
function OnAIMoveToActor(SeqAct_AIMoveToActor Action)
|
||||||
|
{
|
||||||
|
local Actor DestActor;
|
||||||
|
local SeqVar_Object ObjVar;
|
||||||
|
|
||||||
|
// abort any previous latent moves
|
||||||
|
ClearLatentAction(class'SeqAct_AIMoveToActor',true,Action);
|
||||||
|
// pick a destination
|
||||||
|
DestActor = Action.PickDestination(Pawn);
|
||||||
|
// if we found a valid destination
|
||||||
|
if (DestActor != None)
|
||||||
|
{
|
||||||
|
// set the target and push our movement state
|
||||||
|
ScriptedRoute = Route(DestActor);
|
||||||
|
if (ScriptedRoute != None)
|
||||||
|
{
|
||||||
|
if (ScriptedRoute.RouteList.length == 0)
|
||||||
|
{
|
||||||
|
`warn("Invalid route with empty MoveList for scripted move");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ScriptedRouteIndex = 0;
|
||||||
|
if (!IsInState('ScriptedRouteMove'))
|
||||||
|
{
|
||||||
|
PushState('ScriptedRouteMove');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ScriptedMoveTarget = DestActor;
|
||||||
|
if (!IsInState('ScriptedMove'))
|
||||||
|
{
|
||||||
|
PushState('ScriptedMove');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// set AI focus, if one was specified
|
||||||
|
ScriptedFocus = None;
|
||||||
|
foreach Action.LinkedVariables(class'SeqVar_Object', ObjVar, "Look At")
|
||||||
|
{
|
||||||
|
ScriptedFocus = Actor(ObjVar.GetObjectValue());
|
||||||
|
if (ScriptedFocus != None)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
`warn("Invalid destination for scripted move");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple scripted movement state, attempts to pathfind to ScriptedMoveTarget and
|
||||||
|
* returns execution to previous state upon either success/failure.
|
||||||
|
*/
|
||||||
|
state ScriptedMove
|
||||||
|
{
|
||||||
|
event PoppedState()
|
||||||
|
{
|
||||||
|
if (ScriptedRoute == None)
|
||||||
|
{
|
||||||
|
// if we still have the move target, then finish the latent move
|
||||||
|
// otherwise consider it aborted
|
||||||
|
ClearLatentAction(class'SeqAct_AIMoveToActor', (ScriptedMoveTarget == None));
|
||||||
|
}
|
||||||
|
// and clear the scripted move target
|
||||||
|
ScriptedMoveTarget = None;
|
||||||
|
}
|
||||||
|
|
||||||
|
event PushedState()
|
||||||
|
{
|
||||||
|
if (Pawn != None)
|
||||||
|
{
|
||||||
|
// make sure the pawn physics are initialized
|
||||||
|
Pawn.SetMovementPhysics();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Begin:
|
||||||
|
// while we have a valid pawn and move target, and
|
||||||
|
// we haven't reached the target yet
|
||||||
|
while (Pawn != None &&
|
||||||
|
ScriptedMoveTarget != None &&
|
||||||
|
!Pawn.ReachedDestination(ScriptedMoveTarget))
|
||||||
|
{
|
||||||
|
// check to see if it is directly reachable
|
||||||
|
if (ActorReachable(ScriptedMoveTarget))
|
||||||
|
{
|
||||||
|
// then move directly to the actor
|
||||||
|
MoveToward(ScriptedMoveTarget, ScriptedFocus);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// attempt to find a path to the target
|
||||||
|
MoveTarget = FindPathToward(ScriptedMoveTarget);
|
||||||
|
if (MoveTarget != None)
|
||||||
|
{
|
||||||
|
// move to the first node on the path
|
||||||
|
MoveToward(MoveTarget, ScriptedFocus);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// abort the move
|
||||||
|
`warn("Failed to find path to"@ScriptedMoveTarget);
|
||||||
|
ScriptedMoveTarget = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// return to the previous state
|
||||||
|
PopState();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** scripted route movement state, pushes ScriptedMove for each point along the route */
|
||||||
|
state ScriptedRouteMove
|
||||||
|
{
|
||||||
|
event PoppedState()
|
||||||
|
{
|
||||||
|
// if we still have the move target, then finish the latent move
|
||||||
|
// otherwise consider it aborted
|
||||||
|
ClearLatentAction(class'SeqAct_AIMoveToActor', (ScriptedRoute == None));
|
||||||
|
ScriptedRoute = None;
|
||||||
|
}
|
||||||
|
|
||||||
|
Begin:
|
||||||
|
while (Pawn != None && ScriptedRoute != None && ScriptedRouteIndex < ScriptedRoute.RouteList.length && ScriptedRouteIndex >= 0)
|
||||||
|
{
|
||||||
|
ScriptedMoveTarget = ScriptedRoute.RouteList[ScriptedRouteIndex].Actor;
|
||||||
|
if (ScriptedMoveTarget != None)
|
||||||
|
{
|
||||||
|
PushState('ScriptedMove');
|
||||||
|
}
|
||||||
|
if (Pawn != None && Pawn.ReachedDestination(ScriptedRoute.RouteList[ScriptedRouteIndex].Actor))
|
||||||
|
{
|
||||||
|
if (bReverseScriptedRoute)
|
||||||
|
{
|
||||||
|
ScriptedRouteIndex--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ScriptedRouteIndex++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
`warn("Aborting scripted route");
|
||||||
|
ScriptedRoute = None;
|
||||||
|
PopState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Pawn != None && ScriptedRoute != None && ScriptedRoute.RouteList.length > 0)
|
||||||
|
{
|
||||||
|
switch (ScriptedRoute.RouteType)
|
||||||
|
{
|
||||||
|
case ERT_Linear:
|
||||||
|
PopState();
|
||||||
|
break;
|
||||||
|
case ERT_Loop:
|
||||||
|
bReverseScriptedRoute = !bReverseScriptedRoute;
|
||||||
|
// advance index by one to get back into valid range
|
||||||
|
if (bReverseScriptedRoute)
|
||||||
|
{
|
||||||
|
ScriptedRouteIndex--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ScriptedRouteIndex++;
|
||||||
|
}
|
||||||
|
Goto('Begin');
|
||||||
|
break;
|
||||||
|
case ERT_Circle:
|
||||||
|
ScriptedRouteIndex = 0;
|
||||||
|
Goto('Begin');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
`warn("Unknown route type");
|
||||||
|
ScriptedRoute = None;
|
||||||
|
PopState();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ScriptedRoute = None;
|
||||||
|
PopState();
|
||||||
|
}
|
||||||
|
|
||||||
|
// should never get here
|
||||||
|
`warn("Reached end of state execution");
|
||||||
|
ScriptedRoute = None;
|
||||||
|
PopState();
|
||||||
|
}
|
||||||
|
|
||||||
|
function NotifyWeaponFired(Weapon W, byte FireMode);
|
||||||
|
function NotifyWeaponFinishedFiring(Weapon W, byte FireMode);
|
||||||
|
|
||||||
|
function bool CanFireWeapon( Weapon Wpn, byte FireModeNum ) { return TRUE; }
|
||||||
|
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bAdjustFromWalls=true
|
||||||
|
bCanDoSpecial=true
|
||||||
|
MinHitWall=-0.5f
|
||||||
|
}
|
51
Engine/Classes/AISubsystem.uc
Normal file
51
Engine/Classes/AISubsystem.uc
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2008 PCF, All Rights Reserved.
|
||||||
|
* This class is here because Engine needs to hold a pointer to an instance of it.
|
||||||
|
*/
|
||||||
|
class AISubsystem extends Subsystem
|
||||||
|
abstract
|
||||||
|
native;
|
||||||
|
|
||||||
|
var bool bImplementsNavMeshGeneration;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void Init(UBOOL bEngineStart = FALSE) PURE_VIRTUAL(UAISubsystem::Init,);
|
||||||
|
virtual void CleanUp(UBOOL bShutDown = FALSE) PURE_VIRTUAL(UAISubsystem::CleanUp,);
|
||||||
|
|
||||||
|
/** to be called on new level loading */
|
||||||
|
virtual void Reset() PURE_VIRTUAL(UAISubsystem::Reset,);
|
||||||
|
|
||||||
|
virtual void PrepareMapChange() PURE_VIRTUAL(UAISubsystem::PrepareMapChange,);
|
||||||
|
/** GC started, after all CALLBACK_PreGarbageCollection */
|
||||||
|
virtual void OnLevelStreamedOut(ULevel* Level) PURE_VIRTUAL(UAISubsystem::OnLevelStreamedOut,);
|
||||||
|
|
||||||
|
/** interface for triggering nav mesh generation */
|
||||||
|
virtual UBOOL GenerateNavMesh() { return FALSE; }
|
||||||
|
|
||||||
|
virtual void OnPIEStart() PURE_VIRTUAL(UAISubsystem::OnPIEStart,);
|
||||||
|
virtual void OnPIEFinished() PURE_VIRTUAL(UAISubsystem::OnPIEFinished,);
|
||||||
|
|
||||||
|
virtual void ToggleNavBy(AActor* Referencer, UBOOL bEnable, BYTE NavFlag=0) PURE_VIRTUAL(UAISubsystem::ToggleNavBy,);
|
||||||
|
virtual void ToggleNavBy(UComponent* Referencer, UBOOL bEnable, BYTE NavFlag=0) PURE_VIRTUAL(UAISubsystem::ToggleNavBy,);
|
||||||
|
virtual void ToggleNavBy(ACoverLink* Referencer, INT SlotIdx, UBOOL bEnable, BYTE NavFlag=0) PURE_VIRTUAL(UAISubsystem::ToggleNavBy,);
|
||||||
|
|
||||||
|
virtual void UpdateActionAreas() PURE_VIRTUAL(UAISubsystem::UpdateActionAreas,);
|
||||||
|
}
|
||||||
|
|
||||||
|
final native static noexport function ToggleNavByActor(Actor Referencer, bool bEnable);
|
||||||
|
final native static noexport function ToggleNavByComponent(Component Referencer, bool bEnable);
|
||||||
|
final native static noexport function ToggleNavByCover(CoverLink Referencer, int SlotIdx, bool bEnable);
|
||||||
|
|
||||||
|
`if(`__TW_)
|
||||||
|
/** Used to access the difficulty values from KFGame for BaseAI */
|
||||||
|
event float GetDifficultyValue(int Index)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
`endif
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bImplementsNavMeshGeneration=false
|
||||||
|
}
|
56
Engine/Classes/AISwitchablePylon.uc
Normal file
56
Engine/Classes/AISwitchablePylon.uc
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AISwitchablePylon
|
||||||
|
//
|
||||||
|
// represents a mesh which is turned on/off via an AI triggerable switch at runtime.. e.g. an electronic gate, or a laser fence
|
||||||
|
//
|
||||||
|
// Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
//=============================================================================
|
||||||
|
class AISwitchablePylon extends Pylon
|
||||||
|
placeable
|
||||||
|
native(inherit);
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
/** returns TRUE if the path from Poly back to start has an edge which is linked to a switch which is linked to this
|
||||||
|
* pylon
|
||||||
|
* @param Edge - the edge linking Poly to the next neighbor in question
|
||||||
|
* @param Poly - the source poly (the current end-of-line poly in the chain)
|
||||||
|
* @return - TRUE if the previousPath chain of Poly has a switch linked to this pylon in it
|
||||||
|
*/
|
||||||
|
UBOOL HasSwitchLinkedToMeInPath(struct FNavMeshEdgeBase* Edge, struct FNavMeshPolyBase* Poly);
|
||||||
|
|
||||||
|
// overidden to deny access to edges when we're disabled and the path doesn't incorporate a switch linked to this pylon
|
||||||
|
virtual UBOOL CostFor( const FNavMeshPathParams& PathParams,
|
||||||
|
const FVector& PreviousPoint,
|
||||||
|
FVector& out_PathEdgePoint,
|
||||||
|
struct FNavMeshEdgeBase* Edge,
|
||||||
|
struct FNavMeshPolyBase* SourcePoly,
|
||||||
|
INT& out_Cost);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var() bool bOpen;
|
||||||
|
|
||||||
|
function PostBeginPlay()
|
||||||
|
{
|
||||||
|
Super.PostBeginPlay();
|
||||||
|
SetEnabled(bOpen);
|
||||||
|
}
|
||||||
|
|
||||||
|
event SetEnabled(bool bEnabled)
|
||||||
|
{
|
||||||
|
bOpen = bEnabled;
|
||||||
|
bForceObstacleMeshCollision = !bOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
event bool IsEnabled()
|
||||||
|
{
|
||||||
|
return bOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bNeedsCostCheck=true
|
||||||
|
bRouteBeginPlayEvenIfStatic=true
|
||||||
|
}
|
1687
Engine/Classes/AccessControl.uc
Normal file
1687
Engine/Classes/AccessControl.uc
Normal file
File diff suppressed because it is too large
Load Diff
4269
Engine/Classes/Actor.uc
Normal file
4269
Engine/Classes/Actor.uc
Normal file
File diff suppressed because it is too large
Load Diff
46
Engine/Classes/ActorComponent.uc
Normal file
46
Engine/Classes/ActorComponent.uc
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorComponent extends Component
|
||||||
|
native
|
||||||
|
noexport
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
var native transient const pointer Scene{FSceneInterface};
|
||||||
|
var transient const Actor Owner;
|
||||||
|
var native transient const bool bAttached;
|
||||||
|
var const bool bTickInEditor;
|
||||||
|
|
||||||
|
/** Is this component in need of an update? */
|
||||||
|
var transient const bool bNeedsReattach;
|
||||||
|
|
||||||
|
/** Is this component's transform in need of an update? */
|
||||||
|
var transient const bool bNeedsUpdateTransform;
|
||||||
|
|
||||||
|
/** The ticking group this component belongs to */
|
||||||
|
var const ETickingGroup TickGroup;
|
||||||
|
|
||||||
|
/** Changes the ticking group for this component */
|
||||||
|
native final function SetTickGroup(ETickingGroup NewTickGroup);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether or not the physics for this object should be 'fixed' (ie kinematic) or allowed to move with dynamics.
|
||||||
|
* If bFixed is true, all bodies within this component will be fixed.
|
||||||
|
* If bFixed is false, bodies will be set back to the default defined by their BodySetup.
|
||||||
|
*/
|
||||||
|
native final function SetComponentRBFixed(bool bFixed);
|
||||||
|
|
||||||
|
/** force this component to be updated right now
|
||||||
|
* component must be directly attached to its Owner (not attached to another component)
|
||||||
|
* @param bTransformOnly - if true, only update transform, otherwise do a full reattachment
|
||||||
|
*/
|
||||||
|
native final function ForceUpdate(bool bTransformOnly);
|
||||||
|
|
||||||
|
/** detaches the component from whatever it's attached to */
|
||||||
|
native final function DetachFromAny();
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
// All things now default to being ticked during async work
|
||||||
|
TickGroup=TG_DuringAsyncWork
|
||||||
|
}
|
91
Engine/Classes/ActorFactory.uc
Normal file
91
Engine/Classes/ActorFactory.uc
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactory extends Object
|
||||||
|
native
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
editinlinenew
|
||||||
|
config(Editor)
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
/** Called to actual create an actor at the supplied location/rotation, using the properties in the ActorFactory */
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
/** Fill in parameters automatically, possibly using the specified selection set. */
|
||||||
|
virtual void AutoFillFields(class USelection* Selection) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears references to resources [usually set by the call to AutoFillFields] when the factory has done its work. The default behavior
|
||||||
|
* (which is to call AutoFillFields() with an empty selection set) should be sufficient for most factories, but this method is provided
|
||||||
|
* to allow customized behavior.
|
||||||
|
*/
|
||||||
|
virtual void ClearFields();
|
||||||
|
|
||||||
|
/** Name to put on context menu. */
|
||||||
|
virtual FString GetMenuName() { return MenuName; }
|
||||||
|
|
||||||
|
/** Initialize NewActorClass if necessary, and return default actor for that class. */
|
||||||
|
virtual AActor* GetDefaultActor();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* This will check whether there is enough space to spawn an character.
|
||||||
|
* Additionally it will check the ActorFactoryData to for any overrides
|
||||||
|
* ( e.g. bCheckSpawnCollision )
|
||||||
|
*
|
||||||
|
* @return if there is enough space to spawn character at this location
|
||||||
|
**/
|
||||||
|
UBOOL IsEnoughRoomToSpawnPawn( const FVector* const Location, const class USeqAct_ActorFactory* const ActorFactoryData ) const;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/** class to spawn during gameplay; only used if NewActorClass is left at the default */
|
||||||
|
var class<Actor> GameplayActorClass;
|
||||||
|
|
||||||
|
/** Name used as basis for 'New Actor' menu. */
|
||||||
|
var string MenuName;
|
||||||
|
|
||||||
|
/** Indicates how far up the menu item should be. The higher the number, the higher up the list.*/
|
||||||
|
var config int MenuPriority;
|
||||||
|
|
||||||
|
/** DEPRECATED - Alternate value for menu priority; Used to allow things like modifier keys to access items in a different order. */
|
||||||
|
var deprecated int AlternateMenuPriority;
|
||||||
|
|
||||||
|
`if(`__TW_)
|
||||||
|
var string NewActorClassName;
|
||||||
|
`else
|
||||||
|
/** name of actor subclass this actorfactory creates - dynamically loaded. Overrides NewActorClass. */
|
||||||
|
var config string NewActorClassName;
|
||||||
|
`endif
|
||||||
|
|
||||||
|
/** Actor subclass this ActorFactory creates. */
|
||||||
|
var class<Actor> NewActorClass;
|
||||||
|
|
||||||
|
/** Whether to appear on menu (or this Factory only used through scripts etc.) */
|
||||||
|
var bool bPlaceable;
|
||||||
|
|
||||||
|
/** Whether to appear in the editor add actor quick menu */
|
||||||
|
var bool bShowInEditorQuickMenu;
|
||||||
|
|
||||||
|
/** Allows script to modify new actor */
|
||||||
|
simulated event PostCreateActor(Actor NewActor, optional const SeqAct_ActorFactory ActorFactoryData);
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Actor"
|
||||||
|
bPlaceable=true
|
||||||
|
bShowInEditorQuickMenu=false;
|
||||||
|
}
|
42
Engine/Classes/ActorFactoryAI.uc
Normal file
42
Engine/Classes/ActorFactoryAI.uc
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryAI extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual AActor* GetDefaultActor();
|
||||||
|
};
|
||||||
|
|
||||||
|
var() class<AIController> ControllerClass;
|
||||||
|
var() class<Pawn> PawnClass;
|
||||||
|
var() string PawnName;
|
||||||
|
|
||||||
|
/** whether or not to give the spawned Pawn the default inventory for the gametype being played */
|
||||||
|
var() bool bGiveDefaultInventory;
|
||||||
|
/** additional inventory to give the Pawn */
|
||||||
|
var() array< class<Inventory> > InventoryList;
|
||||||
|
/** what team to put the AI on */
|
||||||
|
var() int TeamIndex;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ControllerClass=class'AIController'
|
||||||
|
|
||||||
|
TeamIndex=255
|
||||||
|
bPlaceable=false
|
||||||
|
}
|
31
Engine/Classes/ActorFactoryActor.uc
Normal file
31
Engine/Classes/ActorFactoryActor.uc
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryActor extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual AActor* GetDefaultActor();
|
||||||
|
};
|
||||||
|
|
||||||
|
var() class<Actor> ActorClass;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
ActorClass=class'Actor'
|
||||||
|
bPlaceable=FALSE
|
||||||
|
}
|
39
Engine/Classes/ActorFactoryAmbientSound.uc
Normal file
39
Engine/Classes/ActorFactoryAmbientSound.uc
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* The base class of all ambient sound types
|
||||||
|
*/
|
||||||
|
class ActorFactoryAmbientSound extends ActorFactory
|
||||||
|
config( Editor )
|
||||||
|
collapsecategories
|
||||||
|
hidecategories( Object )
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
virtual void AutoFillFields( class USelection* Selection );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual FString GetMenuName( void );
|
||||||
|
|
||||||
|
void SetSoundCue( class AAmbientSound* NewSound );
|
||||||
|
}
|
||||||
|
|
||||||
|
var() SoundCue AmbientSoundCue;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add AmbientSound"
|
||||||
|
NewActorClass=class'Engine.AmbientSound'
|
||||||
|
bShowInEditorQuickMenu=true;
|
||||||
|
}
|
19
Engine/Classes/ActorFactoryAmbientSoundMovable.uc
Normal file
19
Engine/Classes/ActorFactoryAmbientSoundMovable.uc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryAmbientSoundMovable extends ActorFactoryAmbientSound
|
||||||
|
config( Editor )
|
||||||
|
hidecategories( Object )
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add AmbientSoundMovable"
|
||||||
|
NewActorClass=class'Engine.AmbientSoundMovable'
|
||||||
|
bShowInEditorQuickMenu=false;
|
||||||
|
}
|
19
Engine/Classes/ActorFactoryAmbientSoundNonLoop.uc
Normal file
19
Engine/Classes/ActorFactoryAmbientSoundNonLoop.uc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryAmbientSoundNonLoop extends ActorFactoryAmbientSoundSimple
|
||||||
|
config( Editor )
|
||||||
|
collapsecategories
|
||||||
|
hidecategories( Object )
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add AmbientSoundNonLoop"
|
||||||
|
NewActorClass=class'Engine.AmbientSoundNonLoop'
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryAmbientSoundNonLoopingToggleable extends ActorFactoryAmbientSoundSimpleToggleable
|
||||||
|
config( Editor )
|
||||||
|
collapsecategories
|
||||||
|
hidecategories( Object )
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add AmbientSoundNonLoopingToggleable"
|
||||||
|
NewActorClass=class'Engine.AmbientSoundNonLoopingToggleable'
|
||||||
|
}
|
36
Engine/Classes/ActorFactoryAmbientSoundSimple.uc
Normal file
36
Engine/Classes/ActorFactoryAmbientSoundSimple.uc
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryAmbientSoundSimple extends ActorFactory
|
||||||
|
config( Editor )
|
||||||
|
collapsecategories
|
||||||
|
hidecategories( Object )
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
virtual void AutoFillFields( class USelection* Selection );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual FString GetMenuName( void );
|
||||||
|
|
||||||
|
void SetSoundSlot( class AAmbientSoundSimple* NewSound );
|
||||||
|
}
|
||||||
|
|
||||||
|
var() SoundNodeWave SoundNodeWave;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add AmbientSoundSimple"
|
||||||
|
NewActorClass=class'Engine.AmbientSoundSimple'
|
||||||
|
}
|
19
Engine/Classes/ActorFactoryAmbientSoundSimpleToggleable.uc
Normal file
19
Engine/Classes/ActorFactoryAmbientSoundSimpleToggleable.uc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryAmbientSoundSimpleToggleable extends ActorFactoryAmbientSoundSimple
|
||||||
|
config( Editor )
|
||||||
|
collapsecategories
|
||||||
|
hidecategories( Object )
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add AmbientSoundSimpleToggleable"
|
||||||
|
NewActorClass=class'Engine.AmbientSoundSimpleToggleable'
|
||||||
|
}
|
66
Engine/Classes/ActorFactoryApexClothing.uc
Normal file
66
Engine/Classes/ActorFactoryApexClothing.uc
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
/*=============================================================================
|
||||||
|
ActorFactoryApexClothing.uc: Implement APEX Clothing Actor Factory
|
||||||
|
Copyright 2008-2009 NVIDIA corporation..
|
||||||
|
=============================================================================*/
|
||||||
|
class ActorFactoryApexClothing extends ActorFactorySkeletalMesh
|
||||||
|
config(Editor)
|
||||||
|
hidecategories(Object)
|
||||||
|
native(Physics);
|
||||||
|
|
||||||
|
/** List of clothing assets associated with each material in this mesh. */
|
||||||
|
var() array<ApexClothingAsset> ClothingAssets;
|
||||||
|
|
||||||
|
/** Allows setting the RBChannel flag on the spawned rigid body's StaticMeshComponent. */
|
||||||
|
var() const ERBCollisionChannel ClothingRBChannel;
|
||||||
|
|
||||||
|
/** Define the channels with which this actor will collide. */
|
||||||
|
var() const RBCollisionChannelContainer ClothingRBCollideWithChannels;
|
||||||
|
|
||||||
|
// NVCHANGE_BEGIN: DJS - Add clothing wind support to clothing actor factory
|
||||||
|
/** If TRUE, WindVelocity is applied in the local space of the component, rather than world space. */
|
||||||
|
var() bool bLocalSpaceWind;
|
||||||
|
|
||||||
|
/** The Wind Velocity applied to Apex Clothing */
|
||||||
|
var() vector WindVelocity;
|
||||||
|
|
||||||
|
/** Time taken for ApexClothing to reach WindVelocity */
|
||||||
|
var() float WindVelocityBlendTime;
|
||||||
|
// NVCHANGE_END: DJS - Add clothing wind support to clothing actor factory
|
||||||
|
|
||||||
|
// NVCHANGE_BEGIN: hlanker - Add wind noise
|
||||||
|
/** Maximum noise amplitude */
|
||||||
|
var() float WindStrengthNoiseBounds;
|
||||||
|
|
||||||
|
/** Maximum wind strength change per second */
|
||||||
|
var() float WindStrengthNoiseStepSize;
|
||||||
|
|
||||||
|
/** Higher probability to stay around the center */
|
||||||
|
var() bool bWindStrengthNoiseCentered;
|
||||||
|
|
||||||
|
/** Maximum angle (in radian) on direction noise*/
|
||||||
|
var() float WindDirNoiseBounds;
|
||||||
|
|
||||||
|
/** Maximum angle change (in radian per second) */
|
||||||
|
var() float WindDirNoiseStepSize;
|
||||||
|
|
||||||
|
/** Higher probability to stay around the center */
|
||||||
|
var() bool bWindDirNoiseCentered;
|
||||||
|
// NVCHANGE_END: hlanker - Add wind noise
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
virtual UBOOL CanCreateActor(FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE);
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Clothing";
|
||||||
|
NewActorClass=class'Engine.SkeletalMeshActor'
|
||||||
|
GameplayActorClass=class'Engine.SkeletalMeshActorSpawnable'
|
||||||
|
|
||||||
|
ClothingRBChannel=RBCC_Clothing
|
||||||
|
ClothingRBCollideWithChannels=(Default=TRUE,BlockingVolume=TRUE,GameplayPhysics=TRUE,EffectPhysics=TRUE,ClothingCollision=TRUE)
|
||||||
|
}
|
41
Engine/Classes/ActorFactoryApexDestructible.uc
Normal file
41
Engine/Classes/ActorFactoryApexDestructible.uc
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/*=============================================================================
|
||||||
|
ActorFactoryApexDestructible.uc: Apex integration for Destructible Assets
|
||||||
|
Copyright 2008-2009 NVIDIA corporation..
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
class ActorFactoryApexDestructible extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
virtual UBOOL CanCreateActor(FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE);
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
/** Starts the actor in an awake(dynamic) state */
|
||||||
|
var() bool bStartAwake;
|
||||||
|
|
||||||
|
/** Allows setting the RBChannel flag on the spawned rigid body's StaticMeshComponent. */
|
||||||
|
var() ERBCollisionChannel RBChannel;
|
||||||
|
|
||||||
|
/** Define the channels with which this actor will collide. */
|
||||||
|
var() const RBCollisionChannelContainer CollideWithChannels;
|
||||||
|
|
||||||
|
var() ApexDestructibleAsset DestructibleAsset;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add ApexDestructibleActor"
|
||||||
|
NewActorClass=class'Engine.ApexDestructibleActor'
|
||||||
|
GameplayActorClass=class'Engine.ApexDestructibleActorSpawnable'
|
||||||
|
bStartAwake=FALSE
|
||||||
|
RBChannel=RBCC_EffectPhysics
|
||||||
|
CollideWithChannels={(
|
||||||
|
Default=TRUE,
|
||||||
|
BlockingVolume=TRUE,
|
||||||
|
GameplayPhysics=TRUE,
|
||||||
|
EffectPhysics=TRUE
|
||||||
|
)}
|
||||||
|
}
|
32
Engine/Classes/ActorFactoryArchetype.uc
Normal file
32
Engine/Classes/ActorFactoryArchetype.uc
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryArchetype extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
virtual AActor* GetDefaultActor();
|
||||||
|
}
|
||||||
|
|
||||||
|
var() Actor ArchetypeActor;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Archetype"
|
||||||
|
}
|
15
Engine/Classes/ActorFactoryCoverLink.uc
Normal file
15
Engine/Classes/ActorFactoryCoverLink.uc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryCoverLink extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add CoverLink"
|
||||||
|
NewActorClass=class'Engine.CoverLink'
|
||||||
|
bShowInEditorQuickMenu=true
|
||||||
|
}
|
59
Engine/Classes/ActorFactoryDecal.uc
Normal file
59
Engine/Classes/ActorFactoryDecal.uc
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryDecal extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native(Decal);
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Called to create an actor at the supplied location/rotation
|
||||||
|
*
|
||||||
|
* @param Location Location to create the actor at
|
||||||
|
* @param Rotation Rotation to create the actor with
|
||||||
|
* @param ActorFactoryData Kismet object which spawns actors, could potentially have settings to use/override
|
||||||
|
*
|
||||||
|
* @return The newly created actor, NULL if it could not be created
|
||||||
|
*/
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor(FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fill the data fields of this actor with the current selection
|
||||||
|
*
|
||||||
|
* @param Selection Selection to use to fill this actor's data fields with
|
||||||
|
*/
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name this factory should show up as in a context-sensitive menu
|
||||||
|
*
|
||||||
|
* @return Name this factory should show up as in a menu
|
||||||
|
*/
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears references to resources [usually set by the call to AutoFillFields] when the factory has done its work. The default behavior
|
||||||
|
* (which is to call AutoFillFields() with an empty selection set) should be sufficient for most factories, but this method is provided
|
||||||
|
* to allow customized behavior.
|
||||||
|
*/
|
||||||
|
virtual void ClearFields();
|
||||||
|
}
|
||||||
|
|
||||||
|
var() MaterialInterface DecalMaterial;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Decal"
|
||||||
|
NewActorClass=class'Engine.DecalActor'
|
||||||
|
}
|
12
Engine/Classes/ActorFactoryDecalMovable.uc
Normal file
12
Engine/Classes/ActorFactoryDecalMovable.uc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryDecalMovable extends ActorFactoryDecal
|
||||||
|
config(Editor)
|
||||||
|
native(Decal);
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Movable Decal"
|
||||||
|
NewActorClass=class'Engine.DecalActorMovable'
|
||||||
|
}
|
28
Engine/Classes/ActorFactoryDominantDirectionalLight.uc
Normal file
28
Engine/Classes/ActorFactoryDominantDirectionalLight.uc
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryDominantDirectionalLight extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Light (DominantDirectionalLight)"
|
||||||
|
NewActorClass=class'Engine.DominantDirectionalLight'
|
||||||
|
bShowInEditorQuickMenu=true
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryDominantDirectionalLightMovable extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Returns whether the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can be used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If TRUE, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return TRUE if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Light (DominantDirectionalLightMovable)"
|
||||||
|
NewActorClass=class'Engine.DominantDirectionalLightMovable'
|
||||||
|
}
|
54
Engine/Classes/ActorFactoryDynamicSM.uc
Normal file
54
Engine/Classes/ActorFactoryDynamicSM.uc
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryDynamicSM extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
virtual void PostLoad();
|
||||||
|
}
|
||||||
|
|
||||||
|
var() StaticMesh StaticMesh;
|
||||||
|
var() vector DrawScale3D;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For encroachers, don't do the overlap check when they move. You will not get touch events for this actor moving, but it is much faster.
|
||||||
|
* So if you want touch events from volumes or triggers you need to set this to be FALSE.
|
||||||
|
* This is an optimisation for large numbers of PHYS_RigidBody actors for example.
|
||||||
|
* @see Actor.uc bNoEncroachCheck
|
||||||
|
*/
|
||||||
|
var() bool bNoEncroachCheck;
|
||||||
|
var() bool bNotifyRigidBodyCollision;
|
||||||
|
var() ECollisionType CollisionType;
|
||||||
|
var() bool bBlockRigidBody;
|
||||||
|
|
||||||
|
/** Try and use physics hardware for this spawned object. */
|
||||||
|
var() bool bUseCompartment;
|
||||||
|
|
||||||
|
/** If false, primitive does not cast dynamic shadows. */
|
||||||
|
var() bool bCastDynamicShadow;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
DrawScale3D=(X=1,Y=1,Z=1)
|
||||||
|
CollisionType=COLLIDE_NoCollision
|
||||||
|
bCastDynamicShadow=true
|
||||||
|
bBlockRigidBody=FALSE
|
||||||
|
}
|
36
Engine/Classes/ActorFactoryEmitter.uc
Normal file
36
Engine/Classes/ActorFactoryEmitter.uc
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryEmitter extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
|
||||||
|
var() ParticleSystem ParticleSystem;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Emitter"
|
||||||
|
NewActorClass=class'Engine.Emitter'
|
||||||
|
GameplayActorClass=class'Engine.EmitterSpawnable'
|
||||||
|
}
|
35
Engine/Classes/ActorFactoryFlex.uc
Normal file
35
Engine/Classes/ActorFactoryFlex.uc
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2012 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryFlex extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
var() StaticMesh StaticMesh;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add FlexActor"
|
||||||
|
NewActorClass=class'Engine.FlexActor'
|
||||||
|
|
||||||
|
}
|
51
Engine/Classes/ActorFactoryFlexForceField.uc
Normal file
51
Engine/Classes/ActorFactoryFlexForceField.uc
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/*=============================================================================
|
||||||
|
ActorFactoryFlexForceField.uc: Implement Flex force field Actor Factory
|
||||||
|
Copyright 2008-2011 NVIDIA corporation..
|
||||||
|
=============================================================================*/
|
||||||
|
class ActorFactoryFlexForceField extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
DontCollapseCategories
|
||||||
|
native(Physics);
|
||||||
|
|
||||||
|
/** Rotational field strength */
|
||||||
|
var(ForceField) float RotationalFieldStrength;
|
||||||
|
/** Radial field strength */
|
||||||
|
var(ForceField) float RadialFieldStrength;
|
||||||
|
/** Lift field strength */
|
||||||
|
var(ForceField) float LiftFieldStrength;
|
||||||
|
|
||||||
|
/** Height of capsule field */
|
||||||
|
var(ForceField) float CapsuleFieldHeight <ClampMin=0.0>;
|
||||||
|
/** Bottom radius of capsule field */
|
||||||
|
var(ForceField) float CapsuleFieldBottomRadius <ClampMin=0.0>;
|
||||||
|
/** Top radius of capsule field */
|
||||||
|
var(ForceField) float CapsuleFieldTopRadius <ClampMin=0.0>;
|
||||||
|
/** Percentage of distance from boundary to center where fade out starts */
|
||||||
|
var(ForceField) float BoundaryFadePercentage <ClampMin=0.0 | ClampMax=1.0>;
|
||||||
|
|
||||||
|
/** Percentage of noise applied to force field. 0 = None 1 = Infinite */
|
||||||
|
var(ForceField) float Noise <ClampMin=0.0 | ClampMax=1.0>;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
RotationalFieldStrength = 750
|
||||||
|
RadialFieldStrength = -400
|
||||||
|
LiftFieldStrength = 0.0
|
||||||
|
|
||||||
|
CapsuleFieldHeight = 200.0;
|
||||||
|
CapsuleFieldBottomRadius = 100.0;
|
||||||
|
CapsuleFieldTopRadius = 50.0;
|
||||||
|
|
||||||
|
BoundaryFadePercentage = 0.1
|
||||||
|
|
||||||
|
Noise = 0.0
|
||||||
|
|
||||||
|
MenuName="Add FlexForceField"
|
||||||
|
NewActorClass=class'Engine.FlexForceFieldActor'
|
||||||
|
}
|
29
Engine/Classes/ActorFactoryFogVolumeConstantDensityInfo.uc
Normal file
29
Engine/Classes/ActorFactoryFogVolumeConstantDensityInfo.uc
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryFogVolumeConstantDensityInfo extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native(FogVolume);
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Used to determine if we should add to context menu for example.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly );
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
}
|
||||||
|
|
||||||
|
var MaterialInterface SelectedMaterial;
|
||||||
|
var bool bNothingSelected;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add FogVolumeConstantDensityInfo"
|
||||||
|
NewActorClass=class'Engine.FogVolumeConstantDensityInfo'
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryFogVolumeLinearHalfspaceDensityInfo extends ActorFactoryFogVolumeConstantDensityInfo
|
||||||
|
config(Editor)
|
||||||
|
native(FogVolume);
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add FogVolumeLinearHalfspaceDensityInfo"
|
||||||
|
NewActorClass=class'Engine.FogVolumeLinearHalfspaceDensityInfo'
|
||||||
|
}
|
17
Engine/Classes/ActorFactoryFogVolumeSphericalDensityInfo.uc
Normal file
17
Engine/Classes/ActorFactoryFogVolumeSphericalDensityInfo.uc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryFogVolumeSphericalDensityInfo extends ActorFactoryFogVolumeConstantDensityInfo
|
||||||
|
config(Editor)
|
||||||
|
native(FogVolume);
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add FogVolumeSphericalDensityInfo"
|
||||||
|
NewActorClass=class'Engine.FogVolumeSphericalDensityInfo'
|
||||||
|
}
|
35
Engine/Classes/ActorFactoryFracturedStaticMesh.uc
Normal file
35
Engine/Classes/ActorFactoryFracturedStaticMesh.uc
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryFracturedStaticMesh extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
|
||||||
|
var() FracturedStaticMesh FracturedStaticMesh;
|
||||||
|
var() vector DrawScale3D;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
DrawScale3D=(X=1,Y=1,Z=1)
|
||||||
|
|
||||||
|
MenuName="Add FracturedStaticMesh"
|
||||||
|
NewActorClass=class'Engine.FracturedStaticMeshActor'
|
||||||
|
}
|
12
Engine/Classes/ActorFactoryInteractiveFoliage.uc
Normal file
12
Engine/Classes/ActorFactoryInteractiveFoliage.uc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryInteractiveFoliage extends ActorFactoryStaticMesh
|
||||||
|
config(Editor)
|
||||||
|
native(Foliage);
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add InteractiveFoliageActor"
|
||||||
|
NewActorClass=class'Engine.InteractiveFoliageActor'
|
||||||
|
}
|
35
Engine/Classes/ActorFactoryLensFlare.uc
Normal file
35
Engine/Classes/ActorFactoryLensFlare.uc
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryLensFlare extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
|
||||||
|
var() LensFlare LensFlareObject;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add LensFlare"
|
||||||
|
NewActorClass=class'Engine.LensFlareSource'
|
||||||
|
//GameplayActorClass=class'Engine.EmitterSpawnable'
|
||||||
|
}
|
15
Engine/Classes/ActorFactoryLight.uc
Normal file
15
Engine/Classes/ActorFactoryLight.uc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryLight extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Light (Point)"
|
||||||
|
NewActorClass=class'Engine.PointLight'
|
||||||
|
bShowInEditorQuickMenu=true
|
||||||
|
}
|
14
Engine/Classes/ActorFactoryMover.uc
Normal file
14
Engine/Classes/ActorFactoryMover.uc
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryMover extends ActorFactoryDynamicSM
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add InterpActor"
|
||||||
|
NewActorClass=class'Engine.InterpActor'
|
||||||
|
}
|
15
Engine/Classes/ActorFactoryPathNode.uc
Normal file
15
Engine/Classes/ActorFactoryPathNode.uc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryPathNode extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add PathNode"
|
||||||
|
NewActorClass=class'Engine.PathNode'
|
||||||
|
bShowInEditorQuickMenu=true
|
||||||
|
}
|
55
Engine/Classes/ActorFactoryPhysicsAsset.uc
Normal file
55
Engine/Classes/ActorFactoryPhysicsAsset.uc
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryPhysicsAsset extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
var() PhysicsAsset PhysicsAsset;
|
||||||
|
var() SkeletalMesh SkeletalMesh;
|
||||||
|
|
||||||
|
var() bool bStartAwake;
|
||||||
|
var() bool bDamageAppliesImpulse;
|
||||||
|
var() bool bNotifyRigidBodyCollision;
|
||||||
|
var() vector InitialVelocity;
|
||||||
|
var() vector DrawScale3D;
|
||||||
|
|
||||||
|
/** Try and use physics hardware for this spawned object. */
|
||||||
|
var() bool bUseCompartment;
|
||||||
|
|
||||||
|
/** If false, primitive does not cast dynamic shadows. */
|
||||||
|
var() bool bCastDynamicShadow;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void PreSave();
|
||||||
|
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add PhysicsAsset"
|
||||||
|
NewActorClass=class'Engine.KAsset'
|
||||||
|
GameplayActorClass=class'Engine.KAssetSpawnable'
|
||||||
|
|
||||||
|
DrawScale3D=(X=1,Y=1,Z=1)
|
||||||
|
bStartAwake=true
|
||||||
|
bDamageAppliesImpulse=true
|
||||||
|
bCastDynamicShadow=true
|
||||||
|
}
|
15
Engine/Classes/ActorFactoryPlayerStart.uc
Normal file
15
Engine/Classes/ActorFactoryPlayerStart.uc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryPlayerStart extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add PlayerStart"
|
||||||
|
NewActorClass=class'Engine.PlayerStart'
|
||||||
|
bShowInEditorQuickMenu=true
|
||||||
|
}
|
15
Engine/Classes/ActorFactoryPylon.uc
Normal file
15
Engine/Classes/ActorFactoryPylon.uc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryPylon extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Pylon"
|
||||||
|
NewActorClass=class'Engine.Pylon'
|
||||||
|
bShowInEditorQuickMenu=true
|
||||||
|
}
|
80
Engine/Classes/ActorFactoryRigidBody.uc
Normal file
80
Engine/Classes/ActorFactoryRigidBody.uc
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryRigidBody extends ActorFactoryDynamicSM
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
/** Should spawned Actor start simulating as soon as its created, or be 'asleep' until hit. */
|
||||||
|
var() bool bStartAwake;
|
||||||
|
|
||||||
|
/** Sets the bDamageAppliesImpulse flag on the new Actor. */
|
||||||
|
var() bool bDamageAppliesImpulse;
|
||||||
|
|
||||||
|
/** Indicates if the initial velocity settings below should be considered in the world space or local space of the spawn target actor. */
|
||||||
|
var() bool bLocalSpaceInitialVelocity;
|
||||||
|
|
||||||
|
/** Velocity that new rigid bodies will have when created. In the ref frame of the spawn target actor. */
|
||||||
|
var() vector InitialVelocity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If valid, Velocity added to InitialVelocity when creating actor.
|
||||||
|
* This is here in addition to InitialVelocity to maintain backwards compatibility.
|
||||||
|
*/
|
||||||
|
var() DistributionVector AdditionalVelocity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If valid, Angular Velocity given to newly spawned Actor.
|
||||||
|
*/
|
||||||
|
var() DistributionVector InitialAngularVelocity;
|
||||||
|
|
||||||
|
/** Allows setting the RBChannel flag on the spawned rigid body's StaticMeshComponent. */
|
||||||
|
var() ERBCollisionChannel RBChannel;
|
||||||
|
|
||||||
|
|
||||||
|
/** Enable 'Stay upright' torque, that tries to keep Z axis of KActor pointing along world Z */
|
||||||
|
var() bool bEnableStayUprightSpring;
|
||||||
|
|
||||||
|
/** Torque applied to try and keep KActor horizontal. */
|
||||||
|
var() float StayUprightTorqueFactor;
|
||||||
|
|
||||||
|
/** Max torque that can be applied to try and keep KActor horizontal */
|
||||||
|
var() float StayUprightMaxTorque;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
// UObject interface
|
||||||
|
virtual void PostLoad();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add RigidBody"
|
||||||
|
|
||||||
|
NewActorClass=class'Engine.KActor'
|
||||||
|
GameplayActorClass=class'Engine.KActorSpawnable'
|
||||||
|
|
||||||
|
bNoEncroachCheck=true
|
||||||
|
bStartAwake=true
|
||||||
|
bDamageAppliesImpulse=true
|
||||||
|
CollisionType=COLLIDE_BlockAll
|
||||||
|
RBChannel=RBCC_GameplayPhysics
|
||||||
|
bBlockRigidBody=TRUE
|
||||||
|
|
||||||
|
StayUprightTorqueFactor=1000.0
|
||||||
|
StayUprightMaxTorque=1500.0
|
||||||
|
}
|
35
Engine/Classes/ActorFactorySkeletalMesh.uc
Normal file
35
Engine/Classes/ActorFactorySkeletalMesh.uc
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactorySkeletalMesh extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
|
||||||
|
var() SkeletalMesh SkeletalMesh;
|
||||||
|
var() AnimSet AnimSet;
|
||||||
|
var() name AnimSequenceName;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add SkeletalMesh"
|
||||||
|
NewActorClass=class'Engine.SkeletalMeshActor'
|
||||||
|
GameplayActorClass=class'Engine.SkeletalMeshActorSpawnable'
|
||||||
|
}
|
12
Engine/Classes/ActorFactorySkeletalMeshCinematic.uc
Normal file
12
Engine/Classes/ActorFactorySkeletalMeshCinematic.uc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactorySkeletalMeshCinematic extends ActorFactorySkeletalMesh
|
||||||
|
config(Editor)
|
||||||
|
hidecategories(Object);
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add SkeletalMeshCinematic"
|
||||||
|
NewActorClass=class'Engine.SkeletalMeshCinematicActor'
|
||||||
|
}
|
12
Engine/Classes/ActorFactorySkeletalMeshMAT.uc
Normal file
12
Engine/Classes/ActorFactorySkeletalMeshMAT.uc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactorySkeletalMeshMAT extends ActorFactorySkeletalMesh
|
||||||
|
config(Editor)
|
||||||
|
hidecategories(Object);
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add SkeletalMeshMAT"
|
||||||
|
NewActorClass=class'Engine.SkeletalMeshActorMAT'
|
||||||
|
}
|
35
Engine/Classes/ActorFactoryStaticMesh.uc
Normal file
35
Engine/Classes/ActorFactoryStaticMesh.uc
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryStaticMesh extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual void AutoFillFields(class USelection* Selection);
|
||||||
|
virtual FString GetMenuName();
|
||||||
|
}
|
||||||
|
|
||||||
|
var() StaticMesh StaticMesh;
|
||||||
|
var() vector DrawScale3D;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
DrawScale3D=(X=1,Y=1,Z=1)
|
||||||
|
|
||||||
|
MenuName="Add StaticMesh"
|
||||||
|
NewActorClass=class'Engine.StaticMeshActor'
|
||||||
|
}
|
15
Engine/Classes/ActorFactoryTrigger.uc
Normal file
15
Engine/Classes/ActorFactoryTrigger.uc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryTrigger extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
collapsecategories
|
||||||
|
hidecategories(Object)
|
||||||
|
native;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MenuName="Add Trigger"
|
||||||
|
NewActorClass=class'Engine.Trigger'
|
||||||
|
bShowInEditorQuickMenu=true
|
||||||
|
}
|
31
Engine/Classes/ActorFactoryVehicle.uc
Normal file
31
Engine/Classes/ActorFactoryVehicle.uc
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class ActorFactoryVehicle extends ActorFactory
|
||||||
|
config(Editor)
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual AActor* CreateActor( const FVector* const Location, const FRotator* const Rotation, const class USeqAct_ActorFactory* const ActorFactoryData );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the ActorFactory thinks it could create an Actor with the current settings.
|
||||||
|
* Can Used to determine if we should add to context menu or if the factory can be used for drag and drop.
|
||||||
|
*
|
||||||
|
* @param OutErrorMsg Receives localized error string name if returning FALSE.
|
||||||
|
* @param bFromAssetOnly If true, the actor factory will check that a valid asset has been assigned from selection. If the factory always requires an asset to be selected, this param does not matter
|
||||||
|
* @return True if the actor can be created with this factory
|
||||||
|
*/
|
||||||
|
virtual UBOOL CanCreateActor( FString& OutErrorMsg, UBOOL bFromAssetOnly = FALSE );
|
||||||
|
|
||||||
|
virtual AActor* GetDefaultActor();
|
||||||
|
};
|
||||||
|
|
||||||
|
var() class<Vehicle> VehicleClass;
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
VehicleClass=class'Vehicle'
|
||||||
|
bPlaceable=false
|
||||||
|
}
|
79
Engine/Classes/Admin.uc
Normal file
79
Engine/Classes/Admin.uc
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
class Admin extends PlayerController
|
||||||
|
config(Game);
|
||||||
|
|
||||||
|
simulated event PostBeginPlay()
|
||||||
|
{
|
||||||
|
Super.PostBeginPlay();
|
||||||
|
AddCheats();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute an administrative console command on the server.
|
||||||
|
exec function Admin( string CommandLine )
|
||||||
|
{
|
||||||
|
ServerAdmin(CommandLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
reliable server function ServerAdmin( string CommandLine )
|
||||||
|
{
|
||||||
|
local string Result;
|
||||||
|
|
||||||
|
Result = ConsoleCommand( CommandLine );
|
||||||
|
if( Result!="" )
|
||||||
|
ClientMessage( Result );
|
||||||
|
}
|
||||||
|
|
||||||
|
exec function KickBan( string S )
|
||||||
|
{
|
||||||
|
ServerKickBan(S);
|
||||||
|
}
|
||||||
|
|
||||||
|
reliable server function ServerKickBan( string S )
|
||||||
|
{
|
||||||
|
WorldInfo.Game.KickBan(S);
|
||||||
|
}
|
||||||
|
|
||||||
|
exec function Kick( string S )
|
||||||
|
{
|
||||||
|
ServerKick(S);
|
||||||
|
}
|
||||||
|
|
||||||
|
reliable server function ServerKick( string S )
|
||||||
|
{
|
||||||
|
WorldInfo.Game.Kick(S);
|
||||||
|
}
|
||||||
|
|
||||||
|
exec function PlayerList()
|
||||||
|
{
|
||||||
|
local PlayerReplicationInfo PRI;
|
||||||
|
|
||||||
|
`log("Player List:");
|
||||||
|
ForEach DynamicActors(class'PlayerReplicationInfo', PRI)
|
||||||
|
`log(PRI.PlayerName@"( ping"@PRI.Ping$")");
|
||||||
|
}
|
||||||
|
|
||||||
|
exec function RestartMap()
|
||||||
|
{
|
||||||
|
ServerRestartMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
reliable server function ServerRestartMap()
|
||||||
|
{
|
||||||
|
ClientTravel( "?restart", TRAVEL_Relative );
|
||||||
|
}
|
||||||
|
|
||||||
|
exec function Switch( string URL )
|
||||||
|
{
|
||||||
|
ServerSwitch(URL);
|
||||||
|
}
|
||||||
|
|
||||||
|
reliable server function ServerSwitch(string URL)
|
||||||
|
{
|
||||||
|
WorldInfo.ServerTravel(URL);
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
}
|
24
Engine/Classes/AdvancedReachSpec.uc
Normal file
24
Engine/Classes/AdvancedReachSpec.uc
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
//=============================================================================
|
||||||
|
// AdvancedReachSpec.
|
||||||
|
//
|
||||||
|
// An AdvancedReachspec can only be used by Controllers with bCanDoSpecial==true
|
||||||
|
//
|
||||||
|
// Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
|
||||||
|
class AdvancedReachSpec extends ReachSpec
|
||||||
|
native;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual FPlane PathColor()
|
||||||
|
{
|
||||||
|
// purple path = advanced
|
||||||
|
return FPlane(1.f,0.f,1.f, 0.f);
|
||||||
|
}
|
||||||
|
virtual INT CostFor(APawn* P);
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
bCanCutCorners=false
|
||||||
|
}
|
||||||
|
|
25
Engine/Classes/AkBank.uc
Normal file
25
Engine/Classes/AkBank.uc
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
class AkBank extends Object
|
||||||
|
native;
|
||||||
|
|
||||||
|
var() bool AutoLoad; // Auto-load bank when its package is accessed for the first time
|
||||||
|
var() bool GenerateDefinition; // This bank is part of the 'Generate All Definitions' list
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void PostLoad();
|
||||||
|
virtual void BeginDestroy();
|
||||||
|
|
||||||
|
UBOOL Load();
|
||||||
|
UBOOL LoadAsync( void* in_pfnBankCallback, void* in_pCookie );
|
||||||
|
void Unload();
|
||||||
|
void UnloadAsync( void* in_pfnBankCallback, void* in_pCookie );
|
||||||
|
|
||||||
|
void GetEventsReferencingBank( TArray<UAkEvent*>& Events );
|
||||||
|
void GenerateDefinitionFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
AutoLoad=true
|
||||||
|
GenerateDefinition=true
|
||||||
|
}
|
13
Engine/Classes/AkBaseSoundObject.uc
Normal file
13
Engine/Classes/AkBaseSoundObject.uc
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* Common Base class for AkEvents and SoundCues.
|
||||||
|
* The goal is mainly to reduce the footprint in the integration.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class AkBaseSoundObject extends Object
|
||||||
|
native
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual UBOOL IsAudible( const FVector& SourceLocation, const FVector& ListenerLocation, AActor* SourceActor, INT& bIsOccluded, UBOOL bCheckOcclusion ) {return FALSE;}
|
||||||
|
}
|
108
Engine/Classes/AkEvent.uc
Normal file
108
Engine/Classes/AkEvent.uc
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
class AkEvent extends AkBaseSoundObject
|
||||||
|
native;
|
||||||
|
|
||||||
|
var() AkBank RequiredBank;
|
||||||
|
|
||||||
|
/** The range at which the sound has attenuated completely (-1: no sound; 0: 2D; 3D otherwise) */
|
||||||
|
var(TW) const float MaxAudibleDistance<EditCondition=bOverrideMaxAudibleDistance>;
|
||||||
|
/** (Advanced) Check this flag to be able to modify MaxAudibleDistance instead of using the "MaxAttenuation" value from WWise */
|
||||||
|
var(TW) const bool bOverrideMaxAudibleDistance;
|
||||||
|
|
||||||
|
/** How long this event plays for */
|
||||||
|
var(TW) editconst float Duration;
|
||||||
|
|
||||||
|
/** Whether the sound is modified by the distance to listener */
|
||||||
|
var(TW) const bool bUseListenerDistance;
|
||||||
|
|
||||||
|
/** Whether to use the environment this event is played in to determine what sound Wwise should play */
|
||||||
|
var(TW) const bool bUseEnvironmentReverbSwitchGroup;
|
||||||
|
|
||||||
|
/** Whether to have the Doppler effect applied */
|
||||||
|
var(TW) const bool bUseDoppler;
|
||||||
|
|
||||||
|
/** Forces this event to be played at a location (using a pooled component) when played from WwiseClientHearSound */
|
||||||
|
var(TW) const bool bForceHearSoundLocational;
|
||||||
|
|
||||||
|
/** Whether this event needs its occlusion updated over time */
|
||||||
|
var(TW) const bool bNeedsOcclusionUpdates<EditCondition=!bNeverOcclude>;
|
||||||
|
/** How often to update occlusion or obstruction on owning component. Zero means never check. */
|
||||||
|
var const float OcclusionUpdateInterval;
|
||||||
|
/** If set, skip occlusion trace for updates (overrides bNeedsOcclusionUpdates) AND the initial audible test */
|
||||||
|
var(TW) const bool bNeverOcclude;
|
||||||
|
|
||||||
|
/** Whether this event is a background music track or not (used to set up exit cue callback) */
|
||||||
|
var(TW) const bool bIsMusicTrack;
|
||||||
|
|
||||||
|
struct native EventSwitchInfo
|
||||||
|
{
|
||||||
|
var() name SwitchGroupName;
|
||||||
|
var name SwitchName;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct native EventRTPCInfo
|
||||||
|
{
|
||||||
|
var() name RTPCName;
|
||||||
|
var float RTPCValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Add a tag if you want this event to use a specific Wwise game sync (switch/RTPC).
|
||||||
|
* In script, you will then have to check for the tag and add a game sync to the
|
||||||
|
* appropriate custom array.
|
||||||
|
*/
|
||||||
|
var(TW) array<Name> CustomTags;
|
||||||
|
var transient array<EventSwitchInfo> CustomSwitches;
|
||||||
|
var transient array<EventRTPCInfo> CustomRTPCs;
|
||||||
|
|
||||||
|
/** Whether to use advanced sound functionality with the sound
|
||||||
|
* having a rotational direction, and able to play dynamic
|
||||||
|
* echo sounds
|
||||||
|
*/
|
||||||
|
var(Advanced) bool bUseAdvancedSoundFunctionality;
|
||||||
|
|
||||||
|
/** Left Front Echo Sound */
|
||||||
|
var(Advanced) AkEvent EchoFront<EditCondition=bUseAdvancedSoundFunctionality>;
|
||||||
|
/** Right Front Echo Sound */
|
||||||
|
var(Advanced) AkEvent EchoLeft<EditCondition=bUseAdvancedSoundFunctionality>;
|
||||||
|
/** Left Rear Echo Sound */
|
||||||
|
var(Advanced) AkEvent EchoRight<EditCondition=bUseAdvancedSoundFunctionality>;
|
||||||
|
/** Right Rear Echo Sound */
|
||||||
|
var(Advanced) AkEvent EchoRear<EditCondition=bUseAdvancedSoundFunctionality>;
|
||||||
|
/** Mono Echo Sound */
|
||||||
|
var(Advanced) AkEvent EchoMono<EditCondition=bUseAdvancedSoundFunctionality>;
|
||||||
|
|
||||||
|
cpptext
|
||||||
|
{
|
||||||
|
virtual void PostLoad();
|
||||||
|
void FixRequiredBank();
|
||||||
|
|
||||||
|
UBOOL IsAudible( const FVector& SourceLocation, const FVector& ListenerLocation, AActor* SourceActor, INT& bIsOccluded, UBOOL bCheckOcclusion );
|
||||||
|
|
||||||
|
UBOOL LoadBank();
|
||||||
|
|
||||||
|
#if __TW_WWISE_ && WITH_EDITOR
|
||||||
|
void GenerateDefaultSettings();
|
||||||
|
void GenerateMaxAudibleDistance();
|
||||||
|
void GenerateMaxDuration();
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
simulated function SetCustomRTPC( name RTPCName, float RTPCValue )
|
||||||
|
{
|
||||||
|
local int RTPCIdx;
|
||||||
|
|
||||||
|
RTPCIdx = CustomRTPCs.Find( 'RTPCName', RTPCName );
|
||||||
|
if( RTPCIdx == INDEX_NONE )
|
||||||
|
{
|
||||||
|
CustomRTPCs.Add( 1 );
|
||||||
|
RTPCIdx = CustomRTPCs.Length - 1;
|
||||||
|
CustomRTPCs[RTPCIdx].RTPCName = RTPCName;
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomRTPCs[RTPCIdx].RTPCValue = RTPCValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
MaxAudibleDistance=4000.0
|
||||||
|
OcclusionUpdateInterval=0.2
|
||||||
|
}
|
25
Engine/Classes/AlienFXLEDInterface.uc
Normal file
25
Engine/Classes/AlienFXLEDInterface.uc
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
class AlienFXLEDInterface extends PlatformInterfaceBase
|
||||||
|
native(PlatformInterface);
|
||||||
|
|
||||||
|
var int Red;
|
||||||
|
var int Green;
|
||||||
|
var int Blue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform any initialization
|
||||||
|
*/
|
||||||
|
native event Init();
|
||||||
|
native event Activate();
|
||||||
|
native event bool SetColor(byte RedPercent, byte GreenPercent, byte BluePercent, byte Brightness = 255);
|
||||||
|
|
||||||
|
native event bool LedRestoreLighting();
|
||||||
|
native event bool LedStopEffects();
|
||||||
|
native function UpdateAlienFX();
|
||||||
|
//Depreciated dont use
|
||||||
|
native event bool LEDSetFlashingRBG(byte redPercentage, byte greenPercentage, byte bluePercentage,
|
||||||
|
int milliSecondsDuration, int milliSecondsInterval);
|
||||||
|
//Depreciated dont use
|
||||||
|
native event bool LEDPulseLighting(byte redPercentage, byte greenPercentage, byte bluePercentage, int
|
||||||
|
milliSecondsDuration, int milliSecondsInterval);
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user