• 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/

Code Problem with packages

I'm working on the coding for the mod Grabenkrieg. I have created our own GKPawn class that extends RSPawn.
This works well, I have my Roles set up and they work with my GKAlliedPawn/GKAxisPawn which extend GKPawn.
My custom GKAllied/Axis Level pawns are referenced in our custom GKGameInfo, this also works well.

Everything works fine until I want to swap the character meshes with my own.
I have created a package CHR_GK_IGA and imported my SkeletalMesh with textures and everything. Created a MIC which uses the RS common characters material as a base.
Everything looks fine in the SDK.
Spoiler!

But when I replace the Mesh in the code it doesn't seem to work ingame. It seems to fail at loading the mesh/MIC and reverts back to an untextured default RS Pawn.
Code:
//=============================================================================
// GKAxisPawn
//=============================================================================
// GK Axis player character.
//=============================================================================
// Grabenkrieg for Red Orchestra: Heroes Of Stalingrad Source
// - Fabian "Blitzk.-Bob" B.
// - Ignacio "Coin-goD" dB.
//=============================================================================
class GKAxisPawn extends GKPawn;

simulated event byte ScriptGetTeamNum()
{
    return `AXIS_TEAM_INDEX;
}

DefaultProperties
{
    // List of possible third person head and arms meshes
    HeadAndArmsMeshes(0)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A01'
    HeadAndArmsMeshes(1)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A02'
    HeadAndArmsMeshes(2)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A03'
    HeadAndArmsMeshes(3)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A04'
    HeadAndArmsMeshes(4)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A05'
    HeadAndArmsMeshes(5)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A06'
    HeadAndArmsMeshes(6)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A07'
    HeadAndArmsMeshes(7)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A08'

    //Head and arms MIC(s)
    HeadAndArmsMICs(0)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head01_M'
    HeadAndArmsMICs(1)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head02_M'
    HeadAndArmsMICs(2)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head03_M'
    HeadAndArmsMICs(3)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head04_M'
    HeadAndArmsMICs(4)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head05_M'
    HeadAndArmsMICs(5)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head06_M'
    HeadAndArmsMICs(6)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head07_M'
    HeadAndArmsMICs(7)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head08_M'

    // Third person sockets
    HeadgearAttachSocket=helmet

    // MIC(s)
    BodyMICTemplate=MaterialInstanceConstant'CHR_GK_IGA.MIC.M_IGA_Tunic_Raw_INST'//

    // List of possible first person arms meshes
    ArmsMeshesFP(0)=SkeletalMesh'1stP_Hands_Master.Mesh.1stP_Hands_Ger_Tunic'

    // Single-variant meshes
    PawnMesh_SV=SkeletalMesh'CHR_GK_IGA.Mesh.iga_tunic_raw'//'CHR_Ger_RawRecruit.Mesh.ger_rr_assault_low'

    // German specific animset
    Begin Object Name=ROPawnSkeletalMeshComponent
        AnimSets(0)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Stand_anim'
        AnimSets(1)=AnimSet'CHR_Playeranim_Master.Anim.CHR_ChestCover_anim'
        AnimSets(2)=AnimSet'CHR_Playeranim_Master.Anim.CHR_WaistCover_anim'
        AnimSets(3)=AnimSet'CHR_Playeranim_Master.Anim.CHR_StandCover_anim'
        AnimSets(4)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Crouch_anim'
        AnimSets(5)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Prone_anim'
        AnimSets(6)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Hand_Poses_Master'
        AnimSets(7)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Death_anim'
        AnimSets(8)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Tripod_anim'
        AnimSets(9)=AnimSet'CHR_Playeranim_Master.Anim.Special_Actions'
        AnimSets(10)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Melee'
        AnimSets(11)=AnimSet'CHR_Playeranim_Master.Anim.CHR_German_Unique'
        AnimSets(12)=None    // Reserved for weapon specific animations
        AnimSets(13)=AnimSet'CHR_RS_Playeranim_Master.Anim.CHR_RS_Hand_Poses_Master'
    End Object
/*
    // Third person Badge Component
    Begin Object class=StaticMeshComponent name=BadgeComponent0
        StaticMesh=StaticMesh'CHR_Badges.Meshes.German_Assault_Badge'
        LightEnvironment=MyLightEnvironment
        CastShadow=FALSE
        MaxDrawDistance=750
        CollideActors=false
        BlockActors=false
        BlockZeroExtent=false
        BlockNonZeroExtent=false
    End Object
    BadgeComponent=BadgeComponent0
*/
    // Gore
    // Gore_Pelvis=(GibClass=class'ROGameContent.ROGib_HumanTorso_GermanRawRecruit')
    Gore_LeftHand=(GibClass=class'ROGameContent.ROGib_HumanArm_GermanRawRecruit')
    Gore_RightHand=(GibClass=class'ROGameContent.ROGib_HumanArm_GermanRawRecruit')
    Gore_LeftLeg=(GibClass=class'ROGameContent.ROGib_HumanLeg_GermanRawRecruit')
    Gore_RightLeg=(GibClass=class'ROGameContent.ROGib_HumanLeg_GermanRawRecruit')
    UberGoreMesh=SkeletalMesh'CHR_goremesh.Mesh.Ger_RawRecruit_UltraGore'

    bSingleHandedSprinting=true
    bCanBanzaiCharge=true
}
Before making GKPawn entend RSPawn (Instead of ROPawn) and doing a few other changes I used to use a package made by Blitzk.-Bob that at least could load the Tunic mesh, but not the material.
One weird problem was that I had to set the game Character Detail to LOW or I would get a floating character...

But now it doesn't even load the mesh if I use that package either.

This is very confusing for me and I would like some feedback.

The package is stored in Unpublished/Packages/Grabenkrieg
The scripts are loaded and work, just not the mesh swapping.
All Scripts compile with no errors/warnings.

I use -useunpublished in the game. I thought that maybe I had to cook the package but I don't know how to do it, since cooking my test map doesn't cock the character package. It does cook my test GKGameMenues package though.
 
Last edited:
I'm working on the coding for the mod Grabenkrieg. I have created our own GKPawn class that extends RSPawn.
This works well, I have my Roles set up and they work with my GKAlliedPawn/GKAxisPawn which extend GKPawn.
My custom GKAllied/Axis Level pawns are referenced in our custom GKGameInfo, this also works well.

Everything works fine until I want to swap the character meshes with my own.
I have created a package CHR_GK_IGA and imported my SkeletalMesh with textures and everything. Created a MIC which uses the RS common characters material as a base.
Everything looks fine in the SDK.
Spoiler!

But when I replace the Mesh in the code it doesn't seem to work ingame. It seems to fail at loading the mesh/MIC and reverts back to an untextured default RS Pawn.
Code:
//=============================================================================
// GKAxisPawn
//=============================================================================
// GK Axis player character.
//=============================================================================
// Grabenkrieg for Red Orchestra: Heroes Of Stalingrad Source
// - Fabian "Blitzk.-Bob" B.
// - Ignacio "Coin-goD" dB.
//=============================================================================
class GKAxisPawn extends GKPawn;

simulated event byte ScriptGetTeamNum()
{
    return `AXIS_TEAM_INDEX;
}

DefaultProperties
{
    // List of possible third person head and arms meshes
    HeadAndArmsMeshes(0)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A01'
    HeadAndArmsMeshes(1)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A02'
    HeadAndArmsMeshes(2)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A03'
    HeadAndArmsMeshes(3)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A04'
    HeadAndArmsMeshes(4)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A05'
    HeadAndArmsMeshes(5)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A06'
    HeadAndArmsMeshes(6)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A07'
    HeadAndArmsMeshes(7)=SkeletalMesh'CHR_Ger_RawRecruit_Heads.Mesh.ger_rr_head_A08'

    //Head and arms MIC(s)
    HeadAndArmsMICs(0)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head01_M'
    HeadAndArmsMICs(1)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head02_M'
    HeadAndArmsMICs(2)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head03_M'
    HeadAndArmsMICs(3)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head04_M'
    HeadAndArmsMICs(4)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head05_M'
    HeadAndArmsMICs(5)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head06_M'
    HeadAndArmsMICs(6)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head07_M'
    HeadAndArmsMICs(7)=MaterialInstanceConstant'CHR_Ger_RawRecruit_Heads.Materials.Ger_Rank1_Head08_M'

    // Third person sockets
    HeadgearAttachSocket=helmet

    // MIC(s)
    BodyMICTemplate=MaterialInstanceConstant'CHR_GK_IGA.MIC.M_IGA_Tunic_Raw_INST'//

    // List of possible first person arms meshes
    ArmsMeshesFP(0)=SkeletalMesh'1stP_Hands_Master.Mesh.1stP_Hands_Ger_Tunic'

    // Single-variant meshes
    PawnMesh_SV=SkeletalMesh'CHR_GK_IGA.Mesh.iga_tunic_raw'//'CHR_Ger_RawRecruit.Mesh.ger_rr_assault_low'

    // German specific animset
    Begin Object Name=ROPawnSkeletalMeshComponent
        AnimSets(0)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Stand_anim'
        AnimSets(1)=AnimSet'CHR_Playeranim_Master.Anim.CHR_ChestCover_anim'
        AnimSets(2)=AnimSet'CHR_Playeranim_Master.Anim.CHR_WaistCover_anim'
        AnimSets(3)=AnimSet'CHR_Playeranim_Master.Anim.CHR_StandCover_anim'
        AnimSets(4)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Crouch_anim'
        AnimSets(5)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Prone_anim'
        AnimSets(6)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Hand_Poses_Master'
        AnimSets(7)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Death_anim'
        AnimSets(8)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Tripod_anim'
        AnimSets(9)=AnimSet'CHR_Playeranim_Master.Anim.Special_Actions'
        AnimSets(10)=AnimSet'CHR_Playeranim_Master.Anim.CHR_Melee'
        AnimSets(11)=AnimSet'CHR_Playeranim_Master.Anim.CHR_German_Unique'
        AnimSets(12)=None    // Reserved for weapon specific animations
        AnimSets(13)=AnimSet'CHR_RS_Playeranim_Master.Anim.CHR_RS_Hand_Poses_Master'
    End Object
/*
    // Third person Badge Component
    Begin Object class=StaticMeshComponent name=BadgeComponent0
        StaticMesh=StaticMesh'CHR_Badges.Meshes.German_Assault_Badge'
        LightEnvironment=MyLightEnvironment
        CastShadow=FALSE
        MaxDrawDistance=750
        CollideActors=false
        BlockActors=false
        BlockZeroExtent=false
        BlockNonZeroExtent=false
    End Object
    BadgeComponent=BadgeComponent0
*/
    // Gore
    // Gore_Pelvis=(GibClass=class'ROGameContent.ROGib_HumanTorso_GermanRawRecruit')
    Gore_LeftHand=(GibClass=class'ROGameContent.ROGib_HumanArm_GermanRawRecruit')
    Gore_RightHand=(GibClass=class'ROGameContent.ROGib_HumanArm_GermanRawRecruit')
    Gore_LeftLeg=(GibClass=class'ROGameContent.ROGib_HumanLeg_GermanRawRecruit')
    Gore_RightLeg=(GibClass=class'ROGameContent.ROGib_HumanLeg_GermanRawRecruit')
    UberGoreMesh=SkeletalMesh'CHR_goremesh.Mesh.Ger_RawRecruit_UltraGore'

    bSingleHandedSprinting=true
    bCanBanzaiCharge=true
}
Before making GKPawn entend RSPawn (Instead of ROPawn) and doing a few other changes I used to use a package made by Blitzk.-Bob that at least could load the Tunic mesh, but not the material.
One weird problem was that I had to set the game Character Detail to LOW or I would get a floating character...

But now it doesn't even load the mesh if I use that package either.

This is very confusing for me and I would like some feedback.

The package is stored in Unpublished/Packages/Grabenkrieg
The scripts are loaded and work, just not the mesh swapping.
All Scripts compile with no errors/warnings.

I use -useunpublished in the game. I thought that maybe I had to cook the package but I don't know how to do it, since cooking my test map doesn't cock the character package. It does cook my test GKGameMenues package though.

I hope Tripwire will help you. So sorry but i didint understand SDK.
 
Upvote 0
Thanks, I didn't know how to re-enable the warnings when compiling.

This is one of many similar warnings I get:
Code:
[0011.83] Log: C:\Program Files (x86)\Steam\SteamApps\common\Red Orchestra 2\Development\Src\GKGameContent\Classes\GKAxisPawn.uc(43) : Warning, ObjectProperty ROGame.ROPawn:BodyMICTemplate: unresolved reference to 'MaterialInstanceConstant'CHR_GK_IGA.MIC.M_IGA_Tunic_Raw_INST''
It can't seem to find the packages.
The package is in Unpublished/Packages/Grabenkrieg

Listed GKPawn and it showed my Rifleman pawn level 1 script loaded.
The package didn't list anything.
 
Last edited:
Upvote 0
Thanks, I didn't know how to re-enable the warnings when compiling.

This is one of many similar warnings I get:
Code:
[0011.83] Log: C:\Program Files (x86)\Steam\SteamApps\common\Red Orchestra 2\Development\Src\GKGameContent\Classes\GKAxisPawn.uc(43) : Warning, ObjectProperty ROGame.ROPawn:BodyMICTemplate: unresolved reference to 'MaterialInstanceConstant'CHR_GK_IGA.MIC.M_IGA_Tunic_Raw_INST''
It can't seem to find the packages.
The package is in Unpublished/Packages/Grabenkrieg

Listed GKPawn and it showed my Rifleman pawn level 1 script loaded.
The package didn't list anything.

The game won't load content from the Unpublished directory unless you launch with -useunpublished. Ideally, you would want to cook your CHR package which will create a published version.
 
Upvote 0