Hi all,
I'm trying to script our mod such that we display an icon (a SpriteComponent, to be seen by all players) over the head of the player when they activate a trigger. Below is the code I've hooked into Kismet.
The commented out code (two lines) is Attempt #1. The other code is Attempt #2. In Attempt #1, the pawn is always the server's pawn, even if the client avatar activates the trigger. In Attempt #2, the pawn is always the client's pawn. Log messages on both client and server confirm this.
What I need is the pawn of the person who is doing the activation. I'm very confused. Any idea why this isn't working, or what I should be doing?
Any help would be massively appreciated.
Thanks!
- Captain Dee -
I'm trying to script our mod such that we display an icon (a SpriteComponent, to be seen by all players) over the head of the player when they activate a trigger. Below is the code I've hooked into Kismet.
The commented out code (two lines) is Attempt #1. The other code is Attempt #2. In Attempt #1, the pawn is always the server's pawn, even if the client avatar activates the trigger. In Attempt #2, the pawn is always the client's pawn. Log messages on both client and server confirm this.
What I need is the pawn of the person who is doing the activation. I'm very confused. Any idea why this isn't working, or what I should be doing?
Any help would be massively appreciated.
Thanks!
- Captain Dee -
class SeqAct_ShowTaskIcon extends SequenceAction;
var() Object PawnInput;
var() Object TaskInput; // Not being used right now
simulated event Activated()
{
// local DMI_Pawn pawn;
// pawn = DMI_Pawn(Controller(PawnInput).Pawn);
local SeqVar_Object ObjVar;
local DMI_Pawn P;
foreach LinkedVariables(class'SeqVar_Object', ObjVar, "Pawn")
{
P = DMI_Pawn(ObjVar.GetObjectValue());
if (P != None)
{
`log("*** SHOW ICON ***");
`log("*** KISMET PAWN INFO: " @ P);
P.ShowIcon(0);
}
}
}
defaultproperties
{
ObjName="Show Task Icon"
ObjCategory="Paranoia"
InputLinks(0)=(LinkDesc="In")
OutputLinks(0)=(LinkDesc="Out")
VariableLinks.Empty
VariableLinks(0)=(ExpectedType=class'SeqVar_Object',LinkDesc="Pawn",PropertyName=PawnInput)
VariableLinks(1)=(ExpectedType=class'SeqVar_ParanoiaTask',LinkDesc="Task",PropertyName=TaskInput)
}