Help with scripting the Pharaoh respawn for Nomad

Hi all, I want to allow the Pharaoh to respawn on the Nomad map, so I want to change the relevant block in nomad.xs to this:

rmTriggerAddScriptLine(“rule \_disable_starting_units”);
rmTriggerAddScriptLine(“highFrequency”);
rmTriggerAddScriptLine(“active”);
rmTriggerAddScriptLine(“{”);
rmTriggerAddScriptLine("   for(int i = 1; i <= cNumberPlayers; i++)“);
rmTriggerAddScriptLine(”   {“);
rmTriggerAddScriptLine(”       trPlayerAllowStartingUnitsSpawning(i, false);“);
rmTriggerAddScriptLine(”       trTechSetStatus(i, cTechPharaohFirstSpawn, cTechStatusUnobtainable);“);
rmTriggerAddScriptLine(”       trTechSetStatus(i, cTechPharaohRespawn, cTechStatusObtainable);“);
rmTriggerAddScriptLine(”   }“);
rmTriggerAddScriptLine(”   xsDisableSelf();“);
rmTriggerAddScriptLine(”}");

However, this will spawn a Pharaoh for every player, not only Egyptian ones. Is there a scripting function I can call to see if a player is Eqyptian?

The basic command is

if(culture == cCultureEgyptian)

and to check all players with this statement you need to use the cNumberPlayers function to draw the amount of total players. Then, make a counter and increment it 1 for each player starting with the first player in default player order. At least that’s how I do it.

Where do you pass the player index?

Nevermind, I found some examples.

The code you posted form Nomad already does the player counting I mentioned, Couldn’t you just add the if statement to check for Egyptian culture into that chunk?

These rmTriggerAddScriptLine(string) functions are clearly passing hard code strings to some other script to run, so any variables need to be recreated. Unfortunately, calling rmGetPlayerCulture(int) from inside the script’s scope doesn’t seem to work, and I don’t know if it’s a good idea to include any additional libs in the script.