Jump to content

"Rejecting template name already in use" but mod is working - ignore warnings?


babautz

Recommended Posts

Hi Everyone,

 

I am working at my first small mod. I want to modify the ranks that rewarded soldiers from missions/HQ/Black market/POIs can roll. To achieve this, I extended the X2StrategyElement_DefaultRewards class and modified the function "GetPersonnelRewardRank". As far as I can see with my limited testing, the mod works flawlessly. However whenever i start the game in debug mode, multiple "Rejecting template name already in use" warnings appear. My question: Can I savely ignore these as long as my mod is working?

 

thank you in advance

//The Class uses the old GetPersonnelRewardRank function, additional content is marked below


class X2StrategyElement_DefaultRewards_BSR extends X2StrategyElement_DefaultRewards Config(BSR);


//Config Vars
var config bool bCannotExceedVanillaRank;

var config int RandRankThresh;
var config int MinRandRank;
var config int MaxRandRank;

//function that defines the rewarded personnel rank
function int GetPersonnelRewardRank(bool bIsSoldier, optional bool bIsRookie = false)
{
	local XComGameStateHistory History;
	local XComGameState_HeadquartersAlien AlienHQ;
	local int NewRank, idx;

	History = `XCOMHISTORY;
	AlienHQ = XComGameState_HeadquartersAlien(History.GetSingleGameStateObjectForClass(class'XComGameState_HeadquartersAlien'));
	NewRank = 1;

	if(bIsSoldier)
	{
		if (bIsRookie)
		{
			return 0;
		}

		for(idx = 0; idx < default.SoldierRewardForceLevelGates.Length; idx++)
		{
			if(AlienHQ.GetForceLevel() >= default.SoldierRewardForceLevelGates[idx])
			{
				NewRank++;
			}
		}

		//New code starts here				
		if(NewRank >= RandRankThresh)
		{
			if(bCannotExceedVanillaRank && (NewRank < MaxRandRank) )
			{
				NewRank = Rand(ABS(NewRank - MinRandRank) + 1) + MinRandRank;
			}
			else
			{
				NewRank = Rand(ABS(MaxRandRank - MinRandRank) + 1) + MinRandRank;
			}
		}
		//New code ends here
	}
	else
	{
		for(idx = 0; idx < default.CrewRewardForceLevelGates.Length; idx++)
		{
			if(AlienHQ.GetForceLevel() >= default.CrewRewardForceLevelGates[idx])
			{
				NewRank++;
			}
		}
	}

	return NewRank;
}
Edited by babautz
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...