Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWForceRecruitRoll console command not working #1749

Open
red2345 opened this issue Jun 5, 2024 · 1 comment
Open

LWForceRecruitRoll console command not working #1749

red2345 opened this issue Jun 5, 2024 · 1 comment

Comments

@red2345
Copy link

red2345 commented Jun 5, 2024

exec function LWForceRecruitRoll does not function correctly in LWOTC. The command is accepted in the console without error but nothing happens, even after waiting several days.

Source code from github:

exec function LWForceRecruitRoll(int Roll, optional name RegionName)
{
	local XComGameStateHistory History;
	local XComGameState NewGameState;
	local XComGameState_WorldRegion RegionState;
	local XComGameState_LWOutpost OutpostState;
	local XComGameState_LWOutpostManager OutpostManager;

	History = `XCOMHISTORY;

	NewGameState = class'XComGameStateContext_ChangeContainer'.static.CreateChangeState("CHEAT: ForceRecruitRoll");
	OutpostManager = class'XComGameState_LWOutpostManager'.static.GetOutpostManager();

	foreach History.IterateByClassType(class'XComGameState_WorldRegion', RegionState)
	{
		if(RegionName == '' || RegionState.GetMyTemplateName() == RegionName)
		{
			OutpostState = OutpostManager.GetOutpostForRegion(RegionState);
			OutpostState = XComGameState_LWOutpost(NewGameState.CreateStateObject(class'XComGameState_LWOutpost', OutpostState.ObjectID));
			NewGameState.AddStateObject(OutpostState);
			OutpostState.ForceRecruitRoll = Roll;
		}
	}

	if (NewGameState.GetNumGameStateObjects() > 0)
		`XCOMGAME.GameRuleset.SubmitGameState(NewGameState);
	else
		History.CleanupPendingGameState(NewGameState);
}
@Tedster59
Copy link
Collaborator

The command appears to override the RNG of the normal recruit job to determine what gets rolled (rebel, soldier, or possibly engineer/scientist in liberated region). You still need to actually recruit. Are you actually running the recruit job in the selected region?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants