I have checked if barbs is a player and:
code from newturn.lua:
print("------------------------------- TURN START");
for i = 0, GameDefines.MAX_MAJOR_CIVS + GameDefines.MAX_MINOR_CIVS - 1 do -- add CS to LD mirror
local player = Players;
if player:IsEverAlive() then
local civilizationType = player:GetCivilizationType();
local civid = player:GetID();
local LeaderType = player:GetLeaderType();
local MinorCivTrait = player:GetMinorCivTrait();
local CivName = player:GetName();
local CivNameKey = player:GetNameKey();
local Team= player:GetTeam();
local Personality= player:GetPersonality();
local PersonalityType= player:GetPersonalityType();
local Playable =0;
if ( player:IsPlayable() ) then
Playable = 1;
end
print("NEF: CivilizationType:",CivilizationType,", GetID():", civid ,", GetLeaderType():", LeaderType ,", GetMinorCivTrait():", MinorCivTrait ,", GetName():", CivName,"Team:", Team ,"Personality:", Personality ,"PersonalityType:", PersonalityType , "Playable:", Playable);
end
end
local barbplayer = Players[19];
local barbunit = 85;
if ( barbplayer:IsAlive() ) then
--local unit = barbplayer:InitUnit( barbunit, x, y); --add unit
print("NEF: Add Barbs unit at plot");
else print("NEF: Barbs is not alive");
end
Result:
NewTurn: ------------------------------- TURN START
NewTurn: NEF: CivilizationType: nil , GetID(): 0 , GetLeaderType(): 2 , GetMinorCivTrait(): -1 , GetName(): Augustus Caesar Team: 0 Personality: -1 PersonalityType: 2 Playable: 1
NewTurn: NEF: CivilizationType: nil , GetID(): 1 , GetLeaderType(): 20 , GetMinorCivTrait(): -1 , GetName(): Genghis Khan Team: 1 Personality: -1 PersonalityType: 20 Playable: 1
NewTurn: NEF: CivilizationType: nil , GetID(): 22 , GetLeaderType(): 3 , GetMinorCivTrait(): 2 , GetName(): Oslo Team: 22 Personality: 2 PersonalityType: 3 Playable: 0
NewTurn: NEF: CivilizationType: nil , GetID(): 23 , GetLeaderType(): 3 , GetMinorCivTrait(): 0 , GetName(): Florence Team: 23 Personality: 0 PersonalityType: 3 Playable: 0
NewTurn: NEF: CivilizationType: nil , GetID(): 24 , GetLeaderType(): 3 , GetMinorCivTrait(): 2 , GetName(): Helsinki Team: 24 Personality: 3 PersonalityType: 3 Playable: 0
NewTurn: NEF: CivilizationType: nil , GetID(): 25 , GetLeaderType(): 3 , GetMinorCivTrait(): 2 , GetName(): Venice Team: 25 Personality: 2 PersonalityType: 3 Playable: 0
NewTurn: NEF: Barbs is not alive
NewTurn: -------------------------------
It is turn 10 with barbs at the map. Barbs is not a player, so I don't need to active it. It just work as separate unit I think but I don't know how to add it.