[Help] Getting Pawn in Scoreboard

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

forrestmark9

FNG / Fresh Meat
Nov 29, 2011
1,110
40
0
I'm trying to setup a system that works with Marcos versus mod that basically does two things, Draws a zed icon next to the player based on how much a threat the zed is, and in the health section say ZED. My current problem is when getting the Pawn to check if they are a zed or not doesn't work, the icon will not draw but the health thing works but for only the owner and not anyone else.

This is the current code found within UpdateScoreboard

Code:
        //Show ZED possession
        if( Monster(Controller(PRI.Owner).Pawn)!=None )
        {
            ZEDIcon = GetZEDThreatTex(Controller(PRI.Owner));
            Canvas.SetPos(BoxXPos - PlayerBoxSizeY, (PlayerBoxSizeY + BoxSpaceY) * i + HeaderOffsetY + PlayerBoxSizeY*0.25);
            XL = PlayerBoxSizeY*0.5;
            Canvas.DrawTile(ZEDIcon, XL, XL, 0, 0, Texture(ZEDIcon).USize, Texture(ZEDIcon).VSize);
        }
 
        // draw healths
        if ( Monster(Controller(PRI.Owner).Pawn) != none )
        {
            Canvas.DrawColor = HUDClass.default.RedColor;
            S = "ZED";
        }
        else if ( PRI.bOutOfLives || KFPRI.PlayerHealth<=0 )
        {
            Canvas.DrawColor = HUDClass.default.RedColor;
            S = OutText;
        }
        else
        {
            if( KFPRI.PlayerHealth>=90 )
                Canvas.DrawColor = HUDClass.default.GreenColor;
            else if( KFPRI.PlayerHealth>=50 )
                Canvas.DrawColor = HUDClass.default.GoldColor;
            else Canvas.DrawColor = HUDClass.default.RedColor;
            S = KFPRI.PlayerHealth@HealthyString;
        }
        Canvas.TextSize(S, XL, YL);
        Canvas.SetPos(HealthXpos - 0.5 * XL, (PlayerBoxSizeY + BoxSpaceY) * i + BoxTextOffsetY);
        Canvas.DrawTextClipped(S);
 

poosh

Grizzled Veteran
Jan 6, 2011
3,403
327
83
Owner is replicated only to bNetOwner.
Pawns are not always relevant.
Controllers exist on server-side only (except local player controller).
 

Skell

Active member
Mar 21, 2013
1,245
2
38
On the Internet.
Owner is replicated only to bNetOwner.
Pawns are not always relevant.
Controllers exist on server-side only (except local player controller).
Yep. This is true.

A possible way of going about this is to use the PRIArray in the GameReplicationInfo. I'm not 100% certain enemy players will be in that list, but they should be.
 

forrestmark9

FNG / Fresh Meat
Nov 29, 2011
1,110
40
0
Owner is replicated only to bNetOwner.
Pawns are not always relevant.
Controllers exist on server-side only (except local player controller).

I fixed this issue by using a PRI var, when possessing a zed it sets IsZED to true and false when unpossessed