[SOLVED] Single Player Mission Build & Research Fail

I cannot get the build and research options to work for the player in single player. The following message is reported in the log file:

Warning, screen with name NewResearchMenu does not exist

This is triggered by the function Create_Trp_Carrier(), which is a copy of the Hiigaran one. It is trying to do the following:

UI_SetElementSize("NewResearchMenu", "NonCombat", 0, 0);

Which I believe is the command to set up the build and research UI so that you can access the menus. This all works fine in player vs CPU. Am I missing a single player game rule or something, to allow the trp race to build things?

this function only “hides” the NonCombat icon in the research screen.

If the game doesn’t find the NewResearchMenu, it means there could be an information missing in your race files, like a “canResearch” flag for example, and which is preventing the whole research screen to load (take a look in the /script/races/ folder and sub-folders)

But it works fine in player vs CPU… So it must be a mission thing, right?

not necessarily. There are a singleplayer and a scripts/research sub-folder in the races folders (and also def_research.lua and singleplayer_hacks.lua in there).
It could be triggered in any of those.

1 Like

Solved. The problem was not in the build and research files but in the .level file.

I was using the old format of:

player[0] = { id = 0, name = "", resources = 500, raceID = 10, startPos = 0} -- Player (Taiidan Republic)

instead of

player[0] = { id = 0, name = "", resources = 500, raceName = "TaiidanRepublic", startPos = 0} -- Player (Taiidan Republic)

It seems that raceID is not really used anymore…

1 Like

It’s the case since HWRM :wink:

And since Tags, the missions need to have rules with the same tags of player races etc…

And, it’s most important to have the correct name for player 0 in the mission to prevent issue with build menu and research menu.