
Originally Posted by
paco
Thanks Spoof, I tried that and it didn't work.
I've ended up just looping through the registered actors and calling their PostRenderFor() functions manually - seems to work fine. Not sure how much I lose by doing that vs the native function.
I'm having the same problem, and I'm interested in finding a better answer. As I understand it, calling the function manually won't work due to replication issues. Replication is still a scary word for me, but (I think) it means in a multiplayer environment the canvas drawings won't occur to each player.
The code I'm using is (almost) identical to that shown here : http://forums.epicgames.com/threads/...ing?p=28923356
DebugGame.uc
Code:
class DebugGame extends SimpleGame;
defaultproperties
{
DefaultPawnClass=class'Sand.DebugPawn'
HUDType=class'DebugHUD'
}
DebugHUD.uc
Code:
class DebugHUD extends HUD;
function PostRender()
{
local DebugPawn DebugPawn;
local Vector CameraLocation;
local Rotator CameraRotation;
Super.PostRender();
ForEach DynamicActors(class'DebugPawn', DebugPawn)
{
AddPostRenderedActor(DebugPawn);
}
if (PlayerOwner != None)
{
PlayerOwner.GetPlayerViewpoint(CameraLocation, CameraRotation);
LogInternal("Calling DrawActorOverlays. PostRenderActors size : "$PostRenderedActors.Length$" CameraLocation "$CameraLocation);
DrawActorOverlays(CameraLocation, CameraRotation);
}
}
defaultproperties
{
}
DebugPawn.uc
Code:
class DebugPawn extends UDKPawn
placeable;
var DynamicLightEnvironmentComponent LightEnvironment;
simulated function PostBeginPlay()
{
LogInternal("Hello From DebugPawn : "$Name);
Super.PostBeginPlay();
PlayerReplicationInfo = Spawn(class'PlayerReplicationInfo');
}
simulated function PostRenderFor(PlayerController PC, Canvas Canvas, vector CameraPosition, vector CameraDir)
{
`Log("PostRenderFor("$PC$","$Canvas$","$CameraPosition$","$CameraDir$")");
ScriptTrace();
Super.PostRenderFor(PC, Canvas, CameraPosition, CameraDir);
}
defaultproperties
{
Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
bSynthesizeSHLight=TRUE
bIsCharacterLightEnvironment=TRUE
bUseBooleanEnvironmentShadowing=FALSE
End Object
Components.Add(MyLightEnvironment)
LightEnvironment=MyLightEnvironment
Begin Object Class=SkeletalMeshComponent Name=WPawnSkeletalMeshComponent
bCacheAnimSequenceNodes=FALSE
AlwaysLoadOnClient=true
AlwaysLoadOnServer=true
bOwnerNoSee=true
CastShadow=true
BlockRigidBody=TRUE
bUpdateSkelWhenNotRendered=false
bIgnoreControllersWhenNotRendered=TRUE
bUpdateKinematicBonesFromAnimation=true
bCastDynamicShadow=true
Translation=(Z=8.0)
RBChannel=RBCC_Untitled3
RBCollideWithChannels=(Untitled3=true)
LightEnvironment=MyLightEnvironment
bOverrideAttachmentOwnerVisibility=true
bAcceptsDynamicDecals=FALSE
AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_Human'
bHasPhysicsAssetInstance=true
TickGroup=TG_PreAsyncWork
MinDistFactorForKinematicUpdate=0.2
bChartDistanceFactor=true
RBDominanceGroup=20
Scale=1.075
bUseOnePassLightingOnTranslucency=TRUE
bPerBoneMotionBlur=true
End Object
Mesh=WPawnSkeletalMeshComponent
Components.Add(WPawnSkeletalMeshComponent)
TeamBeaconMaxDist=16384.f
bPostRenderOtherTeam=true
bPostRenderIfNotVisible=true
}
Here is a snippet from the log when I run : > UDK.exe DevMap_Indoor_01?game=Sand.DebugGame -log
Code:
[0003.88] Log: LoadMap: DevMap_Indoor_01?Name=Player?Team=255?game=Sand.DebugGame
[0003.95] Log:
[0003.95] DevMemory: Memory allocations reported by the OS: 301.92 MB (with 0.00 MB waste)
[0003.96] DevMemory: Virtual memory tracked in the allocators: 122.57 MB (with 111.85 MB used, 3.01 MB slack and 7.72 MB waste)
[0004.66] Log: Game class is 'DebugGame'
[0004.70] Log: Primary PhysX scene will be in software.
[0004.70] Log: Creating Primary PhysX Scene.
[0004.70] Log: Bringing World DevMap_Indoor_01.TheWorld up for play (0) at 2012.04.08-19.10.26
[0004.72] Log: Bringing up level for play took: 0.048020
[0004.73] ScriptLog: Hello From DebugPawn : DebugPawn_0
[0004.74] Error: Can't start an online game that hasn't been created
[0004.74] Error: StartLocalVoiceProcessing(): Device is currently owned by another user
[0004.74] Log: ########### Finished loading level: 0.867289 seconds
[0004.75] Init: Game engine initialized
[0004.75] Log: Initializing Engine Completed
[0005.24] Log: >>>>>>>>>>>>>> Initial startup: 5.24s <<<<<<<<<<<<<<<
[0005.29] ScriptLog: Calling DrawActorOverlays. PostRenderActors size : 1 CameraLocation -352.00,0.00,-110.85
[0005.29] ScriptLog: Calling DrawActorOverlays. PostRenderActors size : 1 CameraLocation -352.00,0.00,-110.85
[0005.29] ScriptLog: Calling DrawActorOverlays. PostRenderActors size : 1 CameraLocation -352.00,0.00,-110.85
So, I'm pretty sure my Pawn is registered in the array, and I'm calling DrawActorOverlays regardles of bShowOverlays or other bools that may need to be set. Does anyone know what the problem might be?
Bookmarks